/* components.css
   (depende de variables.css + base.css)
*/

/* =========================================================
   Hero / Header clásico
   ========================================================= */

.hero{
  position: relative;
  min-height: clamp(420px, 70vh, 720px);
  display: grid;
  align-items: center;
  color: var(--hero-fg, #fff);
  background:
    linear-gradient(
      to bottom,
      rgba(0,0,0,.45),
      rgba(0,0,0,.55)
    ),
    var(--hero-bg, url("/img/hero.jpg")) center / cover no-repeat;
}

/* Contenido */
.hero__inner{
  max-width: 1200px;
  margin-inline: auto;
  padding: var(--space-6) var(--space-4);
  display: grid;
  gap: var(--space-4);
}

.hero__title{
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.1;
  font-weight: 800;
  max-width: 18ch;
  color: var(--hero-title);
}

.hero__desc{
  font-size: 1.05rem;
  color: var(--hero-title);
  max-width: 48ch;
}

.hero__actions{
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Variantes útiles */
.hero--center .hero__inner{
  text-align: center;
  justify-items: center;
}

.hero--dark{
  --hero-fg: var(--color-text);
  background:
    linear-gradient(
      to bottom,
      rgba(255,255,255,.75),
      rgba(255,255,255,.85)
    ),
    var(--hero-bg, url("/img/hero.jpg")) center / cover no-repeat;
}

.hero--compact{
  min-height: 420px;
}

/* Section header */
.section__head{
    display: flex;
    gap: var(--space-2);
    margin-bottom: 16px;
    padding-bottom: 12px;
    justify-content: space-between;
    border-bottom: 1px solid var(--ui-border);
}

.section__title{
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.15;
}

.section__desc{
  margin: var(--space-1) 0 0;
  max-width: 65ch;
  color: var(--color-muted);
}

.section__actions{
    display: flex;
    gap: var(--space-3);
    flex-wrap: revert;
    flex-direction: row;
    align-items: center;
}

/* Variantes opcionales */
.section__head--center{
  text-align: center;
  justify-items: center;
}

.section__head--split{
  grid-template-columns: 1fr auto;
  align-items: end;
}

.section__head--split .section__actions{
  margin-top: 0;
  justify-content: flex-end;
}

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--btn-padding);
  border-radius: var(--btn-radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: var(--btn-shadow);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

.btn:hover{
  background: var(--btn-bg-hover);
  box-shadow: var(--btn-shadow-hover);
}


.btn:focus-visible{
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn--ghost{
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: none;
}

.btn--ghost:hover{
  background: var(--color-surface);
}

.btn--block{ width: 100%; }

/* Card */
.card{
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-1);
}

/* Form field (estilo “componente”) */
.field{
  display: grid;
  gap: var(--space-2);
}

.field__label{
  font-size: 0.875rem;
  color: var(--color-muted);
}

.input,
.select,
.textarea{
  padding: var(--space-3);
  background: var(--input-bg);
  color: var(--input-fg);
}

.help-text{
  font-size: 0.875rem;
  color: var(--color-muted);
}


/* =========================================================
   Top navigation
   ========================================================= */

.nav{
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--app-bg);
  border-bottom: 1px solid var(--color-border);
}

.nav__inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: 1200px;
  margin-inline: auto;
  padding: var(--space-3) var(--space-4);
}

/* Brand */
.nav__brand{
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  width: 100px;
}

