/* ═══════════════════════════════════════════════════════════════════
   Gestoría Canina — Header / Footer / Mobile Nav unificado
   Cargado en TODAS las páginas (excepto login/admin/mi-area).
   El HTML se inyecta dinámicamente desde js/auth.js.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── ANTI-OVERFLOW HORIZONTAL (global) ─── */
html, body { max-width: 100vw; overflow-x: hidden; }
.gc-container { box-sizing: border-box; max-width: 100% !important; }

/* ─── GUARD: ocultar headers/footers/menús viejos hardcodeados.
   Si auth.js no los borró a tiempo, este CSS los esconde igualmente.
   Solo afecta a los SIN data-unified (el unificado lo lleva siempre). */
header.header:not([data-unified]),
.mobile-nav-overlay:not([data-unified]),
footer.footer:not([data-unified]) { display: none !important; }
.gc-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ─── HEADER ───
   Default: navy con texto blanco
   Scrolled: blanco con texto oscuro (en TODAS las páginas)
   Home: transparente arriba (excepción) → al scrollear blanco igual que el resto
*/
.gc-header,
.header.gc-header,
header.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 14px 0; transition: all 0.3s ease;
  background: rgba(28,36,60,0.96) !important;
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}
/* 11.1: en móvil, header opaco completo (algunos browsers móviles no aplican backdrop-filter y se veía claro/translúcido) */
@media (max-width: 960px) {
  .gc-header:not(.scrolled):not(.gc-header--light),
  .header.gc-header:not(.scrolled),
  header.header:not(.scrolled) {
    background: #1C243C !important;
    backdrop-filter: none !important;
  }
}
/* Estado scrolled = blanco con texto oscuro (global) */
.gc-header.scrolled,
.gc-header--light,
.header.scrolled {
  background: rgba(255,255,255,0.97) !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: 0 2px 20px rgba(28,36,60,0.1) !important;
  padding: 11px 0;
}
/* Excepción home: arriba transparente */
body.page-home .gc-header,
body.page-home .header.gc-header,
body.page-home header.header {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
/* ─── BREADCRUMB unificado: transparente, hereda el fondo del hero ─── */
.breadcrumb {
  background: transparent !important;
  border-bottom: none !important;
  color: rgba(255,255,255,0.6) !important;
  padding: 80px 0 14px !important;
  font-size: 13px !important;
}
.breadcrumb a {
  color: rgba(255,255,255,0.78) !important;
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover { color: #b09a6e !important; }
.breadcrumb strong, .breadcrumb b { color: #b09a6e !important; font-weight: 600; }

/* En home scrolled, recuperamos el blanco como el resto (asegurarlo) */
body.page-home .gc-header.scrolled,
body.page-home .header.scrolled {
  background: rgba(255,255,255,0.97) !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: 0 2px 20px rgba(28,36,60,0.1) !important;
}
.gc-container {
  width: 100%; max-width: 1200px;
  margin: 0 auto; padding: 0 24px;
}
.gc-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-width: 0;
}
.gc-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.gc-logo img {
  height: 84px; width: auto;
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}
@media (max-width: 640px) {
  .gc-logo img { height: 66px; }
}
.gc-header.scrolled .gc-logo img,
.gc-header--light .gc-logo img,
.header.scrolled .logo img { filter: none !important; }

.gc-nav { display: flex; align-items: center; gap: 2px; }
.gc-nav a {
  padding: 7px 12px; border-radius: 7px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.83rem; font-weight: 500;
  color: rgba(255,255,255,0.78);
  transition: all 0.25s ease;
  white-space: nowrap; text-decoration: none;
}
.gc-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.gc-nav a.active { color: #b09a6e; font-weight: 600; }
.gc-header.scrolled .gc-nav a,
.gc-header--light .gc-nav a,
.header.scrolled .header-nav a { color: #6b6b6b !important; }
.gc-header.scrolled .gc-nav a:hover,
.gc-header--light .gc-nav a:hover,
.header.scrolled .header-nav a:hover { color: #1C243C !important; background: #E6E2DD !important; }
.gc-header.scrolled .gc-nav a.active,
.gc-header--light .gc-nav a.active,
.header.scrolled .header-nav a.active { color: #781E2A !important; }

.gc-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.btn-nav {
  padding: 8px 18px; border-radius: 7px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.83rem; font-weight: 600;
  cursor: pointer; border: none;
  background: #781E2A; color: #fff;
  transition: all 0.25s ease;
  display: inline-flex; align-items: center; text-decoration: none;
  white-space: nowrap;
}
.btn-nav:hover { background: #9a2636; transform: translateY(-1px); }

.gc-hamburger {
  display: none; flex-direction: column; gap: 5px;
  padding: 8px; cursor: pointer; background: none; border: none;
  flex-shrink: 0;
}
.gc-hamburger span {
  display: block; width: 22px; height: 2px;
  background: #fff; border-radius: 2px;
  transition: all 0.25s ease;
}
.gc-header.scrolled .gc-hamburger span,
.gc-header--light .gc-hamburger span,
.header.scrolled .hamburger span { background: #1C243C !important; }
.gc-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.gc-hamburger.open span:nth-child(2) { opacity: 0; }
.gc-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 960px) {
  .gc-nav { display: none; }
  .gc-hamburger { display: flex; }
  .btn-nav:not(.gc-keep-mobile) { display: none; }
}

/* ─── MOBILE NAV OVERLAY ─── */
.gc-mobile-nav {
  display: none;
  position: fixed; inset: 0; z-index: 998;
  background: #1C243C;
  flex-direction: column; align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: calc(120px + env(safe-area-inset-top, 0px)) 20px 180px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.gc-mobile-nav.open { display: flex; }
.gc-mobile-nav a {
  font-family: 'Unna', Georgia, serif;
  font-size: 1.65rem;
  font-weight: 500;
  color: #fff;
  padding: 18px 28px;
  min-height: 58px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  transition: all 0.25s ease;
  text-align: center;
  width: 100%; max-width: 320px;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
}
.gc-mobile-nav a:hover,
.gc-mobile-nav a.active { color: #b09a6e; }
.gc-mobile-nav a:active { background: rgba(255,255,255,0.06); }

#mobile-auth-area {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 1001;
  background: linear-gradient(to top, rgba(28,36,60,1) 70%, rgba(28,36,60,0));
  pointer-events: none;
}
#mobile-auth-area > * { pointer-events: auto; }
#mobile-auth-area:empty { display: none; }
.gc-mobile-nav:not(.open) ~ #mobile-auth-area,
.gc-mobile-nav:not(.open) #mobile-auth-area { display: none; }
.mobile-auth-btn {
  display: inline-flex !important;
  align-items: center; justify-content: center;
  width: auto; min-width: 200px; max-width: 320px;
  padding: 14px 28px; border-radius: 9px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.05rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: none;
  transition: all 0.2s ease; margin: 0;
}
.mobile-auth-btn-primary { background: #781E2A; color: #fff !important; }
.mobile-auth-btn-primary:hover { background: #9a2636; }
.mobile-auth-btn-outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.85) !important;
}
.mobile-auth-btn-logout {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.78) !important;
  border: 1px solid rgba(255,255,255,0.15);
}
.mobile-auth-btn-logout:hover { background: rgba(255,255,255,0.14); color: #fff !important; }

/* ─── AUTH HEADER BUTTONS (estados) ─── */
.btn-nav-outline {
  background: transparent !important;
  border: 1.5px solid rgba(255,255,255,0.55) !important;
  color: rgba(255,255,255,0.9) !important;
}
.gc-header.scrolled .btn-nav-outline {
  border-color: rgba(28,36,60,0.35) !important;
  color: #1C243C !important;
}
.btn-nav-outline:hover {
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.9) !important;
  color: #fff !important;
}
.gc-header.scrolled .btn-nav-outline:hover {
  background: rgba(28,36,60,0.06) !important;
  color: #1C243C !important;
}

/* ─── AUTH USER MENU (logged in) ─── */
.auth-menu { position: relative; }
.btn-nav-user {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 7px;
  font-family: 'Inter', system-ui, sans-serif; font-size: 0.83rem; font-weight: 600;
  cursor: pointer; border: none;
  background: rgba(255,255,255,0.13); color: rgba(255,255,255,0.92);
  transition: all 0.25s ease;
}
.gc-header.scrolled .btn-nav-user {
  background: rgba(28,36,60,0.07); color: #1C243C;
}
.btn-nav-user:hover { background: rgba(255,255,255,0.22); }
.gc-header.scrolled .btn-nav-user:hover { background: rgba(28,36,60,0.12); }

.auth-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.auth-initial {
  width: 22px; height: 22px; border-radius: 50%;
  background: #781E2A; color: #fff;
  font-size: 0.72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.auth-drop {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border-radius: 10px; min-width: 170px;
  box-shadow: 0 8px 32px rgba(28,36,60,0.16); border: 1px solid rgba(28,36,60,0.08);
  z-index: 999; overflow: hidden; padding: 6px 0;
}
.auth-drop.open { display: block; }
.auth-drop-item {
  display: block; width: 100%; padding: 9px 18px;
  font-family: 'Inter', system-ui, sans-serif; font-size: 0.85rem; font-weight: 500;
  color: #2d2d2d; text-decoration: none; text-align: left;
  background: none; border: none; cursor: pointer; transition: background 0.15s;
}
.auth-drop-item:hover { background: #f5f3f0; }
.auth-drop-logout {
  color: #781E2A !important;
  border-top: 1px solid rgba(28,36,60,0.07) !important;
  margin-top: 4px !important;
}

/* ═══ FOOTER UNIFICADO ═══ */
.gc-footer {
  background: #111827; color: rgba(255,255,255,0.6);
  padding: 70px 0 28px;
  font-family: 'Inter', system-ui, sans-serif;
}
.gc-footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 48px; min-width: 0;
}
.gc-footer-logo {
  height: 84px; width: auto; margin-bottom: 22px;
  filter: brightness(0) invert(1) opacity(0.85);
}
.gc-footer-tagline {
  font-size: 0.88rem; line-height: 1.7;
  max-width: 280px; margin-bottom: 24px;
}
.gc-footer-socials { display: flex; gap: 10px; }
.gc-footer-social {
  width: 44px; height: 44px; border-radius: 9px;
  border: 1.5px solid rgba(255,255,255,0.18);
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.78);
  transition: all 0.25s ease;
  text-decoration: none;
}
.gc-footer-social svg {
  display: block;
  width: 22px; height: 22px;
}
.gc-footer-social:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
.gc-footer-col-title {
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: #fff; margin-bottom: 18px;
}
.gc-footer-links {
  display: flex; flex-direction: column; gap: 9px;
  list-style: none; padding: 0;
}
.gc-footer-links a {
  font-size: 0.87rem;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s ease;
  text-decoration: none;
}
.gc-footer-links a:hover { color: #fff; }
.gc-footer-contact-row {
  display: flex; gap: 10px; align-items: center;
  font-size: 0.83rem; color: rgba(255,255,255,0.6); margin-bottom: 9px;
}

.gc-footer-legal-bar {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 8px 22px; padding: 0 0 22px; font-size: 0.82rem;
}
.gc-footer-legal-bar a {
  color: rgba(255,255,255,0.55); text-decoration: none;
  transition: color 0.2s ease;
}
.gc-footer-legal-bar a:hover { color: #fff; }
.gc-footer-divider {
  border: none; border-top: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 24px;
}
.gc-footer-bottom {
  text-align: center; font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}

@media (max-width: 1024px) {
  .gc-footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  .gc-footer { padding: 70px 0 36px; }
  .gc-footer-grid { grid-template-columns: 1fr; gap: 44px; margin-bottom: 44px; }
  .gc-footer-logo { height: 96px; margin-bottom: 22px; }
  .gc-footer-tagline { max-width: 100%; font-size: 1.08rem; line-height: 1.7; }
  .gc-footer-col-title { font-size: 1rem; margin-bottom: 16px; letter-spacing: 1.6px; }
  .gc-footer-links a { font-size: 1.08rem; }
  .gc-footer-links { gap: 14px; }
  .gc-footer-contact-row { font-size: 1.04rem; margin-bottom: 13px; }
  .gc-footer-social { width: 52px; height: 52px; border-radius: 10px; }
  .gc-footer-social svg { width: 26px; height: 26px; }
  .gc-footer-legal-bar { font-size: 0.96rem; gap: 12px 22px; padding-bottom: 26px; }
  .gc-footer-bottom { font-size: 0.94rem; }
}

/* ═══ COMPATIBILIDAD: estilos legacy de páginas que aún usan .header/.footer/.mobile-nav-overlay ═══
   Cuando una página inyecta el header unificado, mantenemos display estándar.
   Si quedan páginas viejas con clases sin gc-, las soportamos aquí. */
.header, .footer, .mobile-nav-overlay { /* dejar que las páginas viejas se manejen con su propio CSS inline */ }
