/* ===============================================
   PÁGINA DE INICIO - RESPONSIVE Y LIMPIA
   =============================================== */

/* Ocultar título "Inicio" en la página de inicio */
.home .entry-header,
.home .page-title,
.home .entry-title,
.home .woocommerce-breadcrumb,
.page-id-60 .entry-header,
.page-id-60 .page-title,
.page-id-60 .entry-title,
.page-id-60 .woocommerce-breadcrumb {
    display: none !important;
}

/* Ajustar padding superior cuando no hay título */
.home .site-content,
.page-id-60 .site-content {
    padding-top: 20px !important;
}

/* ===============================================
   GRID DE CATEGORÍAS RESPONSIVE
   =============================================== */

/* Contenedor de categorías */
.bnanotech-categories-grid,
.product-categories {
    display: grid !important;
    gap: 20px !important;
    margin: 0 auto !important;
    padding: 0 15px !important;
}

/* Desktop XL (5 columnas) - pantallas muy grandes */
@media (min-width: 1400px) {
    .bnanotech-categories-grid,
    .product-categories {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

/* Desktop Large (4 columnas) - pantallas grandes */
@media (min-width: 1200px) and (max-width: 1399px) {
    .bnanotech-categories-grid,
    .product-categories {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Desktop (3 columnas) - pantallas medianas */
@media (min-width: 992px) and (max-width: 1199px) {
    .bnanotech-categories-grid,
    .product-categories {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Tablet (2 columnas) */
@media (min-width: 768px) and (max-width: 991px) {
    .bnanotech-categories-grid,
    .product-categories {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* Tablet pequeña (2 columnas) */
@media (min-width: 576px) and (max-width: 767px) {
    .bnanotech-categories-grid,
    .product-categories {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

/* Móvil (1 columna) */
@media (max-width: 575px) {
    .bnanotech-categories-grid,
    .product-categories {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
}

/* ===============================================
   PRODUCTOS DESTACADOS RESPONSIVE
   =============================================== */

/* Grid de productos */
.products,
ul.products {
    display: grid !important;
    gap: 20px !important;
    margin: 0 auto !important;
    padding: 0 15px !important;
}

/* Desktop XL (5 productos) */
@media (min-width: 1400px) {
    .products,
    ul.products {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

/* Desktop Large (4 productos) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .products,
    ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Desktop (3 productos) */
@media (min-width: 992px) and (max-width: 1199px) {
    .products,
    ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Tablet (2 productos) */
@media (min-width: 768px) and (max-width: 991px) {
    .products,
    ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* Tablet pequeña (2 productos) */
@media (min-width: 576px) and (max-width: 767px) {
    .products,
    ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

/* Móvil (1 producto) */
@media (max-width: 575px) {
    .products,
    ul.products {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
}

/* Asegurar que los productos se adapten al grid */
.products li.product,
ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

/* ===============================================
   TARJETAS DE CATEGORÍA RESPONSIVE
   =============================================== */

.category-card,
.product-category {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 200px !important;
}

/* Imagen de categoría responsive */
.category-card img,
.product-category img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    aspect-ratio: 1 / 1 !important;
}

/* Texto de categoría responsive */
.category-card h3,
.product-category h2,
.category-card .category-name {
    font-size: clamp(14px, 2vw, 18px) !important;
    line-height: 1.3 !important;
}

.category-card .category-count,
.product-category .count {
    font-size: clamp(12px, 1.5vw, 14px) !important;
}

/* ===============================================
   TÍTULOS DE SECCIÓN RESPONSIVE
   =============================================== */

.home h2,
.home .section-title {
    font-size: clamp(24px, 4vw, 36px) !important;
    text-align: center !important;
    margin: 30px 0 20px !important;
}

/* ===============================================
   ESPACIADO GENERAL
   =============================================== */

.home .site-main > *:not(:last-child) {
    margin-bottom: 40px !important;
}

/* Responsive para móvil */
@media (max-width: 767px) {
    .home .site-main > *:not(:last-child) {
        margin-bottom: 30px !important;
    }

    .home h2,
    .home .section-title {
        margin: 20px 0 15px !important;
    }
}

/* ===============================================
   FIX PARA FLOAT CLÁSICO DE WOOCOMMERCE
   =============================================== */

/* Limpiar floats antiguos */
.products::before,
.products::after,
ul.products::before,
ul.products::after {
    content: none !important;
    display: none !important;
}

.products,
ul.products {
    clear: both !important;
}

/* Asegurar que no haya ancho fijo en columnas */
.columns-1 ul.products li.product,
.columns-2 ul.products li.product,
.columns-3 ul.products li.product,
.columns-4 ul.products li.product,
.columns-5 ul.products li.product,
.columns-6 ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
}

/* ===============================================
   CATEGORÍAS EN UNA SOLA LÍNEA - RESPONSIVE
   =============================================== */

.bnanotech-categories-grid {
    display: grid !important;
    gap: 20px !important;
    margin: 30px auto !important;
    padding: 0 15px !important;
}

/* Desktop XL (>1400px) - 5 categorías */
@media (min-width: 1400px) {
    .bnanotech-categories-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
    .bnanotech-categories-grid .category-card:nth-child(n+6) {
        display: none !important;
    }
}

/* Desktop L (1200-1399px) - 4 categorías */
@media (min-width: 1200px) and (max-width: 1399px) {
    .bnanotech-categories-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    .bnanotech-categories-grid .category-card:nth-child(n+5) {
        display: none !important;
    }
}

/* Desktop (992-1199px) - 4 categorías */
@media (min-width: 992px) and (max-width: 1199px) {
    .bnanotech-categories-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    .bnanotech-categories-grid .category-card:nth-child(n+5) {
        display: none !important;
    }
}

/* Tablet (768-991px) - 3 categorías */
@media (min-width: 768px) and (max-width: 991px) {
    .bnanotech-categories-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
    }
    .bnanotech-categories-grid .category-card:nth-child(n+4) {
        display: none !important;
    }
}

/* Tablet pequeña (576-767px) - 2 categorías */
@media (min-width: 576px) and (max-width: 767px) {
    .bnanotech-categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .bnanotech-categories-grid .category-card:nth-child(n+3) {
        display: none !important;
    }
}

/* Móvil (<576px) - 2 categorías */
@media (max-width: 575px) {
    .bnanotech-categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .bnanotech-categories-grid .category-card:nth-child(n+3) {
        display: none !important;
    }
}

/* ===============================================
   OCULTAR CARRITO DEL HEADER PRINCIPAL
   =============================================== */

/* Ocultar el carrito que está en el header principal */
.site-header-cart,
.site-header .site-header-cart,
.header-cart,
.shoptimizer-cart {
    display: none !important;
}

/* Asegurar que no haya espacio vacío */
.site-header .col-full {
    justify-content: flex-start !important;
}