/*
Theme Name: Total Child Theme
Theme URI: https://your-site.com
Description: Your site description. Go to Appearance > Editor to modify this file.
Author: Your Name
Author URI: https://your-site.com
Template: Total
Version: 1.0
*/

/* === NIRA-FIXES-WYN — no borrar. Si se re-sube el mirror, correr
   /root/scripts/wyn-apply-fixes.sh para restaurar. === */

/* 1) Banners categorias (equal-height): estirar para igualar tarjetas */
.vc_row-o-equal-height > .wpb_column:has(.vcex-image-banner) > .vc_column-inner > .wpb_wrapper {
  display: flex; flex-direction: column; height: 100%;
}
.vc_row-o-equal-height > .wpb_column:has(.vcex-image-banner) > .vc_column-inner > .wpb_wrapper > .vcex-module.vcex-image-banner {
  flex-grow: 1;
}
.vc_row-o-equal-height > .wpb_column:has(.vcex-image-banner) > .vc_column-inner > .wpb_wrapper > .vcex-spacing {
  flex-shrink: 0;
}

/* 2) Carrusel productos: igualar tarjetas por CSS (el matchHeight JS corre
   antes del lazy-load y descuadra) + boton Pedir presupuesto anclado abajo */
.wpex-carousel-woocommerce-loop .wpex-carousel__stage { display: flex; }
.wpex-carousel-woocommerce-loop .wpex-carousel__item { display: flex; flex: 0 0 auto; height: auto; }
.wpex-carousel-woocommerce-loop .wpex-carousel__item > .product { display: flex; width: 100%; }
.wpex-carousel-woocommerce-loop .product-inner { display: flex; flex-direction: column; width: 100%; }
.wpex-carousel-woocommerce-loop .product-details { flex-grow: 1; }
.products .product .wyn-quote-button { margin-top: auto; }
/* el wrap del sello P (build Windows) rompia la cadena flex: hacerlo transparente */
.products .product .wyn-p-badge-wrap {
  display: flex; flex-direction: column; flex-grow: 1; width: 100%;
}

/* 3) Catalogo sin venta online: ocultar overlay Añadir al carrito / Leer mas */
.wpex-loop-product-add-to-cart,
a.add_to_cart_button { display: none !important; }

/* 4) Submenu 3er nivel (Hamburgueseria) se cortaba: abrir a la izquierda.
   Y fuera la flecha del 2o nivel (la de 'Productos', top-level, se queda) */
#site-navigation .sub-menu .sub-menu { left: auto !important; right: 100% !important; }
#site-navigation .nav-arrow.second-level { display: none !important; }

/* 5) Header sticky inteligente: se oculta al bajar, reaparece al subir */
#site-header-sticky-wrapper { position: sticky; top: 0; z-index: 1100; transition: transform .28s ease; }
#site-header-sticky-wrapper.nira-header-hidden { transform: translateY(-100%); }
#site-header { position: relative !important; }

/* 6) Widget categorias sidebar: SIN flecha y SIN subcategorias desplegadas
   (cliente 30-jul: la flecha y la division no hacen falta) */
.widget_product_categories li.cat-parent > a::before { display: none !important; }
.widget_product_categories .nira-cat-toggle,
.widget_product_categories ul.children { display: none !important; }

/* 7) Resultados del buscador propio (el de WordPress no funciona en estatico) */
.nira-search-results {
  display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 1200;
  background: #fff; border: 1px solid #e2e2e2; border-radius: 4px; margin-top: 4px;
  max-height: 60vh; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  text-align: left;
}
.nira-search-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0; color: #2e2e2e; text-decoration: none; font-size: 14px;
}
.nira-search-item:last-child { border-bottom: 0; }
.nira-search-item:hover { background: #d7fad0; }
.nira-search-item img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 40px; }
.nira-search-empty { padding: 12px; color: #777; font-size: 14px; }
