/* =========================================================
   MuyLindo — Home 4
   CSS exclusivo de esta landing. Todo selector de WooCommerce
   va anidado bajo .ml4-nuevos (regla de encapsulamiento del
   proyecto: nada global desde una landing).
   ========================================================= */

:root {
  --ml4-ink:        #0f172a;
  --ml4-ink-soft:   #334155;
  --ml4-muted:      #64748b;
  --ml4-line:       #e2e8f0;
  --ml4-line-soft:  #f1f5f9;
  --ml4-paper:      #ffffff;
  --ml4-wash:       #f8fafc;
  /* Naranja de marca (ver design-muylindo-co.md sección 1): #c2410c es un
     escalón más oscuro que el --ml-orange-dark real (#ea580c) del header,
     necesario porque #ea580c con texto blanco da 3.56:1 y no pasa WCAG AA. */
  --ml4-accent:     #c2410c;
  --ml4-accent-ink: #9a3412;
  --ml4-focus:      #009b88;

  --ml4-radius:     8px;
  --ml4-radius-sm:  4px;

  --sp-xs:      8px;
  --sp-sm:      16px;
  --sp-md:      24px;
  --sp-lg:      40px;
  --sp-xl:      64px;
  --sp-section: 88px;
}

@media (max-width: 768px) {
  :root {
    --sp-lg:      24px;
    --sp-xl:      40px;
    --sp-section: 52px;
  }
}

.ml4 *,
.ml4 *::before,
.ml4 *::after { box-sizing: border-box; }

.ml4 {
  display: block;
  background: var(--ml4-paper);
  color: var(--ml4-ink-soft);
  font-family: var(--ml-font, system-ui, -apple-system, 'Segoe UI', sans-serif);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.ml4 img { max-width: 100%; }

.ml4 a { color: inherit; }

.ml4 a:focus-visible,
.ml4 button:focus-visible {
  outline: 2px solid var(--ml4-focus);
  outline-offset: 3px;
  border-radius: var(--ml4-radius-sm);
}

/* ---------- Botones y enlaces de acción ---------- */

.ml4-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 26px;
  background: var(--ml4-accent);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--ml4-accent);
  border-radius: var(--ml4-radius);
  transition: background-color .2s ease-out, border-color .2s ease-out;
}
.ml4-btn:hover { background: var(--ml4-accent-ink); border-color: var(--ml4-accent-ink); }

.ml4-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 4px;
  color: var(--ml4-ink);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--ml4-ink);
  transition: color .2s ease-out, border-color .2s ease-out;
}
.ml4-link:hover { color: var(--ml4-accent-ink); border-color: var(--ml4-accent-ink); }

/* ---------- Encabezados de sección ---------- */

.ml4-head { margin-bottom: var(--sp-lg); }

.ml4-head__title {
  margin: 0;
  color: var(--ml4-ink);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.ml4-head__note {
  margin: var(--sp-xs) 0 0;
  max-width: 62ch;
  color: var(--ml4-muted);
  font-size: 0.95rem;
}

.ml4-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-md);
  flex-wrap: wrap;
}

/* ---------- Hero ---------- */

.ml4-hero {
  padding: var(--sp-xl) 0 var(--sp-lg);
  border-bottom: 1px solid var(--ml4-line);
  background: var(--ml4-paper);
}

.ml4-hero__inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.ml4-hero__title {
  margin: 0 auto;
  color: var(--ml4-ink);
  font-size: clamp(1.4rem, 1.05rem + 1.8vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-wrap: balance;
  text-align: center;
}

.ml4-hero__text {
  margin: var(--sp-sm) auto 0;
  max-width: 64ch;
  font-size: 1.05rem;
  color: var(--ml4-ink-soft);
  line-height: 1.55;
  text-align: center;
}

.ml4-hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-sm) var(--sp-md);
  margin-top: var(--sp-md);
}

@media (max-width: 768px) {
  .ml4-hero {
    padding: var(--sp-lg) 0 var(--sp-md);
  }
  .ml4-hero__title {
    font-size: 1.35rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
  }
  .ml4-hero__text {
    font-size: 0.92rem;
    line-height: 1.45;
    margin-top: 10px;
  }
}

/* ---------- Categorías ---------- */

.ml4-cats { padding: var(--sp-section) 0; }

.ml4-cats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-lg) var(--sp-md);
}

.ml4-cat {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--ml4-radius);
  overflow: hidden;
  border: 1px solid var(--ml4-line);
  transition: box-shadow .2s ease-out, border-color .2s ease-out;
}

.ml4-cat__media {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--ml4-line-soft);
}

.ml4-cat__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease-out;
}

/* Título superpuesto sobre la imagen, con degradado para legibilidad */
.ml4-cat__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  padding: 44px 18px 20px;
  background: linear-gradient(to top, rgba(15, 23, 42, .82) 0%, rgba(15, 23, 42, .4) 60%, rgba(15, 23, 42, 0) 100%);
}

