/* ==========================================
   ESTILOS DEL CATÁLOGO Y CATEGORÍAS (LINEYES)
   ========================================== */

/* Activa el deslizamiento suave en toda la página */
html {
    scroll-behavior: smooth;
}

/* Desactivar pseudo-elementos de WooCommerce que ocupan celdas en CSS Grid */
ul.products::before,
ul.products::after,
ul.products.columns-3::before,
ul.products.columns-3::after,
ul.products.columns-4::before,
ul.products.columns-4::after {
    content: none !important;
    display: none !important;
}

/* Header y Título del Catálogo */
.woocommerce-products-header {
    text-align: center;
    padding: 40px 20px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.woocommerce-products-header__title,
.page-title {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.woocommerce-products-header__title::after,
.page-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: #7DF9F1;
    margin: 12px auto 0;
    border-radius: 2px;
}

/* ==========================================
   DISEÑO DE SECCIONES Y SUBTÍTULOS POR CATEGORÍA
   ========================================== */

/* Espaciado de seguridad para el menú sticky */
.seccion-catalogo-categoria,
.seccion-accesorios-catalogo {
    scroll-margin-top: 130px;
    margin-bottom: 50px;
}

/* Contenedor del subtítulo */
.contenedor-subtitulo {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 40px auto 25px auto !important;
    padding: 0 20px !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

/* Etiqueta del subtítulo */
.subtitulo-categoria,
.subtitulo-seccion {
    font-family: 'Poppins', 'Montserrat', 'Helvetica Neue', sans-serif !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-block !important;
    position: relative;
    padding: 10px 24px;
    background: linear-gradient(135deg, rgba(125, 249, 241, 0.15) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-left: 5px solid #7DF9F1;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 8px 20px rgba(125, 249, 241, 0.25), 0 2px 6px rgba(0, 0, 0, 0.04);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin: 0 !important;
    text-align: left !important;
}

/* ==========================================
   GRILLA DE PRODUCTOS WOOCOMMERCE
   ========================================== */
ul.products,
.woocommerce .cart-empty ~ .products,
.woocommerce .cart-empty ~ ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 28px !important;
    align-items: start !important;
    max-width: 1200px;
    margin: 20px auto 50px auto !important;
    padding: 0 20px !important;
    list-style: none !important;
    clear: both;
    box-sizing: border-box;
}

/* Tarjeta de Producto */
ul.products li.product,
.woocommerce .cart-empty ~ .products li.product {
    float: none !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    clear: none !important;
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    border: 2px solid #eaeaea;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

ul.products li.product:hover {
    border-color: #7DF9F1 !important;
    box-shadow: 0 8px 25px rgba(125, 249, 241, 0.25) !important;
}

/* Imagen del Producto */
ul.products li.product img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 12px;
    background-color: #fcfcfc;
    margin-bottom: 16px;
    padding: 10px;
}

/* Bloque de Información */
ul.products li.product .woocommerce-loop-product__title {
    font-size: 15px;
    font-weight: 600;
    color: #2c2c2c;
    line-height: 1.4;
    margin: 0 0 4px 12px !important;
    padding-right: 48px;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Precio */
ul.products li.product .price {
    font-size: 17px;
    font-weight: 800 !important;
    color: #00a89d !important;
    letter-spacing: 0.3px;
    text-shadow: 0 0 1px rgba(0, 168, 157, 0.2);
    margin: 0 0 9px 12px !important;
    text-align: left;
    display: block;
}

ul.products li.product .price del {
    color: #a0a0a0;
    font-weight: 500;
    font-size: 13px;
    margin-right: 6px;
    text-shadow: none;
}

ul.products li.product .price ins {
    text-decoration: none;
    color: #00a89d !important;
    font-weight: 800 !important;
}

/* ==========================================
   BOTÓN DE CARRITO EN TARJETAS (CIRCULAR CENTRADO)
   ========================================== */
ul.products li.product .button,
ul.products li.product .button.add_to_cart_button {
    position: absolute !important;
    bottom: 16px !important;
    right: 16px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background-color: #7DF9F1 !important;
    color: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 0 !important;
    line-height: 0 !important;
    box-sizing: border-box !important;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s ease, box-shadow 0.2s ease !important;
}

/* Oculta pseudo-elementos e indicadores por defecto de WooCommerce */
ul.products li.product .button::after,
ul.products li.product .button.add_to_cart_button::after {
    display: none !important;
    content: none !important;
}

/* Icono SVG Perfectamente Centrado */
ul.products li.product .button::before,
ul.products li.product .button.add_to_cart_button::before {
    content: '' !important;
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #1a1a1a !important;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>') no-repeat center / contain !important;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>') no-repeat center / contain !important;
}

ul.products li.product .button:hover,
ul.products li.product .button.add_to_cart_button:hover {
    background-color: #5ef5eb !important;
    transform: scale(1.12) !important;
    box-shadow: 0 6px 16px rgba(125, 249, 241, 0.5) !important;
}

/* ==========================================
   DISEÑO DE PAGINACIÓN
   ========================================== */
.woocommerce-pagination {
    text-align: center;
    margin: 40px 0 60px 0;
}

.woocommerce-pagination ul.page-numbers {
    display: inline-flex !important;
    gap: 8px;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-pagination ul.page-numbers li a,
.woocommerce-pagination ul.page-numbers li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 20px;
    background: #f5f5f5;
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.woocommerce-pagination ul.page-numbers li span.current {
    background: #1a1a1a;
    color: #7DF9F1;
}

.woocommerce-pagination ul.page-numbers li a:hover {
    background: #7DF9F1;
    color: #1a1a1a;
}

/* ==========================================
   RESPONSIVE CATÁLOGO
   ========================================== */
@media screen and (max-width: 992px) {
    ul.products,
    .woocommerce .cart-empty ~ .products,
    .woocommerce .cart-empty ~ ul.products { 
        grid-template-columns: repeat(3, 1fr) !important; 
    }
}

@media screen and (max-width: 768px) {
    ul.products,
    .woocommerce .cart-empty ~ .products,
    .woocommerce .cart-empty ~ ul.products { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 16px !important; 
    }
    
    .subtitulo-categoria,
    .subtitulo-seccion {
        font-size: 17px !important;
        padding: 8px 16px;
        letter-spacing: 1px;
    }
}

@media screen and (max-width: 480px) {
    .contenedor-subtitulo {
        padding: 0 10px !important;
    }

    ul.products,
    .woocommerce .cart-empty ~ .products,
    .woocommerce .cart-empty ~ ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 10px !important;
    }
    
    ul.products li.product {
        padding: 12px;
        border-radius: 12px;
        border-width: 1.5px;
    }

    ul.products li.product .woocommerce-loop-product__title {
        font-size: 13px;
        margin-left: 4px !important;
        padding-right: 36px;
    }
    
    ul.products li.product .price {
        font-size: 15px;
        margin-left: 4px !important;
    }

    ul.products li.product .button,
    ul.products li.product .button.add_to_cart_button {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        bottom: 10px !important;
        right: 10px !important;
    }

    ul.products li.product .button::before,
    ul.products li.product .button.add_to_cart_button::before {
        width: 16px !important;
        height: 16px !important;
    }
}