/* Ensuring the catalog main container fills the space */
.catalogue-main {
    flex: 1;
}

/* ===== LAYOUT SELECTOR STYLES ===== */
.layout-selector-wrapper {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin-bottom: 2rem !important;
}

.layout-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.layout-btn svg {
    width: 22px;
    height: 22px;
}

.layout-btn:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.layout-btn.layout-btn--active {
    color: #dc2626;
    background: #fef2f2;
}

/* ===== PRODUCTS GRID LAYOUTS ===== */
.products-grid {
    display: grid;
    gap: 1.5rem;
    transition: grid-template-columns 0.25s ease;
}

.products-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.products-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.products-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

/* ===== LIST VIEW STYLES ===== */
.products-list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-list-item {
    display: grid;
    grid-template-columns: 180px 1fr 220px;
    gap: 1.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    align-items: start;
}

.product-list-image {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-list-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-list-info {
    display: flex;
    flex-direction: column;
}

.product-list-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #111827;
}

.product-list-features {
    list-style: none;
    color: #6b7280;
}

.product-list-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-left: 1px solid #e5e7eb;
    padding-left: 1.5rem;
    height: 100%;
}

.product-list-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
}

/* ===== TABLE VIEW STYLES (Wishlist Inspired) ===== */
.catalog-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}

.catalog-table {
    width: 100%;
    border-collapse: collapse;
}

.catalog-table thead th {
    background: #fdfdfd;
    padding: 16px 20px;
    font-weight: 700;
    font-size: 13px;
    color: #374151;
    border-bottom: 2px solid #f3f4f6;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.catalog-table-row {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.catalog-table-row:hover {
    background-color: #fafbfc;
}

.catalog-table td {
    padding: 20px;
    vertical-align: middle;
}

.catalog-product-image img {
    width: 90px;
    height: 70px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
}

.catalog-product-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.catalog-product-name:hover {
    color: #dc2626;
}

.catalog-product-meta {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stock-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.stock-badge.in-stock {
    background-color: #ecfdf5;
    color: #059669;
}

.stock-badge.out-stock {
    background-color: #fef2f2;
    color: #dc2626;
}

.catalog-price .price-mono {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.btn-add-cart {
    background-color: #dc2626;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-add-cart:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.2);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 1200px) {
    .products-grid--4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .products-grid--4, .products-grid--2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-list-item {
        grid-template-columns: 120px 1fr 180px;
    }
}

@media (max-width: 768px) {
    .products-grid--4, .products-grid--2 {
        grid-template-columns: 1fr;
    }
    .product-list-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .product-list-actions {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #e5e7eb;
        padding-top: 1rem;
    }
    .layout-selector-wrapper {
        flex-wrap: wrap; /* Prevent overlap on very small screens, but keep the space-between logic */
        justify-content: space-between !important;
        gap: 1rem;
    }
}
