/* ==========================================================================
   Victoria Espinela · Sistema global
   Se carga en TODA la web: variables, fuentes, botones y cabecera.
   Lo exclusivo de la portada está en home.css y lo de la ficha, en producto.css.
   Se usa tal cual en el prototipo y en el tema hijo (ve-child/assets/css/global.css).

   Dirección: editorial. El color lo ponen las fotos de producto; la interfaz
   es blanco roto + negro, con el dorado del logo como acento.
   Formas: imágenes y bloques con esquinas rectas; controles (botones) redondeados.
   Las clases llevan el prefijo ve- para no chocar con Astra ni con los plugins.
   ========================================================================== */

/* ---------- Fuentes autoalojadas ----------
   Se llaman igual que las que Astra pedía a Google ("Unna" y "DM Sans"), así que
   el resto de la web (pie, fichas, carrito) usa estas sin ir a los servidores de Google. */
@font-face {
  font-family: "Unna";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/unna-normal-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Unna";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/unna-italic-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/dmsans-normal-400-700-latin.woff2") format("woff2");
}

/* ---------- Variables ---------- */
:root {
  --ve-bg: #FBFBFA;          /* fondo general, blanco roto neutro */
  --ve-surface: #F1F0EE;     /* bandas y bloques, gris muy claro */
  --ve-white: #FFFFFF;       /* fondo de las fotos de producto */
  --ve-ink: #151515;         /* texto y botones */
  --ve-muted: #5E5C59;       /* texto secundario (contraste 6,5:1) */
  --ve-line: #E3E1DE;
  --ve-gold: #A67F32;        /* dorado del logo, oscurecido: estrellas y detalles */
  --ve-forest: #243A2F;      /* verde bosque (piel del Eternal verde): bloque de color */
  --ve-forest-ink: #EEEAE2;  /* texto sobre verde */
  --ve-forest-muted: #B8BBB2;/* texto secundario sobre verde (contraste 7:1) */

  --ve-serif: "Unna", Georgia, "Times New Roman", serif;
  --ve-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ve-gutter: 16px;
  --ve-max: 1280px;
  --ve-section: 72px;
  --ve-header-h: 60px;
  --ve-ease: cubic-bezier(.16, 1, .3, 1);

  /* capas */
  --ve-z-header: 50;
  --ve-z-menu: 49;
  --ve-z-skip: 60;
  --ve-z-grain: 55;
}
@media (min-width: 768px) {
  :root { --ve-gutter: 32px; --ve-section: 104px; }
}
@media (min-width: 1024px) {
  :root { --ve-gutter: 48px; --ve-section: 136px; --ve-header-h: 72px; }
}

/* ---------- Utilidades ---------- */
.ve-container { width: 100%; max-width: calc(var(--ve-max) + 2 * var(--ve-gutter)); margin-inline: auto; padding-inline: var(--ve-gutter); }
.ve-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ve-skip { position: absolute; left: 8px; top: -60px; z-index: var(--ve-z-skip); padding: 10px 16px; background: var(--ve-ink); color: var(--ve-white); text-decoration: none; }
.ve-skip:focus { top: 8px; }
.ve-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ve-js-lock, .ve-js-lock body { overflow: hidden; }

.ve-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
  transition: gap .3s var(--ve-ease);
}
.ve-link::after { content: "→"; }
.ve-link:hover { gap: 12px; }

/* ---------- Botones ----------
   Doble clase (.ve-btn.ve-btn--x) para ganar a los estilos de botón de Astra
   (button, button:hover, button:focus) sin usar !important. */