/* Links */
.nav__links{
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav__link{
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  font-size: 0.95rem;
}

.nav__link:hover{
  background: var(--color-surface);
}
.nav__link.active{
  background: transparent;
  border: var(--color-surface) solid 2px;
}


/* Right actions */
.nav__actions{
  display: flex;
  align-items: center;
  gap: var(--space-2);
}


/* =========================================================
   Footer
   ========================================================= */

.footer{
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.footer__inner{
  max-width: 1200px;
  margin-inline: auto;
  padding: var(--space-8) var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

/* Brand / description */
.footer__brand{
  flex: 1 1 240px;
}

.footer__title{
  font-weight: 800;
  margin-bottom: var(--space-2);
}

.footer__text{
  color: var(--color-muted);
  font-size: 0.9rem;
  text-align: justify;
}

/* Columns */
.footer__col{
  flex: 1 1 160px;
}

.footer__col2{
  text-align: center;
  padding: var(--space-4);
  max-width: 600px;
}

.footer__col-title{
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.footer__col-text{
  font-size: 0.9rem;
  font-weight: 400;
  margin-bottom: var(--space-3);
  text-align: right;
}

.footer__links{
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__link{
  font-size: 0.9rem;
  color: var(--color-muted);
}

.footer__link:hover{
  color: var(--color-text);
}
.footer__contacto-redes{
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
}
.footer__contacto-review{
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
}
.footer__contacto{
    background: transparent;
    border: var(--color-text) solid .5px;
    padding: var(--space-2) var(--space-3);
    border-radius: 999px;
    font-size: 0.85rem;
}

/* Bottom bar */
.footer__bottom{
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-6);
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
}

/* Galeria */
.gallery{
  --per-view: 3;          /* cambia esto a 2, 4, etc */
  --gap: var(--space-3, 12px);
  --radius: var(--radius-xl, 16px);
}

.gallery__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 12px);
}

.gallery__controls{
  display: flex;
  gap: var(--space-2, 8px);
}

.gbtn{
  inline-size: 40px;
  block-size: 40px;
  border-radius: 999px;
  border: 1px solid var(--color-border, rgba(0,0,0,.12));
  background: var(--color-surface, #fff);
  cursor: pointer;
}

.gallery__viewport{
  overflow: hidden;
  outline: none;
  touch-action: pan-y; /* permite scroll vertical, JS maneja horizontal */
}

.gallery__track{
  display: flex;
  gap: var(--gap);
  padding: var(--gap);
  transform: translate3d(0,0,0);
  will-change: transform;
  user-select: none;
  cursor: grab;
  transition: transform 20ms ease;
}
.gallery__track.no-transition{
  transition: none !important;
}
.gallery__track.is-dragging{
  cursor: grabbing;
}

.gallery__item{
  flex: 0 0 calc((100% - (var(--gap) * (var(--per-view) - 1))) / var(--per-view));
  border-radius: calc(var(--radius) - 6px);
  overflow: hidden;
  background: var(--color-surface, #fff);
}

.gallery__item img{
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

/* Dots */
.gallery__dots{
  display: flex;
  justify-content: center;
  gap: 8px;
}

.gallery__dots button{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(0,0,0,.25);
  cursor: pointer;
}

.gallery__dots button[aria-current="true"]{
  background: rgba(0,0,0,.75);
}


/* =========================================================
   1) Overlay + Layer Stack
   ========================================================= */
.ui-overlay{
  position: fixed;
  inset: 0;
  z-index: 1000;

  background: var(--ui-bg);

  display: grid;
  place-items: center;

  padding: 18px;
  /* Importante: overlay siempre “intercepta” clics,
     el JS detecta si fue fuera del contenido */
}

.ui-overlay[hidden]{ display: none; }

.ui-layer{
  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  /* animación del backdrop */
  opacity: 0;
  transition: opacity var(--t) var(--e);
}

/* cuando abre: se ve el backdrop */
.ui-layer[data-state="open"]{ opacity: 1; }
.ui-layer[data-state="closed"]{ opacity: 0; }

/* Los hijos montados sí reciben pointer events */
.ui-layer > *{ pointer-events: auto; }

/* =========================================================
   2) Card / Primitive compartido
   ========================================================= */
.ui-card{
  width: min(520px, 92vw);
  background: var(--ui-surface);
  color: var(--ui-text);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  padding: var(--ui-pad);
}

.ui-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;

  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--ui-border);
}

.ui-title{
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
}

.ui-x{
  width: 34px;
  height: 34px;

  display:grid;
  place-items:center;

  border-radius: 10px;
  border: 1px solid var(--ui-border);
  background: rgba(255,255,255,.04);
  color: var(--ui-text);

  cursor: pointer;
}
.ui-x:hover{ background: rgba(255,255,255,.08); }

.ui-text{ margin: 0 0 12px; color: var(--ui-muted); }

.ui-label{
  display:flex;
  flex-direction:column;
  gap: 6px;
  color: var(--ui-muted);
  font-size: 13px;
}

.ui-input{
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--ui-border);
  background: rgba(255,255,255,.04);
  color: var(--ui-text);
  outline: none;
}
.ui-input:focus{
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 0 0 4px rgba(255,255,255,.10);
}

.ui-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Botones minimal (si ya tienes .btn, puedes quitar esto) */
.ui-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;

  padding: 10px 14px;
  border-radius: 10px;

  border: 1px solid var(--ui-border);
  background: rgba(255,255,255,.06);
  color: var(--ui-text);
  cursor: pointer;
  user-select: none;
}
.ui-btn:hover{ background: rgba(255,255,255,.10); }
.ui-btn--ghost{ background: transparent; }

/* =========================================================
   3) Popup animation (usar wrapper .ui-anim)
   ========================================================= */
.ui-anim{
  transform: translateY(10px) scale(.98);
  opacity: 0;
  transition: transform var(--t) var(--e), opacity var(--t) var(--e);
}

.ui-layer[data-state="open"] .ui-anim{
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* =========================================================
   4) Slides (paneles)
   ========================================================= */
.ui-slide{
  position: fixed;
  background: var(--ui-surface);
  color: var(--ui-text);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow);

  display:flex;
  flex-direction:column;

  transition: transform var(--t) var(--e);
  will-change: transform;
}

