/* ============================================================
   MasterLED — Overrides globales del theme (modular)
   Se carga desde head.tpl DESPUÉS de las stylesheets registradas,
   así prevalece sobre theme.css / custom.css sin tocarlos.
   Objetivo: coherencia con el lenguaje visual nuevo (ficha de
   producto, order-detail, cabecera de categoría).
   ============================================================ */

/* --- Fondo general de la web: blanco --- */
#wrapper { background: #ffffff; }

/* --- Fix scroll horizontal: el full-bleed `body#index #content-wrapper{margin:-14px}`
   (para la sección parallax/ambientes) desborda ~2px la página en desktop.
   Se neutraliza en origen (sin tocar overflow de root). La sección ambientes
   va a sustituirse; si se conserva y se quiere full-bleed, hacerlo sin overshoot. --- */
@media (min-width: 1200px) {
  body#index #content-wrapper { margin-inline: 0 !important; }
}
/* 2026-10-07: por debajo de 1200 el tema pone -15px y el .container-fluid solo tiene
   12px de padding → desborda 3px (scroll horizontal). Se iguala al padding: sigue
   a sangre completa pero sin pasarse. */
@media (max-width: 1199px) {
  body#index #content-wrapper { margin-inline: calc(-1 * var(--bs-gutter-x, 1.5rem) / 2) !important; }
}

/* --- Armonización de la escala tipográfica ---
   Las secciones "antiguas" de la home usan títulos ~40px (finos y
   gigantes) que chocan con el lenguaje nuevo (~24px). Se reducen a la
   misma escala. Selectores específicos: NO afectan a los componentes
   con clase propia (mlcats__title, cat-hero__title, ml-*, etc.). */
.brand-scroller-section .section-title h2 { font-size: 1.6rem; }      /* "Nuestras marcas" 40 -> 25.6px */
.hero-personalized-section .hero-greeting h2 { font-size: 1.6rem; }   /* "Bienvenido/a, ..." 32 -> 25.6px */

/* --- Anchos máximos armonizados (2026-10-07) ---
   Fondos a sangre completa; contenido dentro de UNA caja común:
   1860px + 16px de gutter → a 1920 el contenido va de x≈39 a x≈1866,
   alineado con la cabecera de categoría (.cat-hero__surface).
   Ficha de producto: se queda como está (1880). Ambientes: excepción
   (slider a sangre con tarjeta centrada). Texto SEO: se mantiene.
   Solo escritorio: móvil/tablet sin cambios. --- */
:root { --ml-max: 1860px; --ml-gutter: 16px; }

@media (min-width: 992px) {
  /* Home: el hero de temporada traía padding propio en el padre */
  .mlhero { padding-inline: 0 !important; }

  .mlhero__inner,                              /* hero temporada */
  #heroPersonalizedSection .container-fluid,   /* área usuario */
  .homecat,                                    /* categorías destacadas */
  .container-marcas,                           /* marcas */
  #home-reviews.mlreviews-home,                /* reseñas */
  .ml-trust,                                   /* confianza */
  .mlft__inner,                                /* footer: columnas */
  .mlft__bar {                                 /* footer: barra pagos/idiomas */
    max-width: var(--ml-max) !important;
    margin-inline: auto !important;
    padding-inline: var(--ml-gutter) !important;
    box-sizing: border-box;
  }

  /* Topes internos heredados (1660) que estrechaban el contenido */
  .homecat .mlcats { max-width: none !important; margin-inline: 0 !important; }
  .col:has(> .ml-trust) { max-width: none !important; padding-inline: 0 !important; flex: 1 1 100%; }
}

/* --- Categoría: filtros + listado dentro de la caja común (2026-10-07) ---
   La cabecera (#cat-hero) cuelga del MISMO .container-fluid que el listado,
   así que no se limita el contenedor (perdería el fondo a sangre): se limita
   solo la .row de columnas. Ancho = caja de contenido (1860 − 2×16 = 1828).
   `100% - 8px` → a <1860 el borde queda a 16px del viewport, igual que el hero.
   Resultado a 1920: filtros desde x≈39, última tarjeta hasta x≈1866. --- */
