/* ===========================
   HEADER PRINCIPAL
   =========================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  backdrop-filter: blur(12px);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(to right,
    rgba(0, 0, 0, 0),
    rgba(15, 23, 42, 0.07),
    rgba(0, 0, 0, 0)
  );
}

/* GRID 3 columnas: logo | menú centrado | iconos derecha */
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 24px;
  padding: 12px 0 16px;
}

/* Logo + marca */
.header-brand-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo img {
  display: block;
  height: 40px;
  width: auto;
}

.header-brand {
  font-size: 1rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

/* Navegación principal – centrada en su columna */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
}

.main-nav a {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #111827;
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
}

.main-nav a:hover {
  color: var(--color-primary);
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-primary);
  transition: width 0.25s ease-out;
}

.main-nav a:hover::after {
  width: 100%;
}

/* Acciones – iconos derecha */
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Botones icono (Instagram / WhatsApp) */
.header-icon-btn {
  --shine-color: rgba(255, 255, 255, 0.28);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;
  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(circle at 30% 30%,
    rgba(0, 0, 0, 0.94),
    rgba(0, 0, 0, 0.85)
  );
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.6);

  color: #ffffff;
  overflow: hidden;
  cursor: pointer;

  transition:
    transform 0.25s ease-out,
    box-shadow 0.25s ease-out,
    border-color 0.25s ease-out,
    background 0.25s ease-out;
}

.header-icon-btn svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

/* Brillo deslizante */
.header-icon-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 15%,
    var(--shine-color) 50%,
    rgba(255, 255, 255, 0) 85%
  );
  transform: translateX(-120%);
  transition: transform 0.7s ease-out;
  pointer-events: none;
}

.header-icon-btn:hover::before {
  transform: translateX(120%);
}

/* Hover / active */
.header-icon-btn:hover {
  transform: scale(1.08) rotate(2deg);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.75);
  border-color: rgba(255, 255, 255, 0.45);
}

.header-icon-btn:active {
  transform: scale(0.95) rotate(0deg);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.5);
}

/* Instagram: mismo fondo negro, brillo blanco */
.header-icon-btn--ig {
  --shine-color: rgba(255, 255, 255, 0.55);
  color: #ffffff;
}

/* WhatsApp: botón negro, glow verde, icono verde */
.header-icon-btn--wa {
  --shine-color: rgba(74, 222, 128, 0.45);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.7);
  box-shadow: 0 16px 36px rgba(34, 197, 94, 0.6);
}

.header-icon-btn--wa:hover {
  box-shadow: 0 20px 42px rgba(34, 197, 94, 0.75);
}

/* Botones del header que usen .btn */
.site-header .btn {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
}

/* ===========================
   HEADER – Responsive (corregido para grid)
   =========================== */
@media (max-width: 768px) {
  .header-inner {
    grid-template-columns: 1fr auto; /* marca | acciones */
    grid-template-rows: auto auto;   /* fila 1 + fila 2 */
    row-gap: 10px;
    align-items: center;
  }

  .header-brand-wrap {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }

  .header-actions {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    justify-content: flex-end;
  }

  .main-nav {
    grid-column: 1 / -1; /* ocupa todo el ancho */
    grid-row: 2 / 3;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 4px;
  }
}

/* ===========================
   FOOTER – estilo tipo Sote
   =========================== */

.site-footer {
  margin-top: 0px;
  padding: 32px 0 20px;
  background: #000000;
  color: #f9fafb;
}

/* Fila superior: marca + texto + CTA */
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.footer-top-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-top-brand img {
  height: 48px;
  width: auto;
  display: block;
}

.footer-top-brand h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.footer-top-brand p {
  font-size: 0.9rem;
  color: #9ca3af;
  max-width: 420px;
}

/* Grid principal de secciones */
.footer-main {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  padding: 24px 0 18px;
}

.footer-column h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #e5e7eb;
}

.footer-column p,
.footer-column a {
  font-size: 0.9rem;
  color: #9ca3af;
  display: block;
  margin-bottom: 6px;
}

.footer-column a:hover {
  color: #0d77be;
}

/* Fila inferior: derechos + botón volver arriba */
.footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* ===========================
   BOTÓN BACK TO TOP
   =========================== */

.back-to-top-btn {
  position: relative;
  display: inline-block;
  min-width: 170px;
  height: 56px;
  overflow: hidden;
  border: none;
  color: #f9fafb;
  background: none;
  padding-bottom: 2em;
  cursor: pointer;
  font-family: inherit;
}