/* Área scrolleable del slide */
.ui-body{
  padding: var(--ui-pad);
  overflow: auto;
  min-height: 0;
}

/* RIGHT */
.ui-slide--right{
  top: 0;
  right: 0;
  width: var(--slide-w);
  height: 100%;
  border-radius: 0;
  transform: translateX(102%);
}
.ui-layer[data-state="open"] .ui-slide--right{ transform: translateX(0); }

/* LEFT */
.ui-slide--left{
  top: 0;
  left: 0;
  width: var(--slide-w);
  height: 100%;
  border-radius: 0 16px 16px 0;
  transform: translateX(-102%);
}
.ui-layer[data-state="open"] .ui-slide--left{ transform: translateX(0); }

/* TOP */
.ui-slide--top{
  top: 0;
  left: 0;
  width: 100%;
  height: var(--slide-h);
  border-radius: 0 0 16px 16px;
  transform: translateY(-102%);
}
.ui-layer[data-state="open"] .ui-slide--top{ transform: translateY(0); }

/* BOTTOM */
.ui-slide--bottom{
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--slide-h);
  border-radius: 16px 16px 0 0;
  transform: translateY(102%);
}
.ui-layer[data-state="open"] .ui-slide--bottom{ transform: translateY(0); }

/* =========================================================
   5) Utilities / a11y
   ========================================================= */
.no-scroll{
  overflow: hidden !important;
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce){
  .ui-layer,
  .ui-anim,
  .ui-slide{
    transition: none !important;
  }
}

/* =========================================================
   FEATURE SECTION
   Sección de contenido con fondo imagen
   Parallax opcional vía clase
   ========================================================= */

