:root {
  --primary: #d90429;        /* rojo picante (botones, títulos) */
  --primary-dark: #a30320;   /* rojo oscuro (hover, barras) */
  --accent: #ff1744;         /* rojo vivo (detalles) */
  --bg: #ffffff;             /* fondo de la web */
  --surface: #ffffff;        /* tarjetas, menús */
  --surface-2: #f4e9ea;      /* bordes y fondos suaves */
  --tint: #fdf4f4;          /* fondo muy suave (pie) */
  --text: #1c1214;
  --muted: #6e5b5f;
  --ok: #3ccf7a;
  --radius: 14px;
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html { 
  scroll-behavior: smooth; 
  -webkit-text-size-adjust: 100%;
}

body { 
  background: var(--bg); 
  color: var(--text); 
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; 
  line-height: 1.6; 
  padding-bottom: 70px; 
}

a { 
  color: inherit; 
  text-decoration: none; 
}

em { 
  font-style: italic; 
  color: var(--accent); 
}

.container { 
  width: min(1200px, 92%); 
  margin: 0 auto; 
}

/* Botones */
.btn { 
  display: inline-block; 
  background: var(--primary); 
  color: #fff; 
  border: 1px solid var(--primary); 
  padding: 12px 22px; 
  border-radius: 999px; 
  font-weight: 600; 
  font-size: .9rem; 
  cursor: pointer; 
  transition: .2s; 
  text-align: center;
}

.btn:hover { background: var(--primary-dark); }
.btn-small { padding: 8px 16px; font-size: .8rem; }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* Aviso */
.notice { 
  background: var(--primary-dark); 
  text-align: center; 
  padding: 8px 12px; 
  font-size: .85rem; 
  color: #fff; 
  font-weight: 600; 
}

/* Cabecera */
.header { 
  position: sticky; 
  top: 0; 
  z-index: 50; 
  background: rgba(255,255,255,.95); 
  backdrop-filter: blur(8px); 
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface-2); 
  box-shadow: 0 2px 12px rgba(217,4,41,.06);
}

.header-inner { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 12px; 
  height: 65px; 
}

.logo { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  font-weight: 800; 
  letter-spacing: .08em; 
  white-space: nowrap;
}

.logo-text { color: var(--primary); font-size: 1.1rem; }