/* Contenedores de texto: ocupan todo el ancho MENOS la zona de la flecha */
.back-to-top-btn > div {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Línea inferior animada */
.back-to-top-btn::before {
  content: "";
  position: absolute;
  height: 2px;
  bottom: 0;
  left: 0;
  width: 100%;
  transform: scaleX(0);
  transform-origin: bottom right;
  background: currentColor;
  transition: transform 0.25s ease-out;
}

.back-to-top-btn:hover::before {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.back-to-top-text > *,
.back-to-top-clone > * {
  opacity: 1;
  font-size: 1.05rem;
  transition: 0.2s;
  margin-left: 4px;
}

/* El clon arranca abajo (para la animación de subida) */
.back-to-top-clone > * {
  transform: translateY(60px);
}

.back-to-top-btn:hover .back-to-top-clone > * {
  opacity: 1;
  transform: translateY(0px);
  transition: all 0.2s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
}

.back-to-top-btn:hover .back-to-top-text > * {
  opacity: 1;
  transform: translateY(-60px);
  transition: all 0.2s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
}

.back-to-top-btn:hover .back-to-top-clone > :nth-child(1) { transition-delay: 0.15s; }
.back-to-top-btn:hover .back-to-top-clone > :nth-child(2) { transition-delay: 0.20s; }
.back-to-top-btn:hover .back-to-top-clone > :nth-child(3) { transition-delay: 0.25s; }
.back-to-top-btn:hover .back-to-top-clone > :nth-child(4) { transition-delay: 0.30s; }

/* Icono flecha a la derecha */
.back-to-top-icon {
  position: absolute;
  right: 0;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%) rotate(-50deg);
  transition: 0.2s ease-out;
}

.back-to-top-btn:hover .back-to-top-icon {
  transform: translateY(-50%) rotate(-90deg);
}

/* ===========================
   FOOTER – Responsive
   =========================== */
@media (max-width: 900px) {
  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .footer-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-top-brand p {
    max-width: 100%;
  }

  .footer-bottom {
    gap: 10px;
  }
}

/* =========================================================
   HEADER / NAV (v2) — ALINEADO A includes/header.php
   Pegalo al FINAL de layout.css
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: #fff;
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  position: relative; /* para desplegar el menú abajo */
}

.site-header .site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.site-header .site-logo {
  height: 40px;
  width: auto;
  display: block;
}

.site-header .main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.site-header .main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: #111827;
  text-decoration: none;
  position: relative;
  padding: 6px 2px;
}

.site-header .main-nav a:hover {
  color: var(--color-primary);
}

.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header .nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.site-header .nav-toggle:focus-visible {
  outline: 3px solid rgba(13, 119, 190, 0.35);
  outline-offset: 3px;
}

.site-header .nav-toggle-bars {
  position: relative;
  width: 22px;
  height: 2px;
  background: #111827;
  border-radius: 999px;
  display: block;
}

.site-header .nav-toggle-bars::before,
.site-header .nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: #111827;
  border-radius: 999px;
  transition: transform 0.18s ease, top 0.18s ease, opacity 0.18s ease;
}

.site-header .nav-toggle-bars::before { top: -7px; }
.site-header .nav-toggle-bars::after  { top:  7px; }

/* Estado abierto (la clase la pone tu JS: .site-header.is-open) */
.site-header.is-open .nav-toggle-bars {
  background: transparent;
}

.site-header.is-open .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.site-header.is-open .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

/* =========================
   Mobile
   ========================= */
@media (max-width: 900px) {
  .site-header .nav-toggle {
    display: inline-flex;
  }

  .site-header .main-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    padding: 10px;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
  }

  .site-header.is-open .main-nav {
    display: flex;
  }

  .site-header .main-nav a {
    padding: 12px 12px;
    border-radius: 12px;
  }

  .site-header .main-nav a:hover {
    background: rgba(13, 119, 190, 0.08);
  }
}

/* =========================================================
   NAV MOBILE UX: bloquear scroll + backdrop
   (va en layout.css porque es comportamiento de header)
   ========================================================= */

/* 1) Bloquear scroll del body cuando el menú está abierto */
body.nav-open{
  overflow: hidden;
  touch-action: none;
}

/* 2) Backdrop real (div) detrás del menú */
.nav-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 40;
}

/* Mostrar backdrop cuando el header está abierto */
.site-header.is-open + .nav-backdrop{
  opacity: 1;
  pointer-events: auto;
}

/* Aseguramos que header y panel estén por encima del backdrop */
@media (max-width: 900px){
  .site-header{ z-index: 60; }
  .site-header .main-nav{ z-index: 70; }
}

/* Evitar overflow horizontal (iOS / 100vw / sliders) */
html, body{
  max-width: 100%;
  overflow-x: hidden;
}

/* CardNav header: el nav real es fixed adentro, el header no debe ocupar layout */
.cardnav-header{
  background: transparent;
  backdrop-filter: none;
}

.footer-legal{
  display:flex; gap:10px; align-items:center; justify-content:center;
  flex-wrap:wrap; margin-top:10px; font-size:14px; opacity:.9;
}
.footer-legal a{ text-decoration:none; }
.footer-legal a:hover{ text-decoration:underline; }
.footer-legal .sep{ opacity:.55; }