.feature-section{
  position: relative;
  min-height: clamp(360px, 55vh, 640px);
  display: grid;
  align-items: center;
  color: var(--section-fg, #fff);

  background:
    linear-gradient(to bottom, rgba(0,0,0,.45), rgba(0,0,0,.55)),
    var(--section-bg, url("/img/section.jpg")) center / cover no-repeat;

  /* default: sin parallax */
  background-attachment: scroll;
}

/* Contenido */
.feature-section__inner{
  max-width: 1200px;
  margin-inline: auto;
  padding: var(--space-6) var(--space-4);
  display: grid;
  gap: var(--space-4);
}

.feature-section__title{
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  font-weight: 800;
  max-width: 22ch;
  color: var(--color-bg);
}

.feature-section__desc{
  font-size: 1.05rem;
  color: rgba(255,255,255,.9);
  max-width: 52ch;
}

.feature-section__actions{
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Variantes */
.feature-section--center .feature-section__inner{
  text-align: center;
  justify-items: center;
}

.feature-section--compact{
  min-height: 420px;
}

/* Toggle parallax */
.feature-section.is-parallax{
  background-attachment: fixed;
}

/* Mobile + reduce motion */
@media (max-width: 900px){
  .feature-section.is-parallax{
    background-attachment: scroll;
  }
}

@media (prefers-reduced-motion: reduce){
  .feature-section.is-parallax{
    background-attachment: scroll;
  }
}


/* mapa */
.gmap{
  width: 100%;
  height: clamp(320px, 50vh, 520px);
  border-radius: var(--radius-xl, 16px);
  overflow: hidden;
  border: 1px solid var(--color-border, rgba(0,0,0,.12));
  background: var(--color-surface, #fff);
}

/* components.css
   Acordeón (desplegables) + Tabs (pestañas)
   Depende de variables.css (colores, radios, sombras, espacios)
*/

/* =========================
   ACCORDION
   ========================= */
.accordion{
  display: grid;
  gap: var(--space-3);
}

.acc{
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: clip;
  box-shadow: var(--shadow-1);
}

.acc__btn{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  text-align: left;
  cursor: pointer;
  user-select: none;
  border: none;
}

.acc__title{
  font-weight: 700;
  margin: 0;
}

.acc__icon{
  inline-size: 28px;
  block-size: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: color-mix(in oklab, var(--color-surface) 80%, var(--color-text) 2%);
  transition: transform 180ms ease;
}

.acc[data-state="open"] .acc__icon{
  transform: rotate(180deg);
}

.acc__panel{
  padding: var(--space-4);
}

.acc__content{
  padding: 0 0;
  color: var(--color-muted);
}

/* Animación con grid row (sin medir alturas) */
.acc__panel{
  grid-template-rows: 0fr;
  transition: grid-template-rows 220ms ease;
}
.acc__panel > .acc__content{
  overflow: hidden;
}
.acc[data-state="open"] .acc__panel{
  grid-template-rows: 1fr;
}

/* =========================
   TABS
   ========================= */
.tabs{
  display: grid;
  gap: var(--space-3);
}

.tabs__list{
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: var(--shadow-1);
}

.tabs__tab{
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--color-muted);
  line-height: 1;
}

.tabs__tab[aria-selected="true"]{
  color: var(--color-text);
  background: color-mix(in oklab, var(--color-surface) 70%, var(--color-text) 4%);
  border-color: var(--color-border);
}

.tabs__panel{
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-1);
}

@media (prefers-reduced-motion: reduce){
  .acc__panel,
  .acc__icon{
    transition: none !important;
  }
}

/* =========================
   Code blocks (no rompen layout)
   ========================= */
pre{
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

pre code{
  display: inline-block; /* evita que el bloque empuje el viewport */
  min-width: 100%;
  white-space: pre;      /* respeta saltos/indentación */
  max-width: 80vw;
}

/* 2) Inline code (dentro de párrafos/listas/tablas): SÍ puede partir */
p code,
li code,
td code,
th code{
  white-space: normal;        /* permite wrap */
  overflow-wrap: anywhere;    /* corta strings largos */
  word-break: break-word;     /* fallback */
}

/* 3) Seguridad extra para Markdown: cualquier cosa larga puede partir */
.prose{
  overflow-wrap: anywhere;
}
/* =========================
   Tables (responsive)
   ========================= */

/* wrapper recomendado */
.table-wrap{
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* dentro del wrapper */
.table-wrap > table{
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;          /* ajusta: 0 si no quiere min width */
}

/* seguridad extra (por si hay tablas sin wrapper) */
.prose table,
.content table{
  max-width: 100%;
}

/* Evita que celdas con strings largos empujen */
td, th{
  overflow-wrap: anywhere;
  word-break: normal;
}

/* =========================================================
   TOP MESSAGE BANNER
   - Sticky arriba
   - Se oculta en scroll o click
   ========================================================= */

#messages{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  padding: 10px 12px;
  display: grid;
  gap: 10px;

  /* Para que no “coma” clics fuera del banner */
  pointer-events: none;
}

#messages .toast{
  pointer-events: auto;

  max-width: 1200px;
  margin-inline: auto;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--color-border, rgba(0,0,0,.12));
  background: var(--color-surface, #fff);
  box-shadow: var(--shadow-1, 0 10px 24px rgba(0,0,0,.12));

  color: var(--color-text, #111);
  font-size: 0.95rem;
  line-height: 1.35;

  transform: translateY(-10px);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

/* icon */
#messages .toast .icon{
  flex: 0 0 auto;
  font-size: 18px;
  opacity: .9;
}

/* visible */
#messages.is-visible .toast{
  transform: translateY(0);
  opacity: 1;
}

/* hide */
#messages.is-hidden .toast{
  transform: translateY(-10px);
  opacity: 0;
}

/* Variantes por tipo (suaves) */
#messages .toast-success{
  border-color: color-mix(in oklab, #16a34a 35%, var(--color-border, rgba(0,0,0,.12)));
  background: color-mix(in oklab, #16a34a 10%, var(--color-surface, #fff));
}

#messages .toast-warning{
  border-color: color-mix(in oklab, #f59e0b 40%, var(--color-border, rgba(0,0,0,.12)));
  background: color-mix(in oklab, #f59e0b 12%, var(--color-surface, #fff));
}

#messages .toast-error{
  border-color: color-mix(in oklab, #ef4444 40%, var(--color-border, rgba(0,0,0,.12)));
  background: color-mix(in oklab, #ef4444 10%, var(--color-surface, #fff));
}

/* =========================================================
   Nav Mobile Panel (slide derecho)
   ========================================================= */

   /* =========================================================
   Nav — hamburguesa (solo mobile)
   ========================================================= */

.nav__burger {
  display: none; /* oculto en desktop */
}

.nav-mobile-panel {
  width: min(500px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--app-bg);
  overflow-y: auto;
}

.nav-mobile-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.nav-mobile-panel__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.nav-mobile-panel__link {
  padding: var(--space-3) var(--space-2);
  border-radius: 0;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--color-border);
}

.nav-mobile-panel__link:hover,
.nav-mobile-panel__link.active {
  background: var(--color-surface);
}

.nav-mobile-panel__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  #messages .toast{
    transition: none !important;
  }
}