/* ================================================================
   DESPENSA VILO — HEADER Y NAVEGACIÓN GENERATEPRESS
   Se carga globalmente en todo el sitio.
   ================================================================ */

@font-face {
  font-family: "Myriad Pro";
  src: url("../fonts/MyriadPro-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --dvh-cream: #f3efdf;
  --dvh-cream-light: #faf8ef;
  --dvh-green: #173f35;
  --dvh-green-dark: #0d2d26;
  --dvh-yellow: #e3c755;
  --dvh-rust: #8b4638;
  --dvh-line-light: rgba(250, 248, 239, 0.22);
  --dvh-serif: Georgia, "Times New Roman", serif;
  --dvh-sans: Arial, Helvetica, sans-serif;
  --dvh-transition: 220ms ease;
}

/* ---------- Contenedor general ---------- */
#masthead.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  width: 100%;
  border-top: 4px solid var(--dvh-yellow);
  border-bottom: 1px solid var(--dvh-line-light);
  color: var(--dvh-cream-light);
  background: var(--dvh-green);
  box-shadow: 0 8px 26px rgba(13, 45, 38, 0.12);
}

.admin-bar #masthead.site-header { top: 32px; }

#masthead .inside-header {
  width: min(100%, 1320px);
  min-height: 92px;
  margin-inline: auto;
  padding: 14px clamp(20px, 4vw, 58px);
  gap: clamp(24px, 4vw, 64px);
}

/* ---------- Marca tipográfica ---------- */
#masthead .site-branding {
  flex: 0 0 auto;
  margin: 0;
}

#masthead .main-title {
  margin: 0;
  font-family: var(--dvh-serif);
  font-size: clamp(25px, 2.4vw, 38px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

#masthead .main-title a,
#masthead .main-title a:hover,
#masthead .main-title a:focus {
  display: flex;
  flex-direction: column;
  color: var(--dvh-cream-light);
  text-decoration: none;
}

#masthead .main-title a::before {

  font-family: "Myriad Pro", "Myriad", Arial, sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0em;
  content: "DESPENSA VILO";
    padding-top: 10px;
}



/* Oculta el texto original visualmente, conservándolo accesible. */
#masthead .main-title a {
  font-size: 0;
}

#masthead .main-title a::after {
  font-family: var(--dvh-serif);
  font-size: 30px;
}

/* ---------- Navegación desktop ---------- */
#masthead #site-navigation,
#masthead #site-navigation .inside-navigation,
#masthead #site-navigation .main-nav,
#masthead #site-navigation .menu-bar-items {
  background: transparent;
}

#masthead #site-navigation {
  margin-left: auto;
}

#masthead #site-navigation .inside-navigation {
  gap: clamp(18px, 3vw, 42px);
}

#masthead #site-navigation .main-nav > ul {
  align-items: center;
  gap: clamp(8px, 1.8vw, 28px);
}

#masthead #site-navigation .main-nav > ul > li > a {
  position: relative;
  padding: 16px 6px;
  color: var(--dvh-cream-light);
  background: transparent;
  font-family: var(--dvh-sans);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

#masthead #site-navigation .main-nav > ul > li > a::after {
  position: absolute;
  right: 6px;
  bottom: 8px;
  left: 6px;
  height: 2px;
  background: var(--dvh-yellow);
  content: "";
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--dvh-transition);
}

#masthead #site-navigation .main-nav > ul > li:hover > a,
#masthead #site-navigation .main-nav > ul > li:focus-within > a,
#masthead #site-navigation .main-nav > ul > li[class*="current-menu-"] > a {
  color: var(--dvh-yellow);
  background: transparent;
}

#masthead #site-navigation .main-nav > ul > li:hover > a::after,
#masthead #site-navigation .main-nav > ul > li:focus-within > a::after,
#masthead #site-navigation .main-nav > ul > li[class*="current-menu-"] > a::after {
  transform: scaleX(1);
  transform-origin: left center;
}

/* Contacto es actualmente el segundo elemento del menú. */
#masthead #site-navigation .main-nav > ul > li:last-child > a {
  margin-left: 8px;
  padding: 14px 21px;
  border: 1px solid var(--dvh-yellow);
  color: var(--dvh-green-dark);
  background: var(--dvh-yellow);
}

#masthead #site-navigation .main-nav > ul > li:last-child > a::after {
  display: none;
}

#masthead #site-navigation .main-nav > ul > li:last-child > a:hover,
#masthead #site-navigation .main-nav > ul > li:last-child > a:focus {
  border-color: var(--dvh-cream-light);
  color: var(--dvh-green-dark);
  background: var(--dvh-cream-light);
}

/* ---------- Submenús ---------- */
#masthead #site-navigation .main-nav ul ul {
  min-width: 220px;
  padding: 10px;
  border: 1px solid var(--dvh-line-light);
  color: var(--dvh-cream-light);
  background: var(--dvh-green-dark);
  box-shadow: 0 18px 38px rgba(13, 45, 38, 0.22);
}

