/* ==========================================================================
   Maderplast Mayorista — Frontend Styles
   Paleta: arena #F5F0E8 · madera #C4956A · blanco · gris suave
   ========================================================================== */

:root {
  --mp-arena:     #F5F0E8;
  --mp-madera:    #C4956A;
  --mp-madera-d:  #a07855;
  --mp-gris:      #666;
  --mp-borde:     #e2d9cc;
  --mp-error:     #c0392b;
  --mp-ok:        #27ae60;
  --mp-warn:      #e6a817;
}

/* ── Precios ocultos ──────────────────────────────────────────────────────── */

.maderplast-precio-oculto {
  display: inline-block;
  color: #ff0000;
  font-size: 0.88em;
  font-style: italic;
}

a.maderplast-precio-oculto,
.maderplast-precio-oculto a {
  color: var(--mp-madera);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.maderplast-btn-ver-precio.button {
  background: var(--mp-arena) !important;
  color: var(--mp-madera) !important;
  border: 1px solid var(--mp-madera) !important;
  font-size: 0.84em !important;
  padding: 6px 14px !important;
}

.maderplast-btn-ver-precio.button:hover {
  background: var(--mp-madera) !important;
  color: #fff !important;
}

/* ── Avisos genéricos ─────────────────────────────────────────────────────── */

.maderplast-aviso {
  background: var(--mp-arena);
  border-left: 4px solid #ff0000;
  padding: 14px 18px;
  border-radius: 4px;
  margin: 16px 0;
  font-size: 0.95em;
  line-height: 1.6;
}
.maderplast-aviso p:last-child { margin-bottom: 0; }
.maderplast-aviso a { color: var(--mp-madera); }

.maderplast-pendiente {
  border-left-color: var(--mp-warn);
  background: #fdf6e3;
}
.maderplast-aprobado {
  border-left-color: var(--mp-ok);
  background: #eafaf1;
}

/* ── Aviso de compra mínima ───────────────────────────────────────────────── */

.maderplast-aviso-minimo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 0.9em;
  border: 1px solid var(--mp-borde);
  background: var(--mp-arena);
}

.maderplast-aviso-minimo--ok {
  border-color: var(--mp-ok);
  background: #eafaf1;
  color: #1a5c38;
}

.maderplast-aviso-minimo--pendiente {
  border-color: var(--mp-warn);
  background: #fdf6e3;
  color: #7d5a00;
}

.maderplast-aviso-minimo__icono {
  font-size: 1.15em;
  flex-shrink: 0;
}

/* ── Formulario de registro ───────────────────────────────────────────────── */

.maderplast-form-registro {
  max-width: 620px;
  margin: 0 auto;
}

.maderplast-form-row {
  margin-bottom: 20px;
}

.maderplast-form-row--half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .maderplast-form-row--half {
    grid-template-columns: 1fr;
  }
}

.maderplast-form-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9em;
  color: #333;
}

.maderplast-form-field label small {
  font-weight: 400;
  color: var(--mp-gris);
}

.maderplast-form-field label span[aria-hidden] {
  color: var(--mp-error);
  margin-left: 2px;
}

.maderplast-form-field input,
.maderplast-form-field select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--mp-borde);
  border-radius: 5px;
  font-size: 1em;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.18s, box-shadow 0.18s;
  color: #222;
}

.maderplast-form-field input:focus,
.maderplast-form-field select:focus {
  outline: none;
  border-color: var(--mp-madera);
  box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.18);
}

.maderplast-btn-submit {
  width: 100%;
  background: #6f4e37;
  color: #fff;
  border: none;
  padding: 14px 32px;
  border-radius: 5px;
  font-size: 1.05em;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.18s;
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
}

.maderplast-btn-submit:hover,
.maderplast-btn-submit:focus {
  background: #986843;
  outline: none;
}

.maderplast-form-nota {
  font-size: 0.82em;
  color: var(--mp-gris);
  margin-top: 10px;
  text-align: center;
}

/* Errores y éxito */
.maderplast-form-errors {
  background: #fdf0ef;
  border: 1px solid var(--mp-error);
  border-radius: 5px;
  padding: 12px 18px;
  margin-bottom: 20px;
  color: var(--mp-error);
}

.maderplast-form-errors ul {
  margin: 0;
  padding-left: 20px;
}

.maderplast-form-success {
  background: #eafaf1;
  border: 1px solid var(--mp-ok);
  border-radius: 5px;
  padding: 18px 20px;
  color: #1a5c38;
}

.maderplast-form-success strong {
  display: block;
  font-size: 1.05em;
  margin-bottom: 4px;
}

/* ==========================================================================
   Botón "Agregar al carrito" — rojo primario
   (cubre .woocommerce, .woocommerce-page y Elementor sin wrapper WC)
   ========================================================================== */

