/* ==========================================================================
   Estilos de la Página de Catálogo (Uso de Variables Existentes)
   ========================================================================== */

/* Cabecera del Catálogo */
.catalog-header {
    background-color: var(--bg-light);
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.catalog-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--bg-dark);
    margin-bottom: 10px;
    letter-spacing: -0.025em;
}

.catalog-header p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Área Principal de Contenido */
.catalog-main {
    padding: 40px 0 60px 0;
    background-color: var(--bg-white);
}

/* Rejilla de Productos (Enfoque Mobile-First por defecto) */
.products-extended-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Ficha del Producto del Catálogo */
.catalog-item {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    /* overflow: hidden; */
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.catalog-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Badge de Oferta */
.item-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: var(--accent-badge);
    color: var(--bg-white);
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 4px;
    z-index: 5;
    text-transform: uppercase;
}

/* Contenedor de Imagen */
.item-image {
    background-color: #f3f4f6;
    aspect-ratio: 4 / 3;
    width: 100%;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Cuerpo de la Información */
.item-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.item-body h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bg-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.item-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.5;
    flex-grow: 1;
}

/* Área de Precios */
.item-meta {
    margin-bottom: 15px;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
}

.item-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-now {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--bg-dark);
}

.price-before {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* Bloque de Acciones / Botones */
.item-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Botón Ver Detalles (Ficha Específica) */
.btn-view {
    background-color: var(--bg-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    width: 100%;
    padding: 10px;
    font-size: 0.9rem;
}

.btn-view:hover {
    background-color: var(--border-color);
}

/* Botón Comprar WhatsApp Directo */
.btn-wa-buy {
    background-color: var(--whatsapp-color);
    color: var(--bg-white);
    width: 100%;
    padding: 10px;
    font-size: 0.9rem;
}

.btn-wa-buy:hover {
    background-color: var(--whatsapp-hover);
}

/* Estilo para marcar la sección activa en el menú */
.main-nav a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* ==========================================================================
   Media Queries para Interfaces de Tableta y Escritorio
   ========================================================================== */
@media (min-width: 600px) {
    .products-extended-grid {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .catalog-item {
        width: calc(50% - 13px); /* Distribución en 2 columnas para pantallas medianas */
    }
}

@media (min-width: 992px) {
    .catalog-header {
        padding: 60px 0;
    }

    .catalog-header h1 {
        font-size: 2.5rem;
    }

    .catalog-item {
        width: calc(33.333% - 17px); /* Distribución en 3 columnas puras para escritorio */
    }
    
    .item-actions {
        flex-direction: row;
    }
    
    .btn-view {
        width: 40%;
    }
    
    .btn-wa-buy {
        width: 60%;
    }
}