/* ==========================================================================
   Everything Flamenco — Design System (global stylesheet)
   Stack: Hello Elementor (tema hijo) + Elementor Pro + WooCommerce
   Fuente de verdad: artifact "Everything Flamenco" Design System (tokens.json)
   Destino: hello-theme-child/assets/css/ef-design-system.css
   Lo básico (colores, fuentes, botones, formularios) se define en
   Elementor → Site Settings; este archivo cubre lo que Site Settings no
   alcanza (WooCommerce, insignias, precio, tarjetas, utilidades).
   Probar SIEMPRE en staging antes de producción.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   Los colores apuntan a los Global Colors de Elementor (ver INSTRUCCIONES §3)
   con el hex como respaldo, para que un cambio en Site Settings se propague.
   Sustituir <id> por el ID real de cada Global Color tras crearlo.
   -------------------------------------------------------------------------- */
:root {
  --ef-yellow:     var(--e-global-color-ef_yellow,   #ffd71f);
  --ef-gold:       var(--e-global-color-ef_gold,     #f4bd16);
  --ef-burgundy:   var(--e-global-color-ef_burgundy, #8d123f);
  --ef-plum:       var(--e-global-color-ef_plum,     #581845);
  --ef-red:        var(--e-global-color-ef_red,      #e01020);
  --ef-cream:      var(--e-global-color-ef_cream,    #faf0e6);
  --ef-cream-soft: #f5efe8;
  --ef-surface:    #ffffff;
  --ef-ink:        var(--e-global-color-ef_ink,      #281e1e);
  --ef-muted:      var(--e-global-color-ef_muted,    #69727d);
  --ef-line:       var(--e-global-color-ef_line,     #cfcfcf);

  --font-sans:      Manrope, Arial, sans-serif;
  --font-serif:     "Cormorant Garamond", Georgia, serif;
  --font-condensed: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;

  --radius-none: 0;
  --radius-sm:   2px;
  --radius-full: 999px;
  --shadow-card: 0 1px 3px rgba(40, 30, 30, .08);
}

/* --------------------------------------------------------------------------
   2. BASE  (respaldo de Site Settings → Typography; Hello aplica muy poco)
   -------------------------------------------------------------------------- */
body {
  background: var(--ef-surface);
  color: var(--ef-ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 22px;
}
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; color: var(--ef-ink); }
h2 { color: var(--ef-plum); }
h4, h5, h6 { font-family: var(--font-sans); font-weight: 700; }
a { color: var(--ef-burgundy); }
a:hover { color: var(--ef-plum); }
:focus-visible { outline: 2px solid var(--ef-burgundy); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   3. BOTONES WOOCOMMERCE  (los de Elementor salen de Site Settings → Buttons)
   -------------------------------------------------------------------------- */
.ef-btn,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit, .woocommerce .button.alt,
.single_add_to_cart_button, .checkout-button, #place_order {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-none);
  border: 1px solid transparent;
  background: var(--ef-gold);
  color: #281e1e;
  transition: background-color .15s, color .15s, border-color .15s;
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover,
.woocommerce .button.alt:hover, .single_add_to_cart_button:hover,
.checkout-button:hover, #place_order:hover, .ef-btn--primary:hover {
  background: var(--ef-yellow);
  color: #281e1e;
}
.ef-btn--secondary { background: var(--ef-burgundy); color: #fff; }
.ef-btn--secondary:hover { background: var(--ef-plum); color: #fff; }
.ef-btn--outline { background: transparent; color: var(--ef-ink); border-color: var(--ef-ink); }
.ef-btn--outline:hover { background: var(--ef-ink); color: var(--ef-surface); }
.woocommerce .button:disabled, .woocommerce .button.disabled { opacity: .45; cursor: not-allowed; }

/* --------------------------------------------------------------------------
   4. INSIGNIAS  (componente Badge)
   -------------------------------------------------------------------------- */
.ef-badge,
.woocommerce span.onsale {
  font-family: var(--font-condensed);
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  min-width: 0; min-height: 0;
  top: var(--space-2); left: var(--space-2); right: auto; margin: 0;
  display: inline-block;
  box-sizing: border-box;
}
.ef-badge--sale, .woocommerce span.onsale { background: var(--ef-red); color: #fff; }
/* Galería de ficha: Elementor/Woo a veces dejan el badge demasiado apretado. */
.single-product .woocommerce span.onsale,
.elementor-widget-woocommerce-product-images .onsale {
  padding: 8px 12px !important;
  font-size: 13px !important;
  line-height: 1 !important;
}
.ef-badge--new     { background: var(--ef-ink); color: var(--ef-surface); }
.ef-badge--soldout { background: var(--ef-cream-soft); color: var(--ef-muted); }

/* --------------------------------------------------------------------------
   5. PRECIO  (componente Price)
   -------------------------------------------------------------------------- */
.ef-price,
.woocommerce .price, .woocommerce .amount,
.elementor-widget-woocommerce-product-price .price {
  font-family: var(--font-condensed);
  font-weight: 700;
  color: var(--ef-ink);
}
.woocommerce ul.products li.product .price { font-size: 18px; line-height: 22px; color: var(--ef-ink); }
.woocommerce .price del, .woocommerce .price del .amount { color: var(--ef-muted); font-weight: 400; font-size: .85em; opacity: 1; }
.woocommerce .price ins, .woocommerce .price ins .amount { color: var(--ef-red); text-decoration: none; }
.elementor-widget-woocommerce-product-price .price { font-size: 26px; line-height: 30px; }

/* --------------------------------------------------------------------------
   6. FORMULARIOS WOOCOMMERCE  (los de Elementor salen de Site Settings → Form Fields)
   -------------------------------------------------------------------------- */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce .quantity .qty,
.woocommerce-product-addons input, .woocommerce-product-addons textarea, .woocommerce-product-addons select {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ef-ink);
  background: var(--ef-surface);
  border: 1px solid var(--ef-line);
  border-radius: var(--radius-none);
  padding: var(--space-3) var(--space-4);
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
  outline: none;
  border-color: var(--ef-ink);
  box-shadow: 0 0 0 1px var(--ef-ink);
}
.woocommerce form .form-row label { font-size: 13px; font-weight: 600; color: var(--ef-ink); }
.woocommerce form .form-row.woocommerce-invalid input.input-text { border-color: var(--ef-red); }
.woocommerce-error { border-top-color: var(--ef-red); }
.woocommerce-message, .woocommerce-info { border-top-color: var(--ef-gold); }

/* --------------------------------------------------------------------------
   7. TARJETA DE PRODUCTO  (componente ProductCard)
   Aplica a los bucles de WooCommerce y a los widgets Products / Archive Products.
   -------------------------------------------------------------------------- */
.woocommerce ul.products li.product {
  background: var(--ef-surface);
  transition: box-shadow .15s;
}
.woocommerce ul.products li.product:hover { box-shadow: var(--shadow-card); }
.woocommerce ul.products li.product a img {
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: #fff;
  margin-bottom: var(--space-2);
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  color: var(--ef-ink);
  padding: 0 var(--space-2);
}
.woocommerce ul.products li.product .price { padding: 0 var(--space-2) var(--space-3); }

/* --------------------------------------------------------------------------
   7b. GALERÍA DE FICHA  (miniaturas bajo la imagen principal)
   -------------------------------------------------------------------------- */
/* Especificidad alta: Woo pone margin:0 en .woocommerce div.product div.images .flex-control-thumbs */
.woocommerce.single-product div.product div.images .flex-control-thumbs,
.single-product .woocommerce-product-gallery .flex-control-thumbs {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 0 !important;
  padding: 0;
  list-style: none;
}
.woocommerce.single-product div.product div.images .flex-control-thumbs li,
.single-product .woocommerce-product-gallery .flex-control-thumbs li {
  float: none !important;
  width: calc((100% - 30px) / 4); /* 4 columnas, 3 huecos de 10px */
  margin: 0 !important;
  padding: 0;
}
.woocommerce.single-product div.product div.images .flex-control-thumbs li img,
.single-product .woocommerce-product-gallery .flex-control-thumbs li img {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
}
@media (max-width: 767px) {
  .woocommerce.single-product div.product div.images .flex-control-thumbs,
  .single-product .woocommerce-product-gallery .flex-control-thumbs {
    gap: 8px;
    margin-top: 10px !important;
  }
  .woocommerce.single-product div.product div.images .flex-control-thumbs li,
  .single-product .woocommerce-product-gallery .flex-control-thumbs li {
    width: calc((100% - 24px) / 4);
  }
}

/* --------------------------------------------------------------------------
   8. UTILIDADES  (Elementor: Avanzado → Clases CSS)
   -------------------------------------------------------------------------- */
.ef-section        { padding-block: var(--space-16); }
.ef-section--cream { background: var(--ef-cream); }
.ef-section--yellow{ background: var(--ef-yellow); color: #281e1e; }
.ef-section--plum  { background: var(--ef-plum); color: var(--ef-cream); }
@media (max-width: 767px) { .ef-section { padding-block: var(--space-12); } }

.ef-eyebrow {
  font-family: var(--font-condensed);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ef-burgundy);
}

/* Hero: titular en dos voces. Widget Heading con clase ef-hero-title;
   la segunda línea envuelta en <em>. */
.ef-hero-title .elementor-heading-title { font-family: var(--font-sans); font-weight: 800; color: #281e1e; }
.ef-hero-title .elementor-heading-title em {
  display: block; font-family: var(--font-serif); font-weight: 500; font-style: italic; font-size: .72em;
}

/* Desplegables de ficha (widget Accordion de Elementor con clase ef-accordion) */
.ef-accordion .elementor-tab-title,
.ef-accordion summary {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-color: var(--ef-line);
}