.woocommerce a.button.add_to_cart_button,
.woocommerce button.button.add_to_cart_button,
.woocommerce input.button.add_to_cart_button,
.woocommerce .single_add_to_cart_button.button,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
/* Elementor Products widget (home) */
ul.products li.product a.button.add_to_cart_button,
ul.products li.product button.button.add_to_cart_button,
.elementor-widget-woocommerce-products a.button.add_to_cart_button,
.elementor ul.products a.button.add_to_cart_button {
  background-color: #ff0000 !important;
  border-color:     #ff0000 !important;
  color: #fff !important;
}
.woocommerce a.button.add_to_cart_button:hover,
.woocommerce button.button.add_to_cart_button:hover,
.woocommerce .single_add_to_cart_button.button:hover,
.woocommerce button.button.alt:hover,
ul.products li.product a.button.add_to_cart_button:hover,
.elementor ul.products a.button.add_to_cart_button:hover {
  background-color: #cc0000 !important;
  border-color:     #cc0000 !important;
  color: #fff !important;
}

/* ==========================================================================
   Selector de cantidad +/−
   ========================================================================== */

.mp-qty-wrap {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--mp-borde);
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
  height: 42px;
}
.mp-qty-wrap input.qty {
  width: 52px !important;
  border: none !important;
  border-left:  1px solid var(--mp-borde) !important;
  border-right: 1px solid var(--mp-borde) !important;
  border-radius: 0 !important;
  text-align: center;
  padding: 0 4px !important;
  font-size: 1em;
  -moz-appearance: textfield;
  height: 100%;
}
.mp-qty-wrap input.qty::-webkit-inner-spin-button,
.mp-qty-wrap input.qty::-webkit-outer-spin-button { -webkit-appearance: none; }
.mp-qty-btn {
  background: #f5f0e8;
  border: none;
  width: 42px;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6f4e37;
  transition: background .15s, color .15s;
  flex-shrink: 0;
  padding: 0;
  user-select: none;
}
.mp-qty-btn:hover { background: #6f4e37; color: #fff; }
@media (max-width: 767px) {
  .mp-qty-wrap  { height: 46px; }
  .mp-qty-btn   { width: 46px; font-size: 24px; }
  .mp-qty-wrap input.qty { width: 56px !important; font-size: 1.05em; }
}

/* ==========================================================================
   Notificación "Agregaste al carrito"
   ========================================================================== */

.mp-notif {
  position: fixed;
  top: -100%;
  right: 16px;
  z-index: 99999;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 10px;
  border-top: 4px solid #ff0000;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  transition: top .28s ease;
  pointer-events: none;
}
.mp-notif--visible { top: 76px; pointer-events: auto; }
.mp-notif__inner { padding: 16px 18px 18px; }
.mp-notif__close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; font-size: 16px;
  cursor: pointer; color: #999; line-height: 1; padding: 2px 4px;
}
.mp-notif__check {
  width: 34px; height: 34px; border-radius: 50%;
  background: #ff0000; color: #fff;
  font-size: 17px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.mp-notif__msg  { font-size: .94em; margin: 0 0 3px; }
.mp-notif__sub  { font-size: .85em; color: #666; margin: 0 0 12px; }
.mp-notif__btns { display: flex; gap: 8px; margin-top: 14px; }
.mp-notif__btn  {
  flex: 1; text-align: center; padding: 10px 6px;
  border-radius: 5px; font-size: .84em; font-weight: 700;
  cursor: pointer; text-decoration: none !important;
  border: none; display: block; transition: background .15s;
}
.mp-notif__btn--cont { background: #f5f0e8; color: #6f4e37; }
.mp-notif__btn--cont:hover { background: #e8ddd0; }
.mp-notif__btn--go   { background: #ff0000; color: #fff !important; }
.mp-notif__btn--go:hover { background: #cc0000; }

@media (max-width: 767px) {
  .mp-notif { right: 8px; width: calc(100vw - 16px); }
  .mp-notif--visible { top: 62px; }
}

/* ==========================================================================
   Barra de progreso — mínimo de compra
   ========================================================================== */

.mp-progreso {
  background: var(--mp-arena);
  border-radius: 6px;
  padding: 11px 14px 13px;
  margin: 10px 0 0;
}
.mp-progreso__msg {
  font-size: .86em;
  margin: 0 0 8px;
  color: #4a3820;
  line-height: 1.4;
}
.mp-progreso__msg--ok { color: #1a5c38; font-weight: 600; }
.mp-progreso__track {
  background: #ddd4c6;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.mp-progreso__bar {
  height: 100%;
  background: #ff0000;
  border-radius: 99px;
  transition: width .4s ease;
  min-width: 4px;
}
.mp-progreso__bar--ok { background: #27ae60; }

/* en página de carrito */
.mp-progreso-wrap {
  margin-bottom: 20px;
}
.mp-progreso-wrap .mp-progreso {
  border: 1px solid var(--mp-borde);
  padding: 14px 18px 16px;
}

/* ==========================================================================
   GLOBAL: Azul → Rojo — solo elementos que eran azul (no afecta títulos ni Elementor)
   ========================================================================== */

/* — Títulos de productos en la grilla: siempre oscuros, no heredan rojo — */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product h3,
.woocommerce ul.products li.product a .woocommerce-loop-product__title { color: #1a1208 !important; }

/* — Breadcrumbs — */
nav.woocommerce-breadcrumb a,
.woocommerce-breadcrumb a,
.ast-breadcrumbs a { color: #ff0000; }
nav.woocommerce-breadcrumb a:hover,
.ast-breadcrumbs a:hover { color: #cc0000; }

/* — Hamburguesa mobile + botón cerrar (≡ y ✕) — */
/* color para SVG que usa fill:currentColor */
.menu-toggle,
button.menu-toggle,
.ast-mobile-menu-toggle,
.main-header-menu-toggle { color: #ff0000 !important; }
/* barras CSS (Astra sin HFB) */
.ast-header-break-point .menu-toggle .menu-toggle-icon,
.ast-header-break-point .menu-toggle .menu-toggle-icon::before,
.ast-header-break-point .menu-toggle .menu-toggle-icon::after { background: #ff0000 !important; }
/* fill directo en SVG / path (Astra HFB) */
.menu-toggle svg,
.menu-toggle svg path,
.ast-mobile-menu-toggle svg,
.ast-mobile-menu-toggle svg path,
.main-header-menu-toggle svg,
.main-header-menu-toggle svg path { fill: #ff0000 !important; }
/* botón cerrar dentro del popup */
.ast-popup-header-area .menu-toggle svg,
.ast-popup-header-area .menu-toggle svg path,
#ast-mobile-popup .menu-toggle svg,
#ast-mobile-popup .menu-toggle svg path { fill: #ff0000 !important; }

/* — Tabs de producto (Descripción / Info adicional / Valoraciones) — */
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: #ff0000 !important; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
  border-top-color:   #ff0000 !important;
  border-left-color:  #ff0000 !important;
  border-right-color: #ff0000 !important;
}
.woocommerce div.product .woocommerce-tabs ul.tabs::before { border-bottom-color: #ff0000 !important; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover { color: #cc0000 !important; }

/* — Notices WooCommerce (borde + ícono + links internos) — */
.woocommerce-info  { border-top-color: #ff0000 !important; }
.woocommerce-info::before  { color: #ff0000 !important; }
.woocommerce-message { border-top-color: #ff0000 !important; }
.woocommerce-message::before { color: #ff0000 !important; }
.woocommerce-info a,
.woocommerce-message a,
.woocommerce-notices-wrapper a { color: #ff0000 !important; }

/* — Paginación — */
.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li a:focus,
.woocommerce nav.woocommerce-pagination ul li span.current {
  background: #ff0000 !important;
  border-color: #ff0000 !important;
  color: #fff !important;
}

/* — Focus en formularios (login, registro, checkout) — */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  border-color: #ff0000 !important;
  box-shadow: 0 0 0 2px rgba(255,0,0,0.15) !important;
  outline-color: #ff0000 !important;
}

/* — Mi Cuenta — */
.woocommerce-account .woocommerce-MyAccount-navigation-link.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation a:hover { color: #ff0000 !important; }

/* ==========================================================================
   Marrón → Rojo: elementos Maderplast
   ========================================================================== */

/* Ícono cerradura y texto "Precio mayorista" */
.maderplast-precio-oculto svg { fill: currentColor; }
a.maderplast-precio-oculto,
a.maderplast-precio-oculto:visited { color: #ff0000 !important; }
a.maderplast-precio-oculto:hover  { color: #cc0000 !important; }

/* Badge AGOTADO — desktop (mobile cubierto en inline CSS) */
.woocommerce .stock.out-of-stock,
.ast-shop-product-out-of-stock {
  background: #ff0000 !important;
  color: #fff !important;
}

/* Cabecera botones del header mp-hdr-icon: hover ya es rojo, estado normal queda marrón por diseño */

/* Ocultar botón "Leer más" en productos agotados (refuerzo CSS sobre el filtro PHP) */
.woocommerce ul.products li.product.outofstock a.button,
.woocommerce ul.products li.product.outofstock .button { display: none !important; }

/* ==========================================================================
   Sin categorizar: ocultar en breadcrumbs, widgets y meta de producto
   ========================================================================== */

nav.woocommerce-breadcrumb a[href*="uncategorized"],
nav.woocommerce-breadcrumb a[href*="sin-categorizar"],
.ast-breadcrumbs a[href*="uncategorized"],
.ast-breadcrumbs a[href*="sin-categorizar"],
/* Categoría en widgets de sidebar */
.product-categories .product-cat-item.product-cat-uncategorized,
.widget_product_categories .cat-item-uncategorized,
/* Archives/grillas */
.product_cat-uncategorized { display: none !important; }

/* ==========================================================================
   Íconos móviles fijos (#mp-mob-icons)
   ========================================================================== */
#mp-mob-icons { display: none; }

@media (max-width: 920px) {
  #mp-mob-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    position: fixed;
    top: 9px;
    right: 120px;
    z-index: 99999;
  }
  #mp-mob-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    text-decoration: none;
    position: relative;
  }
  #mp-mob-icons svg {
    width: 22px;
    height: 22px;
    fill: #ff0000;
  }
  .mp-cart-count {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    background: #ff0000;
    color: #fff;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    padding: 0 2px;
    box-sizing: border-box;
  }
  .mp-cart-count--has {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