@media (min-width: 992px) {
  body#category #wrapper > .container-fluid > .row {
    width: min(calc(100% - 8px), calc(var(--ml-max) - 2 * var(--ml-gutter)));
    margin-inline: auto !important;
  }
  body#category #content-wrapper { padding-right: 0 !important; }
}

/* --- Footer: sin scroll horizontal (2026-10-07) ---
   Las columnas del footer (custom.css) tienen mínimos que no caben justo por encima
   de sus cortes de 1080 y 720px (desbordaban en 1081–1094 y 721–746). Se adelantan
   los mismos cambios de rejilla a 1180 y 760. --- */
@media (max-width: 1180px) {
  .mlft__inner { grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(110px, .7fr)); }
  .mlft__news { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .mlft__inner { grid-template-columns: 1fr 1fr; gap: 32px 24px; padding: 40px 20px 28px; }
  .mlft__brand { grid-column: 1 / -1; }
  .mlft__bar { padding: 18px 20px 24px; }
  .mlft__copy { margin-left: 0; width: 100%; order: 9; }
}

/* --- Botones primarios = estética del botón "Añadir al carrito" de la ficha (2026-10-09) ---
   Referencia: product-page.css → body#product .ml-product-panel .product-quantity .add-to-cart
   (#1d2a55, hover #3750a3, radio 8px, 500 12px, mayúsculas, tracking .1em, sin sombra).
   Cubre .btn-primary de todo el tema/módulos y .btn-primary-modern del checkout
   (mlonepagecheckout fuerza text-transform/peso con !important → aquí también).
   La ficha conserva su alto propio de 50px (regla más específica en product-page.css).
   Nota: "Outfit" no se carga en la web → se ve con el respaldo (Helvetica/Arial), igual
   que el botón de referencia. --- */