.nav { display: flex; gap: 22px; font-size: .8rem; letter-spacing: .06em; }
.nav a { color: var(--muted); transition: .2s; }
.nav a:hover, .nav a:focus-visible { color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.lang { position: relative; }
.lang-btn { background: none; border: 1px solid var(--surface-2); color: var(--text); padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: .8rem; }
.lang-menu { display: none; position: absolute; right: 0; top: 110%; background: var(--surface); border: 1px solid var(--surface-2); border-radius: 10px; min-width: 140px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.lang-menu.open { display: block; }
.lang-menu a { display: block; padding: 10px 14px; font-size: .85rem; }
.lang-menu a:hover { background: var(--surface-2); }

.burger { display: none; background: none; border: none; color: var(--text); font-size: 1.6rem; cursor: pointer; padding: 4px; }

/* Portada */
.hero { padding: 50px 0 35px; text-align: center; background: radial-gradient(ellipse at top, rgba(217,4,41,.13), transparent 65%), #fff; }
.hero h1 { font-size: clamp(1.6rem, 5vw, 2.8rem); line-height: 1.25; margin-bottom: 14px; color: var(--text); }
.hero h1 em, em { color: var(--primary); font-style: normal; }
.hero p { max-width: 680px; margin: 0 auto 24px; color: var(--muted); font-size: 0.95rem; }

/* Listado */
.listing { padding: 24px 0 40px; }
.counter { color: var(--muted); font-size: .88rem; margin-bottom: 16px; }
.counter strong { color: var(--primary); font-size: 1.05rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; }
.tab { background: #fff; color: var(--muted); border: 1px solid var(--surface-2); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: .82rem; }
.tab:hover { border-color: var(--primary); color: var(--primary); }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pill { background: var(--primary); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: .72rem; font-weight: 700; margin-left: 4px; }
.tab.active .pill { background: #fff; color: var(--primary); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--surface-2); border-radius: var(--radius); overflow: hidden; transition: .25s; display: flex; flex-direction: column; box-shadow: 0 4px 16px rgba(60,20,25,.07); }
.card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 12px 28px rgba(217,4,41,.16); }

.frame { position: relative; aspect-ratio: 3 / 4; display: block; overflow: hidden; background: var(--surface-2); color: var(--muted); font-size: .8rem; }
.badges { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 3; pointer-events: none; }
.badge { font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.65); color: #fff; }
.badge.ok { color: var(--ok); }
.badge.top { background: var(--primary); color: #fff; }
.badge.new { background: #fff; color: var(--primary); }

.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 1.05rem; color: var(--primary); }
.meta { color: var(--muted); font-size: .82rem; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: .7rem; background: #fbeaec; color: var(--primary-dark); padding: 3px 8px; border-radius: 6px; }
.card-body .btn { margin-top: auto; text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Filtros */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: .25s; z-index: 90; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(380px, 90%); background: var(--surface); z-index: 100; transform: translateX(100%); transition: .3s; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head, .drawer-foot { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--surface-2); }
.drawer-head h3 { color: var(--primary); }
.drawer-foot { border-top: 1px solid var(--surface-2); border-bottom: none; }
.close { background: none; border: none; color: var(--text); font-size: 1.2rem; cursor: pointer; }
.drawer-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.fgroup { margin-bottom: 22px; }
.fgroup-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 700; color: var(--text); }
.fgroup-head button { background: none; border: none; color: var(--accent); font-size: .78rem; cursor: pointer; }
.chip { display: inline-block; margin: 0 6px 8px 0; }
.chip input { display: none; }
.chip span { display: inline-block; padding: 7px 13px; border: 1px solid var(--surface-2); border-radius: 999px; font-size: .82rem; cursor: pointer; color: var(--muted); }
.chip span:hover { border-color: var(--primary); color: var(--primary); }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Textos */
.texts { padding: 20px 0 30px; max-width: 850px; }
.texts h2 { margin: 20px 0 10px; font-size: 1.35rem; color: var(--primary); }
.texts p { color: var(--muted); font-size: .95rem; }

/* Contacto */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; padding-bottom: 40px; }
.contact-card { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--surface-2); border-radius: var(--radius); padding: 16px 18px; transition: .2s; box-shadow: 0 4px 14px rgba(60,20,25,.06); }
.contact-card:hover { border-color: var(--primary); }
.contact-card small { display: block; color: var(--muted); font-size: .75rem; }
.contact-card strong { font-size: 1.05rem; color: var(--text); }
.contact-card span { color: var(--accent); font-size: 1.3rem; }

/* Pie */
.footer { background: var(--tint); border-top: 3px solid var(--primary); padding-top: 35px; padding-bottom: 75px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; padding-bottom: 24px; }
.footer h4 { margin-bottom: 12px; letter-spacing: .08em; color: var(--primary); }
.footer p { color: var(--muted); font-size: .9rem; }
.footer-grid a { display: block; color: var(--muted); font-size: .88rem; padding: 4px 0; }
.footer-grid a:hover { color: var(--primary); }
.social { display: flex; gap: 8px; margin-top: 12px; }
.social a { display: grid !important; place-items: center; width: 34px; height: 34px; border: 1px solid var(--surface-2); border-radius: 50%; color: var(--primary); }
.social a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 16px 0; border-top: 1px solid var(--surface-2); color: var(--muted); font-size: .8rem; }

/* Barra flotante */
.floating { 
  position: fixed; 
  bottom: 0; 
  left: 0; 
  right: 0; 
  z-index: 60; 
  display: flex; 
  background: var(--primary); 
  border-top: 1px solid var(--primary-dark);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(0,0,0,.15);
}
.floating a { 
  flex: 1; 
  text-align: center; 
  padding: 13px 4px; 
  font-size: .85rem; 
  font-weight: 600; 
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.2); 
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}
.floating a:last-child { border-right: none; }
.floating a:hover { background: var(--primary-dark); }

/* Adaptación Móvil / Responsive */
@media (max-width: 900px) {
  .nav { 
    display: none; 
    position: absolute; 
    top: 65px; 
    left: 0; 
    right: 0; 
    background: var(--surface); 
    flex-direction: column; 
    padding: 20px 6%; 
    gap: 16px; 
    border-bottom: 1px solid var(--surface-2); 
    box-shadow: 0 10px 20px rgba(0,0,0,.08);
  }
  .nav.open { display: flex; }
  .burger { display: block; }
  .header-actions .btn-small { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-body { padding: 10px; }
  .card-body h3 { font-size: .95rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .tabs { justify-content: space-between; width: 100%; }
  .tab { flex: 1; text-align: center; }
  .toolbar .btn { width: 100%; }
}

@media (max-width: 380px) {
  .cards { grid-template-columns: 1fr; }
}

/* ===== Fichas con fotos (carrusel) ===== */
body.lb-open { overflow: hidden; }
.frame-ph { position: absolute; inset: 0; display: grid; place-items: center; }
.slides { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior-x: contain; touch-action: pan-x pan-y; cursor: grab; outline: none; }
.slides::-webkit-scrollbar { display: none; }
.slides.dragging { scroll-snap-type: none; cursor: grabbing; }
.slide { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.slide img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; cursor: zoom-in; user-select: none; -webkit-user-drag: none; }
.slide-err { height: 100%; display: grid; place-items: center; padding: 14px; text-align: center; font-size: .72rem; color: #f0a0a0; word-break: break-all; background: var(--surface-2); }
.c-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 34px; height: 34px; border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 1.5rem; line-height: 1; padding: 0 0 3px; cursor: pointer; display: grid; place-items: center; opacity: .85; transition: opacity .2s, background .2s; }
.c-nav:hover { opacity: 1; background: var(--primary); }
.c-prev { left: 8px; }
.c-next { right: 8px; }
.dots { position: absolute; bottom: 10px; left: 0; right: 0; z-index: 4; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.45); }
.dot.active { background: #fff; }

/* ===== Galería a pantalla completa (lightbox) ===== */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.92); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 56px 20px 90px; }
.lightbox.open { display: flex; }
.lb-stage { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 0; }
.lb-img { max-width: 100%; max-height: calc(100vh - 190px); object-fit: contain; border-radius: 8px; }
.lb-stage figcaption { color: var(--muted); font-size: .85rem; }
.lb-close, .lb-nav { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 50%; width: 44px; height: 44px; font-size: 1.4rem; cursor: pointer; display: grid; place-items: center; }
.lb-close:hover, .lb-nav:hover { background: var(--primary); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-nav { font-size: 2rem; line-height: 1; padding-bottom: 4px; }
.lb-thumbs { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; max-width: 92%; overflow-x: auto; padding: 4px; }
.lb-thumbs img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; opacity: .55; cursor: pointer; border: 2px solid transparent; flex: none; }
.lb-thumbs img.active { opacity: 1; border-color: var(--accent); }

@media (max-width: 600px) {
  .lightbox { padding: 56px 12px 90px; }
  .lb-nav { width: 38px; height: 38px; }
}