/* General Body & Container */
body {
    background-color: #f5f5f5; /* Light grey background */
    font-family: 'Poppins', sans-serif;
}

.container-fluid {
    padding-top: 20px;
    padding-bottom: 20px;
}

h1 {
    font-weight: 700;
    color: #000;
    margin-bottom: 30px;
}

/* Layout: Sidebar + Product Grid */
.catalog-layout {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    gap: 20px; /* Space between sidebar and main content */
}

.sidebar {
    flex: 0 0 250px; /* Fixed width for sidebar on desktop */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.product-content {
    flex: 1; /* Takes remaining space */
    min-width: 0; /* Important for flex items in some browsers */
}

/* Sidebar Filters */
.filter-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-section h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-section h5::after {
    content: '+'; /* Expand/Collapse indicator */
    font-size: 1.2rem;
    font-weight: bold;
}
.filter-section h5[aria-expanded="true"]::after {
    content: '-';
}


.filter-section .form-check {
    margin-bottom: 8px;
}
.filter-section .form-check-input {
    margin-right: 8px;
}
.filter-section .form-check-label {
    font-size: 0.95rem;
    color: #333;
}
.filter-section .form-control {
    border-radius: 5px;
    border-color: #ddd;
    font-size: 0.9rem;
}
.filter-section .btn-primary, .filter-section .btn-secondary {
    font-size: 0.9rem;
    padding: 8px 12px;
}


/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); /* 4 columns on larger screens */
    gap: 20px;
    /* padding: 20px; */ /* Removed as content has its own padding now */
}

/* Product Card */
.product-card {
    background-color: #fff;
    border: none;
    border-bottom: 1px solid #e0e0e0; /* Subtle bottom border */
    overflow: hidden;
    transition: box-shadow .3s ease-in-out;
    display: flex;
    flex-direction: column;
    position: relative; /* For badge positioning */
    text-decoration: none; /* Remove underline for anchor tag cards */
    color: inherit; /* Inherit text color */
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    /* transform: translateY(-5px); */ /* Removed as Adidas cards don't lift */
}

.product-image-container {
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    position: relative;
    overflow: hidden;
    background-color: #f8f8f8; /* Light background for images */
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05); /* Slight zoom on hover */
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff3333; /* Red for sale */
    color: #fff;
    padding: 5px 8px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 3px;
    z-index: 10;
}

.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrar elementos horizontalmente */
}

.product-category {
    font-size: 0.8rem;
    color: #767677; /* Adidas grey */
    text-transform: uppercase;
    margin-bottom: 5px;
    order: 3; /* Order to appear after name */
}

.product-name {
    font-size: 1rem;
    font-weight: 500; /* Medium weight */
    color: #000;
    margin-bottom: 5px;
    line-height: 1.3;
    order: 2; /* Order to appear after price */
    text-align: center; /* Centrar el nombre del producto */
}

.product-price-wrapper {
    display: flex;
    align-items: baseline;
    margin-bottom: 8px;
    order: 1; /* Order to appear first */
    gap: 8px; /* Espacio entre el precio actual y el anterior */
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #000; /* Darker for Adidas style */
}

.product-old-price {
    font-size: 0.9rem;
    color: #767677;
    text-decoration: line-through;
    font-weight: 400;
}

.product-stock {
    font-size: 0.85rem;
    color: #555;
    margin-top: 5px;
    order: 4; /* Para que aparezca después de la categoría */
}

/* Discount Badge - reutilizando .product-badge pero con color y centrado */
.product-card .discount-badge {
    position: absolute;
    top: 10px;
    left: 50%; /* Centrar horizontalmente */
    transform: translateX(-50%); /* Ajuste para el centrado */
    background-color: #dc3545; /* Rojo de Bootstrap para peligro/descuento */
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .catalog-layout {
        flex-direction: column;
    }
    .sidebar {
        flex: 0 0 auto; /* Sidebar takes full width */
        width: 100%;
        margin-bottom: 20px;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* 2 columns on mobile */
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* 3 columns on tablet */
    }
}