.btn-primary,
.btn.btn-primary,
.btn-primary-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: #1d2a55 !important;
  color: #fff !important;
  border: 1px solid #1d2a55 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font: 500 12px/1 "Outfit", "Helvetica", sans-serif !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.15s, background 0.25s, border-color 0.25s !important;
}
.btn-primary.btn-block,
.btn-primary-modern.btn-block { display: flex; width: 100%; }
.btn-primary.btn-sm,
.btn-primary-modern.btn-sm { padding: 9px 16px; }
.btn-primary:hover,
.btn-primary-modern:hover {
  background: #3750a3 !important;
  border-color: #3750a3 !important;
  color: #fff !important;
  transform: none;
}
.btn-primary:active,
.btn-primary:active:focus,
.btn-primary-modern:active { background: #3750a3 !important; transform: scale(0.98); }
.btn-primary:focus-visible,
.btn-primary-modern:focus-visible { outline: 2px solid #3750a3; outline-offset: 2px; }
.btn-primary:disabled, .btn-primary.disabled, .btn-primary[disabled],
.btn-primary-modern:disabled, .btn-primary-modern[disabled] {
  background: #1d2a55 !important;
  border-color: #1d2a55 !important;
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-primary .material-icons,
.btn-primary-modern .material-icons { font-size: 16px; }

/* Botones primarios con clase propia (mismo degradado antiguo #4285f4 → primary):
   login/registro (.continue-btn), carrito (.modern-checkout-btn, .modern-promo-btn) y
   carrito vacío (.modern-continue-shopping). "Seguir comprando" comparte clase con
   "Finalizar pedido" pero es secundario (fondo gris en línea) → se excluye. */
.continue-btn,
.modern-checkout-btn:not([style*="background"]),
.modern-promo-btn,
.modern-continue-shopping {
  background: #1d2a55 !important;
  color: #fff !important;
  border: 1px solid #1d2a55 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font-family: "Outfit", "Helvetica", sans-serif !important;
  font-weight: 500 !important;
  font-size: 12px !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  transition: transform 0.15s, background 0.25s, border-color 0.25s !important;
}
.continue-btn:hover,
.modern-checkout-btn:not([style*="background"]):hover,
.modern-promo-btn:hover,
.modern-continue-shopping:hover {
  background: #3750a3 !important;
  border-color: #3750a3 !important;
  color: #fff !important;
  transform: none !important;
}
.continue-btn:active,
.modern-checkout-btn:not([style*="background"]):active,
.modern-promo-btn:active,
.modern-continue-shopping:active { transform: scale(0.98) !important; }
.continue-btn:disabled,
.modern-promo-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 2026-10-15: avisos (toasts) de mlsavedcarts por encima de la cabecera y debajo de ella (head.tpl los mueve a <body>) */
body > #popup-container { position: fixed !important; top: 150px !important; right: 20px !important; z-index: 100000 !important; width: 350px; max-width: calc(100vw - 32px); }
@media (max-width: 767px) { body > #popup-container { top: 120px !important; right: 16px !important; } }

/* 2026-10-15: la fila de la miga de pan usaba 100vw y, con barra de desplazamiento clásica, sobraban ~15px en horizontal */
@media (max-width: 991px) {
  #wrapper .row:has(> nav.breadcrumb), #wrapper .row > nav.breadcrumb { width: auto !important; }
}

/* ============ 11/11/2026: miga de pan general (no la de categoría/listados ni la de producto) ============
   Inicio en círculo, chevrones finos, enlaces en gris (azul al pasar), página actual en pastilla.
   En móvil se desliza en horizontal con un difuminado al final. */
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 12px 0 8px !important;
  margin: 0 !important;
}
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 !important;
  padding: 0 28px 0 0 !important;   /* el último elemento queda fuera del difuminado */
  font-size: 13px;
  line-height: 1.2;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
          mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
}
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb li {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb li::before { content: none !important; }
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb li:not(:last-child)::after {
  content: "" !important;
  display: block;
  width: 6px;
  height: 6px;
  margin: 0 6px 0 4px;
  border-right: 1.5px solid #b4bac4;
  border-bottom: 1.5px solid #b4bac4;
  transform: rotate(-45deg);
  font-size: 0;
}
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb li:last-child::after { content: none !important; }
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb a {
  display: inline-flex;
  align-items: center;
  float: none;
  margin: 0;
  padding: 5px 8px;
  border-radius: 999px;
  color: #5b6472 !important;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb a:hover {
  background: #f1f3f6;
  color: #00408b !important;
}
/* Inicio: icono en círculo */
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb li:first-child a {
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  background: #f1f3f6;
}
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb li:first-child svg { margin: 0 !important; fill: #5b6472; }
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb li:first-child a:hover { background: #e6eef8; }
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb li:first-child a:hover svg { fill: #00408b; }
/* Página actual */
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb li:last-child:not(:first-child) a {
  background: #f1f3f6;
  color: #111 !important;
  font-weight: 600;
  pointer-events: none;
}
body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb a:focus-visible {
  outline: 2px solid #00408b;
  outline-offset: 2px;
}
@media (max-width: 767px) {
  body:not(#category):not(#product):not(#search):not(#new-products):not(#best-sales):not(#prices-drop) #wrapper nav.breadcrumb { padding-left: 12px !important; }
}

/* 16/11/2026: la miga de pan general también en CMS y contacto (allí estaba oculta por reglas antiguas) */
body#cms div:has(> nav.breadcrumb) { display: block !important; }
body#contact #wrapper nav.breadcrumb { display: flex !important; }

/* La capa importante prevalece sobre los tamaños pequeños de módulos sin impedir el zoom manual. */
@layer ml-mobile-form-legibility {
  @media (max-width: 767px), (hover: none) and (pointer: coarse) {
    input:not([type]),
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    input[type="date"],
    input[type="datetime-local"],
    input[type="month"],
    input[type="week"],
    input[type="time"],
    textarea,
    select {
      font-size: max(16px, 1rem) !important;
    }
  }
}
