/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

/* ==========================================================
   Filtros móviles (Catálogo)
   ========================================================== */
.mobile-product-filter {
    display: none;
}

@media (max-width: 999px) {
    .mobile-product-filter {
        display: block;
        margin-bottom: 25px;
    }
    .mobile-filter-button {
        display: block;
        width: 100%;
        padding: 12px 16px;
        cursor: pointer;
    }
    .mobile-filter-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        z-index: 9998;
    }
    .mobile-filter-drawer {
        position: fixed;
        top: 0;
        right: 0;
        width: 80vw;
        max-width: 420px;
        height: 100vh;
        margin: 0;
        padding: 0;
        background: #ffffff;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 9999;
        overflow-y: auto;
    }
    .mobile-filter-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px;
        border-bottom: 1px solid #e5e5e5;
    }
    .mobile-filter-header strong {
        font-size: 20px;
        color: #1a1a1a;
    }
    .mobile-filter-close {
        border: 0;
        background: transparent;
        font-size: 28px;
        line-height: 1;
        cursor: pointer;
        padding: 0;
        color: #1a1a1a;
    }
    .mobile-filter-content {
        padding: 20px;
    }
    body.mobile-filter-open {
        overflow: hidden;
    }
    body.mobile-filter-open .mobile-filter-overlay {
        opacity: 1;
        visibility: visible;
    }
    body.mobile-filter-open .mobile-filter-drawer {
        transform: translateX(0);
    }
    .mobile-filter-drawer .bapf_head h3 {
        color: #1a1a1a;
    }
}

@media (min-width: 1000px) {
    .mobile-product-filter {
        display: none !important;
    }
}


/* ==========================================================
   Ficha Técnica Premium (Textos Oscuros & Gris Claro)
   ========================================================== */
.product-spec-sheet {
  width: 100%;
  font-size: 0.92em;
  line-height: 1.5;
  color: #333333;
}
.product-spec-sheet .lead-desc {
  margin: 0 0 0.8em 0;
  color: #333333;
  line-height: 1.5;
}
.product-spec-sheet .spec-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0.8em 0 1.2em 0;
}
.product-spec-sheet .spec-badge {
  display: inline-flex;
  align-items: center;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 0.82em;
  font-weight: 600;
  color: #222222;
  letter-spacing: 0.2px;
  line-height: 1.2;
}
.product-spec-sheet .spec-title {
  margin: 1.3em 0 0.5em 0;
  font-size: 0.88em;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #1a1a1a;
  font-weight: 700;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 4px;
}
.product-spec-sheet .feature-list {
  margin: 0 0 1em 0;
  padding-left: 1.25em;
  color: #333333;
}
.product-spec-sheet .feature-list li {
  margin: 0 0 0.4em 0;
  padding: 0;
}
.product-spec-sheet .feature-list li:last-child {
  margin-bottom: 0;
}
.product-spec-sheet .feature-list strong {
  color: #1a1a1a;
}
.product-spec-sheet .spec-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0 0 0.9em 0;
  padding: 0;
  font-size: 0.95em;
}
.product-spec-sheet .spec-table tr {
  border: 0;
  margin: 0;
  padding: 0;
}
.product-spec-sheet .spec-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}
.product-spec-sheet .spec-table td {
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #eee;
  line-height: 1.4;
  color: #333333;
  vertical-align: middle;
}
.product-spec-sheet .spec-table tr:first-child td {
  border-top: 1px solid #eee;
}
.product-spec-sheet .spec-table td.label-col {
  width: 38%;
  font-weight: 600;
  color: #1a1a1a;
}
.product-spec-sheet .spec-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 1.2em 0 0.8em 0;
  font-size: 0.85em;
  color: #666666;
}
.product-spec-sheet .spec-trust span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.product-spec-sheet .spec-trust strong {
  color: #1a1a1a;
}
.product-spec-sheet .spec-footer {
  margin-top: 1em;
  border-top: 1px solid #e0e0e0;
  padding-top: 0.7em;
}
.product-spec-sheet .product-sku {
  margin: 0 0 0.35em 0;
  font-size: 0.88em;
  color: #555555;
}
.product-spec-sheet .product-sku strong {
  color: #1a1a1a;
}
.product-spec-sheet .disclaimer {
  font-size: 0.78em;
  line-height: 1.4;
  color: #777777;
  display: block;
  margin: 0;
}