#masthead #site-navigation .main-nav ul ul li a {
  padding: 12px 14px;
  color: var(--dvh-cream-light);
  background: transparent;
  font-size: 12px;
}

#masthead #site-navigation .main-nav ul ul li:hover > a,
#masthead #site-navigation .main-nav ul ul li:focus-within > a {
  color: var(--dvh-green-dark);
  background: var(--dvh-yellow);
}

/* ---------- Carrito ---------- */
#masthead .menu-bar-items {
  display: flex;
  align-items: center;
}

#masthead .cart-contents {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--dvh-line-light);
  border-radius: 50%;
  color: var(--dvh-cream-light);
  background: transparent;
  transition: color var(--dvh-transition), background var(--dvh-transition),
    border-color var(--dvh-transition), transform var(--dvh-transition);
}

#masthead .cart-contents:hover,
#masthead .cart-contents:focus {
  border-color: var(--dvh-yellow);
  color: var(--dvh-green-dark);
  background: var(--dvh-yellow);
  transform: translateY(-2px);
}

#masthead .cart-contents .gp-icon {
  display: flex;
  font-size: 17px;
}

#masthead .cart-contents .number-of-items {
  position: absolute;
  top: -5px;
  right: -5px;
  display: flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid var(--dvh-green);
  border-radius: 50%;
  color: var(--dvh-cream-light);
  background: var(--dvh-rust);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Minicarrito ---------- */
#masthead #wc-mini-cart {
  top: calc(100% + 14px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--dvh-line-light);
  color: var(--dvh-green-dark);
  background: var(--dvh-cream-light);
  box-shadow: 0 22px 50px rgba(13, 45, 38, 0.25);
}

#masthead #wc-mini-cart .inside-wc-mini-cart {
  padding: 22px;
}

#masthead #wc-mini-cart a:not(.button) { color: var(--dvh-green); }

#masthead #wc-mini-cart .button {
  border-radius: 0;
  color: var(--dvh-cream-light);
  background: var(--dvh-green);
}

/* ---------- Botón móvil ---------- */
#masthead #mobile-menu-control-wrapper {
  margin-left: auto;
  background: transparent;
}

#masthead #mobile-menu-control-wrapper .menu-toggle,
#masthead #site-navigation .menu-toggle {
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  color: var(--dvh-cream-light);
  background: transparent;
}

#masthead .menu-toggle:hover,
#masthead .menu-toggle:focus {
  color: var(--dvh-yellow);
  background: transparent;
}

#masthead .menu-toggle .gp-icon {
  font-size: 19px;
}

/* ---------- Tablet y mobile ---------- */
@media (max-width: 768px) {
  .admin-bar #masthead.site-header { top: 46px; }

  #masthead .inside-header {
    min-height: 76px;
    padding: 10px 18px;
    gap: 12px;
  }

  #masthead .main-title a::before { font-size: 8px; }
  #masthead .main-title a::after { font-size: 25px; }

  #masthead #mobile-menu-control-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  #masthead #mobile-menu-control-wrapper .menu-bar-items {
    margin-right: 2px;
  }

  #masthead #site-navigation.toggled {
    flex-basis: calc(100% + 36px);
    width: calc(100% + 36px);
    margin: 10px -18px -10px;
    border-top: 1px solid var(--dvh-line-light);
    background: var(--dvh-green-dark);
  }

  #masthead #site-navigation.toggled .inside-navigation {
    display: block;
    padding: 12px 18px 18px;
  }

  #masthead #site-navigation.toggled .menu-toggle,
  #masthead #site-navigation.toggled > .inside-navigation > .menu-bar-items {
    display: none;
  }

  #masthead #site-navigation.toggled .main-nav > ul {
    display: block;
  }

  #masthead #site-navigation.toggled .main-nav > ul > li {
    border-bottom: 1px solid var(--dvh-line-light);
  }

  #masthead #site-navigation.toggled .main-nav > ul > li > a,
  #masthead #site-navigation.toggled .main-nav > ul > li:last-child > a {
    display: flex;
    min-height: 54px;
    align-items: center;
    margin: 0;
    padding: 16px 4px;
    border: 0;
    color: var(--dvh-cream-light);
    background: transparent;
  }

  #masthead #site-navigation.toggled .main-nav > ul > li > a::after {
    right: 4px;
    bottom: -1px;
    left: 4px;
  }

  #masthead #site-navigation.toggled .main-nav > ul > li:last-child > a {
    color: var(--dvh-yellow);
  }

  #masthead #site-navigation.toggled .main-nav ul ul {
    position: static;
    width: 100%;
    padding: 0 0 10px 16px;
    border: 0;
    box-shadow: none;
  }
}

@media (max-width: 480px) {
  #masthead .cart-contents {
    width: 42px;
    height: 42px;
  }

  #masthead #mobile-menu-control-wrapper .menu-toggle {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }
}

/* ---------- Accesibilidad ---------- */
#masthead a:focus-visible,
#masthead button:focus-visible {
  outline: 3px solid var(--dvh-yellow);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  #masthead *,
  #masthead *::before,
  #masthead *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