.ve-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 12px 30px;
  border: 1px solid transparent; border-radius: 999px;
  font: 500 15px/1.2 var(--ve-sans); letter-spacing: .01em; white-space: nowrap;
  text-decoration: none; text-transform: none; box-shadow: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s;
}
.ve-btn:active { transform: scale(.98); }
/* Flecha dentro de su propio círculo, pegada al borde derecho del botón */
.ve-btn:has(.ve-btn__icon) { gap: 14px; padding-right: 6px; }
.ve-btn__icon {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(21, 21, 21, .08);
  transition: transform .5s var(--ve-ease);
}
.ve-btn--dark .ve-btn__icon { background: rgba(255, 255, 255, .14); }
.ve-btn__icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ve-btn:hover .ve-btn__icon { transform: translateX(3px) scale(1.05); }
.ve-btn.ve-btn--dark, .ve-btn.ve-btn--dark:focus { background: var(--ve-ink); color: var(--ve-white); border-color: transparent; }
.ve-btn.ve-btn--dark:hover { background: #333; color: var(--ve-white); }
.ve-btn.ve-btn--light, .ve-btn.ve-btn--light:focus { background: var(--ve-bg); color: var(--ve-ink); border-color: transparent; }
.ve-btn.ve-btn--light:hover { background: var(--ve-white); color: var(--ve-ink); }
.ve-btn.ve-btn--ghost, .ve-btn.ve-btn--ghost:focus { background: transparent; border-color: rgba(255, 255, 255, .8); color: var(--ve-white); }
.ve-btn.ve-btn--ghost:hover { background: rgba(255, 255, 255, .12); border-color: var(--ve-white); color: var(--ve-white); }
.ve-btn.ve-btn--outline, .ve-btn.ve-btn--outline:focus { border-color: var(--ve-ink); background: transparent; color: var(--ve-ink); }
.ve-btn.ve-btn--outline:hover { background: var(--ve-ink); color: var(--ve-white); }
.ve-btn--sm { min-height: 44px; padding: 10px 20px; font-size: 14px; }

/* ==========================================================================
   SECCIÓN: cabecera (toda la web)
   Fija arriba. En la portada es transparente sobre el hero (.is-over-hero)
   y sólida al hacer scroll; en el resto de páginas, siempre sólida.
   ========================================================================== */
/* Reseteos dentro de la cabecera, a la altura de los estilos de elemento del tema */
.ve-header, .ve-header *, .ve-header *::before, .ve-header *::after { box-sizing: border-box; }
:where(.ve-header) :is(ul, ol, p, form) { margin: 0; padding: 0; }
:where(.ve-header) :is(ul, ol) { list-style: none; }
:where(.ve-header) img { display: block; max-width: 100%; height: auto; }
:where(.ve-header) a { color: inherit; text-decoration: none; }
:where(.ve-header) a:is(:hover, :focus) { color: inherit; }
:where(.ve-header) a:focus:not(:focus-visible) { outline: none; }
.ve-header a, .ve-header button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ve-header :focus-visible { outline: 2px solid var(--ve-ink); outline-offset: 3px; }

.ve-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--ve-z-header);
  background: var(--ve-bg); color: var(--ve-ink);
  border-bottom: 1px solid var(--ve-line);
  font-family: var(--ve-sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s, border-color .3s;
}
/* Resto de páginas: el contenido empieza debajo de la cabecera fija */
.ve-has-header #content { padding-top: var(--ve-header-h); }
/* Con la barra de administración de WordPress (sesión iniciada) la cabecera baja lo que mide esa barra */
.admin-bar .ve-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ve-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .ve-header { top: 0; } .admin-bar .ve-header.is-over-hero { top: 46px; } }
.ve-header.is-over-hero:not(.is-menu-open):not(.is-search-open) {
  background: transparent; color: var(--ve-white); border-color: transparent;
}
.ve-header__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: var(--ve-header-h); }
.ve-header .ve-header__icon, .ve-header .ve-header__icon:is(:hover, :focus) {
  position: relative; display: inline-grid; place-items: center;
  width: 44px; height: 44px; margin: 0; padding: 0;
  background: none; border: 0; border-radius: 0; box-shadow: none; color: inherit; cursor: pointer;
}
.ve-header .ve-header__menu-btn { justify-self: start; margin-left: -10px; }
/* Hamburguesa de dos líneas que se convierte en X */
.ve-burger { position: relative; display: block; width: 22px; height: 12px; }
.ve-burger span {
  position: absolute; left: 0; width: 100%; height: 1.4px; background: currentColor; border-radius: 1px;
  transition: transform .5s var(--ve-ease), top .5s var(--ve-ease);
}
.ve-burger span:first-child { top: 0; }
.ve-burger span:last-child { top: calc(100% - 1.4px); }
[aria-expanded="true"] .ve-burger span:first-child { top: calc(50% - .7px); transform: rotate(45deg); }
[aria-expanded="true"] .ve-burger span:last-child { top: calc(50% - .7px); transform: rotate(-45deg); }
.ve-header__actions { justify-self: end; display: flex; margin-right: -10px; }