/* Forzar color oscuro en el título principal del producto */
.product_title,
.entry-title,
.single-product .product-title {
    color: #1a1a1a !important;
}

/* Forzar color oscuro en etiquetas y títulos internos de la ficha */
.product-spec-sheet .spec-title,
.product-spec-sheet .spec-table td.label-col,
.product-spec-sheet strong {
    color: #1a1a1a !important;
}


/* ==========================================================
   Ajuste de contraste para el Pie de Página (Footer)
   ========================================================== */
footer, .site-footer, [data-id="footer"] {
    background-color: #000000 !important;
    color: #e5e5e5 !important;
}
footer h1, footer h2, footer h3, footer h4, footer h5, footer h6,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4, .site-footer h5, .site-footer h6,
footer strong, .site-footer strong {
    color: #ffffff !important;
}
footer p, footer span, footer div, footer li,
.site-footer p, .site-footer span, .site-footer div, .site-footer li {
    color: #cccccc !important;
}
footer a, .site-footer a {
    color: #ffffff !important;
    text-decoration: none;
    transition: color 0.2s ease;
}
footer a:hover, .site-footer a:hover {
    color: #25D366 !important;
}
footer svg, .site-footer svg {
    fill: #ffffff !important;
}
/* ==========================================================
   Espaciado lateral para evitar que el contenido toque los bordes
   ========================================================== */
.mi-contenedor-maestro-producto {
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

/* ==========================================================
   Ficha de Producto: Layout Invertido FORZADO + Sticky
   ========================================================== */

@media (min-width: 1000px) {

    /* 1. Forzamos el comportamiento de 2 columnas en el wrapper interno de Blocksy */
    .mi-contenedor-maestro-producto .product-entry-wrapper {
        display: flex !important;
        flex-direction: row-reverse !important; /* Ficha a la izquierda (segundo en HTML), Galería a la derecha (primero en HTML) */
        align-items: flex-start !important;
        gap: 50px !important;
        width: 100% !important;
        max-width: 100% !important; /* Asegura que tome todo el espacio del contenedor */
    }

   /* 2. Columna Ficha Técnica (Izquierda y Sticky - 30% del ancho) */
    .mi-contenedor-maestro-producto .entry-summary {
        width: 30% !important;
        float: none !important;
        margin: 0 !important;
        
        position: sticky !important;
        top: 30px !important;
        height: fit-content !important;
    }

/* 3. Columna Galería (Derecha - 70% del ancho) */
    .mi-contenedor-maestro-producto .custom-stacked-gallery {
        width: 70% !important;
        float: none !important;
        margin: 0 !important;
        
        display: flex !important;
        flex-direction: row !important; /* Cambiamos a fila para ponerlas lado a lado */
        flex-wrap: wrap !important;     /* Permitimos que bajen a la siguiente línea */
        gap: 20px !important;
    }

    /* 4. Estilos de las imágenes (1 principal, el resto en grilla 50/50) */
    
    /* La primera imagen ocupa todo el ancho disponible de su columna */
    .custom-stacked-gallery .custom-gallery-item:first-child {
        width: 100% !important;
        margin: 0 !important;
    }

    /* A partir de la segunda imagen, ocupan la mitad. 
       Usamos calc(50% - 10px) para restar exactamente la mitad del "gap: 20px" 
       y que encajen perfectas en la misma línea sin desbordarse */
    .custom-stacked-gallery .custom-gallery-item:not(:first-child) {
        width: calc(50% - 10px) !important;
        margin: 0 !important;
    }

    .custom-stacked-gallery .custom-gallery-item img {
        width: 100% !important;
        height: auto !important;
        display: block !important;
        border-radius: 4px !important;
    }

/* Ajustes para móviles */
@media (max-width: 999px) {
    .mi-contenedor-maestro-producto .product-entry-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    .custom-stacked-gallery {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 25px;
    }
    .custom-stacked-gallery .custom-gallery-item img {
        width: 100%;
        height: auto;
        display: block;
        border-radius: 4px;
    }
}