.ml4-cat__name {
  display: block;
  color: #ffffff;
  font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.ml4-cat__count { display: none; }

.ml4-cat:hover { border-color: var(--ml4-ink); box-shadow: 0 6px 20px rgba(15, 23, 42, .12); }
.ml4-cat:hover .ml4-cat__media img { transform: scale(1.05); }

/* ---------- Novedades (grid nativo de WooCommerce) ---------- */

.ml4-nuevos {
  padding: var(--sp-section) 0;
  background: var(--ml4-wash);
  border-top: 1px solid var(--ml4-line);
  border-bottom: 1px solid var(--ml4-line);
}

.ml4-nuevos ul.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ml4-nuevos ul.products::before,
.ml4-nuevos ul.products::after { content: none; }

.ml4-nuevos ul.products li.product.product {
  position: relative;
  width: auto;
  margin: 0;
  padding: var(--sp-sm);
  float: none;
  clear: none;
  display: flex;
  flex-direction: column;
  background: var(--ml4-paper);
  border: 1px solid var(--ml4-line);
  border-radius: var(--ml4-radius);
  text-align: left;
}

/* El tema (Astra) envuelve la tarjeta en dos wrappers propios; los
   disolvemos para poder ordenar imagen / título / precio / botón. */
.ml4-nuevos ul.products li.product .astra-shop-thumbnail-wrap,
.ml4-nuevos ul.products li.product .astra-shop-summary-wrap { display: contents; }

.ml4-nuevos ul.products li.product .woocommerce-loop-product__link {
  order: 1;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--ml4-line-soft);
  border-radius: var(--ml4-radius-sm);
}

.ml4-nuevos ul.products li.product .woocommerce-loop-product__link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  margin: 0;
}

.ml4-nuevos ul.products li.product .ast-loop-product__link {
  order: 2;
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 12px 0 0;
  text-decoration: none;
}

.ml4-nuevos ul.products li.product .woocommerce-loop-product__title {
  padding: 0;
  margin: 0;
  color: var(--ml4-ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.ml4-nuevos ul.products li.product .ast-loop-product__link:hover .woocommerce-loop-product__title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ml4-nuevos ul.products li.product .price {
  order: 3;
  display: block;
  margin: 6px 0 14px;
  color: var(--ml4-ink);
  font-size: 1.0625rem;
  font-weight: 700;
}

.ml4-nuevos ul.products li.product .price del {
  color: var(--ml4-muted);
  font-size: 0.875rem;
  font-weight: 400;
  margin-right: 6px;
}

.ml4-nuevos ul.products li.product .price ins {
  text-decoration: none;
  font-weight: 700;
}

.ml4-nuevos ul.products li.product .star-rating { display: none; }

.ml4-nuevos ul.products li.product .ahfb-svg-iconset { display: none; }

.ml4-nuevos ul.products li.product .ast-on-card-button,
.ml4-nuevos ul.products li.product .button,
.ml4-nuevos ul.products li.product .added_to_cart {
  order: 4;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: auto 0 0;
  padding: 12px 16px;
  background: var(--ml4-paper);
  color: var(--ml4-ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--ml4-ink);
  border-radius: var(--ml4-radius);
  transition: background-color .2s ease-out, color .2s ease-out;
}

.ml4-nuevos ul.products li.product .ast-on-card-button:hover,
.ml4-nuevos ul.products li.product .button:hover,
.ml4-nuevos ul.products li.product .added_to_cart:hover {
  background: var(--ml4-ink);
  color: #ffffff;
}

.ml4-nuevos ul.products li.product .added_to_cart {
  order: 5;
  margin-top: 8px;
  min-height: 0;
  padding: 6px 8px;
  background: none;
  border: 0;
  color: var(--ml4-accent-ink);
  font-size: 0.8125rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ml4-nuevos ul.products li.product .added_to_cart:hover {
  background: none;
  color: var(--ml4-ink);
}

.ml4-nuevos ul.products li.product .onsale {
  position: absolute;
  top: var(--sp-sm);
  left: var(--sp-sm);
  min-height: 0;
  min-width: 0;
  margin: 0;
  padding: 4px 10px;
  background: var(--ml4-ink);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  border-radius: 999px;
}

.ml4-nuevos ul.products li.product { position: relative; }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .ml4-nuevos ul.products li.product.product { width: auto; float: none; }
  .ml4-cats__grid { grid-template-columns: repeat(3, 1fr); }
  .ml4-nuevos ul.products { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
  .ml4-cats__grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-md) var(--sp-sm); }
  .ml4-nuevos ul.products { grid-template-columns: repeat(2, 1fr); gap: var(--sp-sm); }
  .ml4-hero { padding: var(--sp-lg) 0 var(--sp-md); }
  .ml4-btn, .ml4-hero__actions .ml4-link { width: 100%; justify-content: center; }
  .ml4-nuevos ul.products li.product.product { padding: 12px; }
  .ml4-nuevos ul.products li.product .ast-on-card-button,
  .ml4-nuevos ul.products li.product .button { padding: 12px 8px; font-size: 0.875rem; }
}
