/* ==========================================================
   Header y footer de Librería Gandhi
   Se carga en TODO el sitio. Los tamaños van en px a propósito,
   para que se vean idénticos en todas las páginas.
   ========================================================== */

/* ---------- Colores compartidos (también los usa front-page.css) ---------- */
.gd-nav,
.gd-footer,
.gd-home {
  --primary: #004974;
  --primary-container: #006199;
  --primary-fixed: #cee5ff;
  --on-primary: #ffffff;
  --on-primary-fixed: #001d33;
  --secondary: #006a60;
  --secondary-container: #82f6e5;
  --on-secondary-container: #007166;
  --surface: #f8f9fe;
  --surface-low: #f2f3f9;
  --surface-high: #e6e8ed;
  --surface-lowest: #ffffff;
  --on-surface: #191c20;
  --on-surface-variant: #414750;
  --outline: #717881;
  --outline-variant: #c0c7d1;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 2rem;

  --font-headline: "Manrope", sans-serif;
  --font-body: "Public Sans", sans-serif;

  --shadow-editorial: 0 20px 40px -15px rgba(0, 73, 116, 0.12);
}

/* ---------- Resets suaves (prioridad mínima con :where) ---------- */
:where(.gd-nav, .gd-footer) *,
:where(.gd-nav, .gd-footer) *::before,
:where(.gd-nav, .gd-footer) *::after { box-sizing: border-box; }
:where(.gd-nav, .gd-footer) a { color: inherit; text-decoration: none; }
:where(.gd-nav, .gd-footer) img { display: block; max-width: 100%; }
:where(.gd-nav, .gd-footer) p { margin: 0; }

/* Íconos Material Symbols (24px fijos; el tamaño no depende de la página) */
body .gd-nav .material-symbols-outlined,
body .gd-footer .material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}
body .gd-footer .gd-icon--md { font-size: 18px; }

/* ---------- Header ---------- */
.gd-nav {
  position: sticky;           /* se queda arriba al bajar, sin tapar el contenido */
  top: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(248, 249, 254, 0.88);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(192, 199, 209, 0.3);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--on-surface);
}
/* Logueado en WordPress: baja para no quedar bajo la barra de admin */
.admin-bar .gd-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .gd-nav { top: 46px; } }
@media (max-width: 600px) { .admin-bar .gd-nav { top: 0; } }

.gd-nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px;
}
@media (min-width: 640px) { .gd-nav__inner { padding: 20px 32px; } }

.gd-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-family: var(--font-headline);
  font-size: 18px;
  line-height: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--primary);
}
.gd-brand__logo { height: 32px; width: auto; display: block; flex-shrink: 0; }
@media (min-width: 640px) {
  .gd-brand { font-size: 20px; line-height: 28px; }
  .gd-brand__logo { height: 40px; }
}

.gd-nav__actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.gd-nav .gd-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  margin: 0;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--primary);
  border-radius: 12px;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.gd-nav .gd-icon-btn:hover,
.gd-nav .gd-icon-btn:focus {
  background: rgba(0, 73, 116, 0.06);
  color: var(--primary);
}

/* Contador del carrito */
.gd-nav .gd-cart-count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ba1a1a;
  color: #fff;
  font: 700 11px/18px var(--font-body);
  text-align: center;
}
.gd-nav .gd-cart-count[hidden] { display: none; }

/* Menú: en celular/tablet es un panel que se despliega con el botón ☰ */
.gd-nav__links {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  padding: 4px 20px 12px;
  background: rgba(248, 249, 254, 0.98);
  border-bottom: 1px solid rgba(192, 199, 209, 0.3);
  box-shadow: 0 20px 30px -20px rgba(0, 73, 116, 0.25);
}
.gd-nav--open .gd-nav__links { display: flex; }
@media (min-width: 640px) { .gd-nav__links { padding-left: 32px; padding-right: 32px; } }

.gd-nav .gd-nav__link {
  padding: 14px 0;
  font-family: var(--font-headline);
  font-size: 16px;
  letter-spacing: 0.025em;
  color: var(--on-surface-variant);
  border-bottom: 1px solid rgba(192, 199, 209, 0.25);
  transition: color 0.15s ease;
}
.gd-nav .gd-nav__link:last-child { border-bottom: 0; }
.gd-nav .gd-nav__link:hover { color: var(--primary); }
.gd-nav .gd-nav__link--active { color: var(--primary); font-weight: 700; }

/* Escritorio: menú en línea y sin botón ☰ */
@media (min-width: 1024px) {
  .gd-nav__links {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .gd-nav .gd-nav__link { padding: 0; font-size: 14px; border-bottom: 0; }
  .gd-nav .gd-nav__link--active { border-bottom: 2px solid var(--secondary); padding-bottom: 4px; }
  .gd-nav .gd-nav__toggle { display: none; }
  .gd-nav__actions { gap: 8px; }
}

/* ---------- Footer ---------- */
.gd-footer {
  width: 100%;
  border-top: 1px solid rgba(192, 199, 209, 0.3);
  background: #ffffff;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--on-surface);
}
.gd-footer__top { max-width: 1280px; margin: 0 auto; padding: 32px 20px; }
@media (min-width: 640px) { .gd-footer__top { padding: 40px 32px; } }

.gd-footer__brand { display: flex; flex-direction: column; gap: 24px; }
.gd-footer .gd-brand--footer { font-size: 20px; line-height: 28px; }
.gd-footer .gd-brand--footer .material-symbols-outlined { color: var(--secondary); }
@media (min-width: 640px) { .gd-footer .gd-brand--footer { font-size: 24px; line-height: 32px; } }

.gd-footer__text {
  max-width: 384px;
  line-height: 1.625;
  color: var(--on-surface-variant);
}
.gd-social { display: flex; gap: 16px; }
.gd-social__item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--surface-high);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.gd-social__item:hover { background: var(--primary); color: #fff; }

/* ---------- Blindaje del header ----------
   Algunas páginas (carrito, checkout, listas) cargan CSS propio que agranda
   el logo o cambia el texto de la marca. Estas reglas fijan el tamaño correcto. */
body .gd-nav .gd-brand {
  font-family: var(--font-headline) !important;
  font-size: 18px !important;
  line-height: 24px !important;
  font-weight: 800 !important;
  color: var(--primary) !important;
  white-space: nowrap !important;
}
body .gd-nav .gd-brand__logo {
  height: 32px !important;
  width: auto !important;
  max-width: none !important;
}
@media (min-width: 640px) {
  body .gd-nav .gd-brand { font-size: 20px !important; line-height: 28px !important; }
  body .gd-nav .gd-brand__logo { height: 40px !important; }
}
