/* Eliminar el espacio marrón completamente */
html, body {
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    margin: 0;
    padding: 0;
}

/* Corregir el header para páginas de catálogo */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    z-index: 9998;
    transition: all 0.3s ease;
    height: 80px;
}

/* Asegurar que el catalogo-hero no tenga espacio arriba */
.catalogo-hero {
    /* WebP with JPG fallback for better performance */
    background-image: url('../assets/images/catalogohero.jpg'); /* Fallback */
    background-image: -webkit-image-set(
        url('../assets/images/webp/catalogohero.webp') 1x
    );
    background-image: image-set(
        url('../assets/images/webp/catalogohero.webp') 1x
    );
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    color: white;
    text-align: center;
    padding: 8rem 2rem 4rem;
    margin: 0;
    position: relative;
    width: 100%;
    top: 0;
}

/* Overlay de gradiente para mejor legibilidad */
.catalogo-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(35, 60, 48, 0.75) 0%, rgba(212, 184, 149, 0.4) 100%);
    z-index: 1;
}

.catalogo-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #FFFFFF;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
    letter-spacing: 1px;
    margin-top: 0;
    padding-top: 0;
}

.catalogo-hero p {
    font-size: 1.2rem;
    color: #E8F5E8;
    position: relative;
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Asegurar que main no tenga margen superior */
main {
    background: #FFFFFF !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
}

/* Asegurar que catalogo-section tenga fondo blanco */
.catalogo-section {
    background: #FFFFFF !important;
    padding: 4rem 2rem;
    margin: 0;
}

/* Subcategorías Grid */
.subcategorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.subcategoria-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.subcategoria-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.subcategoria-card .img-container {
    height: 200px;
    overflow: hidden;
}

.subcategoria-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.subcategoria-card:hover img {
    transform: scale(1.05);
}

.subcategoria-card h3 {
    padding: 1rem;
    margin: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.subcategoria-card p {
    padding: 0 1rem 1rem;
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* Modal de Subcategorías */
.catalogo-modal-content {
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

#categoria-titulo {
    text-align: center;
    color: var(--primary-color);
    margin: 1rem 0 2rem;
    font-size: 2rem;
}

/* Estilos para las páginas de catálogo */
.catalogo-section {
    background: #FFFFFF !important;
    padding: 4rem 2rem;
    margin: 0;
}

.container {
    background: transparent;
    max-width: 1200px;
    margin: 0 auto;
}

.subcategoria-section {
    background: #FFFFFF;
    margin-bottom: 4rem;
    padding: 2rem 0;
}

.subcategoria-section h2 {
    font-size: 2.5rem;
    color: var(--verde-principal);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.subcategoria-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(135deg, var(--verde-principal), var(--dorado));
    border-radius: 2px;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.producto-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(46, 139, 87, 0.1);
}

.producto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--verde-principal), #2D5A3D);
}

.producto-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.3);
}

.producto-card img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    padding: 1rem;
}

.producto-card h3 {
    font-size: 1.5rem;
    color: var(--verde-principal);
    margin-bottom: 1rem;
    font-weight: 600;
}

.producto-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.precio {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dorado);
    margin-bottom: 1.5rem;
}

.agregar-carrito {
    background: linear-gradient(135deg, var(--verde-principal), #2D5A3D);
    color: white !important;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2);
}

.agregar-carrito:hover {
    background: linear-gradient(135deg, #2D5A3D, var(--verde-principal));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
    color: white !important;
}

/* Responsive */
@media (max-width: 768px) {
    .catalogo-hero {
        padding: 6rem 1rem 3rem !important;
        background-attachment: scroll !important;
    }
    
    .catalogo-hero h1 {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 480px) {
    .catalogo-hero {
        padding: 5rem 1rem 2rem !important;
    }

    .catalogo-hero h1 {
        font-size: 2rem !important;
    }
}

/* Carrusel de imágenes en producto-card */
.producto-image-carousel {
    position: relative;
    width: 100%;
    height: 250px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    border-radius: 15px;
    background: #f8f9fa;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    margin: 0;
    background: transparent;
}

.carousel-container img.active {
    opacity: 1;
    z-index: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(46, 89, 69, 0.8);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: bold;
}

.carousel-btn:hover {
    background: rgba(46, 89, 69, 1);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(46, 89, 69, 0.3);
}

.carousel-indicator.active {
    background: var(--verde-principal);
    border-color: var(--verde-principal);
    width: 12px;
    height: 12px;
}

/* Ajustar el padding de producto-card ya que el carrusel maneja su propio espacio */
.producto-card.has-carousel {
    padding: 2rem 2rem 2rem 2rem;
}

.producto-card.has-carousel .producto-image-carousel {
    margin-left: -2rem;
    margin-right: -2rem;
    margin-top: -2rem;
    margin-bottom: 1.5rem;
    width: calc(100% + 4rem);
    border-radius: 20px 20px 0 0;
}
