/* ============================================
   Layout: Header, Footer, Nav, WhatsApp flotante
   ============================================ */

/* ---- HEADER / NAV ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: 14px 0;
  background: rgba(250, 245, 236, 0);
  transition: padding var(--transition), background var(--transition), box-shadow var(--transition);
}
.site-header.scrolled {
  padding: 10px 0;
  background: rgba(250, 245, 236, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(10, 8, 7, 0.06);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.nav-logo img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--ink);
  padding: 4px;
  object-fit: contain;
  transition: transform var(--transition), background var(--transition), padding var(--transition), width var(--transition), height var(--transition);
}
.nav-logo:hover img { transform: scale(1.05); }
/* Sobre fondo oscuro: mix-blend-mode:screen hace que el negro del JPEG desaparezca
   y el diseño blanco del logo quede visible. Compatible con todos los móviles. */
.site-header.theme-dark:not(.scrolled) .nav-logo img {
  background: transparent;
  padding: 0;
  width: 60px;
  height: 60px;
  mix-blend-mode: screen;
}
.nav-logo .nav-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}
.nav-logo .nav-brand .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.nav-logo .nav-brand .tag {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--ink-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0;
  background: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-links a {
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
  padding: 6px 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brown);
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: left;
}
.nav-links a:hover { color: var(--brown); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--brown); font-weight: 600; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 1.05rem;
  transition: all var(--transition);
  position: relative;
}
.nav-icon-btn:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.nav-icon-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background: var(--brown);
  color: var(--bg);
  border-radius: var(--radius-pill);
  font-size: 0.66rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 2px solid var(--bg);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
}
.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-logo .nav-brand .tag { display: none; }
}

/* ============================================
   HEADER · Modo OSCURO (texto claro sobre hero oscuro)
   Se activa con $header_mode = 'dark' en PHP
   y desaparece al hacer scroll (vuelve al modo claro)
   ============================================ */
.site-header.theme-dark .nav-logo .name { color: var(--bg); }
.site-header.theme-dark .nav-logo .tag  { color: rgba(250, 245, 236, 0.65); }

.site-header.theme-dark .nav-links a { color: rgba(250, 245, 236, 0.82); }
.site-header.theme-dark .nav-links a:hover,
.site-header.theme-dark .nav-links a.active { color: var(--gold); }
.site-header.theme-dark .nav-links a::after { background: var(--gold); }

.site-header.theme-dark .nav-icon-btn {
  background: rgba(250, 245, 236, 0.10);
  border-color: rgba(250, 245, 236, 0.20);
  color: var(--bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.site-header.theme-dark .nav-icon-btn:hover {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--bg);
}
.site-header.theme-dark .nav-icon-btn .badge {
  border-color: transparent;
}

.site-header.theme-dark .nav-toggle {
  background: rgba(250, 245, 236, 0.10);
  border-color: rgba(250, 245, 236, 0.20);
}
.site-header.theme-dark .nav-toggle span { background: var(--bg); }

/* Al hacer scroll, theme-dark vuelve a usar fondo crema + texto oscuro */
.site-header.theme-dark.scrolled .nav-logo .name { color: var(--ink); }
.site-header.theme-dark.scrolled .nav-logo .tag  { color: var(--ink-muted); }
.site-header.theme-dark.scrolled .nav-links a    { color: var(--ink-soft); }
.site-header.theme-dark.scrolled .nav-links a:hover,
.site-header.theme-dark.scrolled .nav-links a.active { color: var(--brown); }
.site-header.theme-dark.scrolled .nav-links a::after { background: var(--brown); }
.site-header.theme-dark.scrolled .nav-icon-btn {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.site-header.theme-dark.scrolled .nav-icon-btn:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.site-header.theme-dark.scrolled .nav-toggle {
  background: var(--paper);
  border-color: var(--line);
}
.site-header.theme-dark.scrolled .nav-toggle span { background: var(--ink); }

/* ---- FOOTER ---- */
.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: 80px 0 28px;
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-gold);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand img {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  background: transparent;
}
.footer-brand h3 {
  color: var(--bg);
  font-family: var(--font-display);
  font-style: italic;
  margin-bottom: 8px;
}
.footer-brand p {
  color: rgba(250, 245, 236, 0.65);
  font-size: 0.9rem;
  max-width: 280px;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col li a {
  font-size: 0.92rem;
  color: rgba(250, 245, 236, 0.7);
  transition: color var(--transition);
}
.footer-col li a:hover { color: var(--gold); }
.footer-col .contact-line {
  font-size: 0.9rem;
  color: rgba(250, 245, 236, 0.78);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  line-height: 1.4;
}
.footer-col .contact-line .ic {
  width: 18px;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid rgba(250, 245, 236, 0.10);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
  color: rgba(250, 245, 236, 0.5);
}
.footer-bottom .footer-legal {
  display: flex;
  gap: 22px;
}
.footer-bottom .footer-legal a {
  color: rgba(250, 245, 236, 0.5);
  transition: color var(--transition);
}
.footer-bottom .footer-legal a:hover { color: var(--gold); }

/* ---- WHATSAPP FLOTANTE ---- */
.wa-float {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: var(--z-float);
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.wa-float .wa-pulse {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #25D366;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 26px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0.7);
  color: #fff;
  transition: transform var(--transition);
  position: relative;
  animation: wa-pulse 2.4s infinite;
}
.wa-float:hover .wa-pulse {
  transform: scale(1.08);
  animation: none;
}
.wa-float svg {
  width: 32px;
  height: 32px;
}
@keyframes wa-pulse {
  0% { box-shadow: 0 8px 26px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0.55); }
  70% { box-shadow: 0 8px 26px rgba(37, 211, 102, 0.45), 0 0 0 20px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 8px 26px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0); }
}

.wa-float .wa-bubble {
  background: var(--ink);
  color: var(--bg);
  border-radius: 14px 14px 0 14px;
  padding: 12px 16px;
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  position: relative;
  max-width: 220px;
  line-height: 1.35;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.wa-float.bubble-on .wa-bubble {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.wa-float .wa-bubble::after {
  content: '';
  position: absolute;
  right: -8px;
  bottom: 12px;
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid var(--ink);
}
.wa-float .wa-bubble strong {
  display: block;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

@media (max-width: 560px) {
  .wa-float { bottom: 18px; right: 18px; }
  .wa-float .wa-pulse { width: 56px; height: 56px; }
  .wa-float .wa-bubble { display: none; }
}