.ve-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.ve-logo__mark { width: 34px; height: auto; }
.ve-logo__name { font-family: var(--ve-serif); font-size: 21px; line-height: 1.2; white-space: nowrap; }
@media (max-width: 380px) { .ve-logo__name { font-size: 19px; } .ve-logo__mark { width: 28px; } }

.ve-cart__count {
  position: absolute; top: 6px; right: 3px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--ve-gold); color: var(--ve-white);
  font-size: 11px; font-weight: 600; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums;
}

/* Menú móvil: pantalla completa bajo la barra */
.ve-nav {
  position: fixed; inset: var(--ve-nav-top, var(--ve-header-h)) 0 0 0; z-index: var(--ve-z-menu);
  padding: 32px var(--ve-gutter);
  background: var(--ve-bg); color: var(--ve-ink);
  visibility: hidden; opacity: 0; overflow-y: auto; overscroll-behavior: contain;
  transition: opacity .25s var(--ve-ease), visibility 0s linear .25s;
}
.ve-header.is-menu-open .ve-nav { visibility: visible; opacity: 1; transition: opacity .25s var(--ve-ease); }
.ve-nav__list a { display: block; padding: 14px 0; font-family: var(--ve-serif); font-size: 40px; line-height: 1.1; text-decoration: none; }
@media (max-width: 1023px) {
  .ve-nav__list li { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ve-ease), transform .6s var(--ve-ease); }
  .ve-header.is-menu-open .ve-nav__list li { opacity: 1; transform: none; }
  .ve-header.is-menu-open .ve-nav__list li:nth-child(2) { transition-delay: .06s; }
  .ve-header.is-menu-open .ve-nav__list li:nth-child(3) { transition-delay: .12s; }
  .ve-header.is-menu-open .ve-nav__list li:nth-child(4) { transition-delay: .18s; }
}

@media (min-width: 1024px) {
  .ve-header__bar { grid-template-columns: auto 1fr auto; gap: 40px; }
  .ve-header .ve-header__menu-btn { display: none; }
  .ve-logo { grid-column: 1; grid-row: 1; }
  .ve-logo__mark { width: 38px; }
  .ve-logo__name { font-size: 24px; }
  .ve-nav {
    position: static; grid-column: 2; grid-row: 1;
    padding: 0; background: none; color: inherit;
    visibility: visible; opacity: 1; overflow: visible;
  }
  .ve-nav__list { display: flex; justify-content: center; gap: 40px; }
  .ve-nav__list a {
    padding: 6px 0; font-family: var(--ve-sans); font-size: 15px; font-weight: 500;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
    transition: background-size .3s var(--ve-ease);
  }
  .ve-nav__list a:hover { background-size: 100% 1px; }
  .ve-header__actions { grid-column: 3; }
}

/* Buscador desplegable */
.ve-search { border-top: 1px solid var(--ve-line); background: var(--ve-bg); color: var(--ve-ink); }
.ve-search[hidden] { display: none; }
.ve-search__inner { display: flex; gap: 8px; padding-block: 12px; }
.ve-header .ve-search__input, .ve-header .ve-search__input:focus {
  flex: 1; box-sizing: border-box; min-width: 0; height: 44px; margin: 0; padding: 0 14px;
  border: 1px solid #C9C6C1; border-radius: 0; box-shadow: none; -webkit-appearance: none; appearance: none;
  background: var(--ve-white); color: var(--ve-ink); font: 16px var(--ve-sans);
}
.ve-search__input::placeholder { color: var(--ve-muted); }
.ve-header .ve-search__input:focus-visible { outline: 2px solid var(--ve-ink); outline-offset: 0; }

@media (prefers-reduced-motion: reduce) {
  .ve-header *, .ve-header *::before, .ve-header *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .ve-nav__list li { opacity: 1 !important; transform: none !important; }
}
