:root {
    --primary-color: #002157;
    --secondary-color: #FCBB01;
}

/* Body */
body {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #888;
    line-height: 1.6;
    /* Added for better readability */
}

/*Hero image section*/
.hero-section {
    height: 400px;
}

.hero-bg {
    background-image: linear-gradient(to right, rgba(0, 33, 87, 0.9), rgba(0, 33, 87, 0.6), rgba(0, 33, 87, 0.2)),
        url('https://public.readdy.ai/ai/img_res/614887023826658693789fbb17f9077d.jpg');
    background-size: cover;
    background-position: center;
    width: auto;
    padding-top: 30px;
}

/* Product View Options (List/Grid Buttons) */
.product-view-options {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 20px 20px 20px 0;
    /* Adjusted margin */
    gap: 10px;
    /* Added gap between buttons */
}

.product-view-options button {
    color: #000;
    padding: 10px 20px;
    /* Adjusted padding */
    font-size: 14px;
    text-transform: capitalize;
    font-weight: 500;
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
    /* Added subtle border */
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    /* Added transitions */
    /* Removed unnecessary properties: position, display, margin-top */
}

.product-view-options button:hover {
    background-color: #f0f0f0;
    /* Subtle hover effect */
    border-color: #ccc;
}

.product-view-options button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    /* Match border */
}

/* Main Layout */
.main-container {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping on smaller screens if needed */
    align-items: flex-start;
    gap: 20px;
    /* Added gap between filter and products */
    padding: 0 20px;
    margin-bottom: 50px;
    /* Added horizontal padding */
}

/*Catalogue*/
.catalogue-button {
    padding: 10px;
    font-size: 14px;
    text-transform: capitalize;
    font-weight: 500;
    background-color: var(--primary-color);
    border-radius: 5px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-top: 10px;
    /* Ensure space above button */
    align-self: center;
    /* Center button in grid card */
    width: 220px;
    height: 60px;
    margin-bottom: 10px;
}

.catalogue-button a {
    text-decoration: none;
    text-align: left;
    color: #fff;
}

.catalogue-button:hover {
    background-color: var(--secondary-color);
}

.catalogue-button a:hover {
    color: #000;
}

/* Filter Area */
.filter-area {
    width: 250px;
    padding: 20px;
    background: transparent;
    /* border-right: 1px solid #ddd; */
    /* Consider removing if gap is used */
    box-sizing: border-box;
    flex-shrink: 0;
    /* Prevent shrinking */
    /* Removed height/min-height, let content define height */
}

.category-filter {
    margin-top: 60px;
}

.catalogue-title,
.filter-by-categories,
.filter-by-product-name {
    font-size: 18px;
    /* Slightly smaller */
    font-family: 'Poppins', sans-serif;
    /* Consistent font */
    font-weight: 600;
    /* Bolder */
    color: var(--primary-color);
    margin: 20px 0 10px 0;
    /* Adjusted margin */
}

.search-product-name {
    /* Target the input specifically */
    margin-top: 10px;
    width: 210px;
    padding: 8px 10px;
    /* Added padding */
    border: 1px solid #ccc;
    /* Added border */
    border-radius: 4px;
    box-sizing: border-box;
}

.categories {
    padding: 0;
    margin: 10px 0;
    list-style: none;
    /* Remove default list styling */
}

.category-item {
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 8px;
    /* Slightly reduced margin */
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid transparent;
    /* For consistent spacing */
}

.category-item:hover {
    color: #000;
}

.category-item.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    /* Removed unnecessary properties */
}

.category-arrow {
    margin-left: 150px;
}

/* Product Display Section */
.product-container {
    flex: 1;
    /* Allow container to grow */
    padding: 0;
    /* Remove padding, handled by main-container/gap */
    min-width: 0;
    /* Prevent overflow issues in flex */
}

/* Grid View */
.product-container:not(.list) {
    /* Target grid view specifically */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 2fr));
    /* Responsive grid */
    gap: 20px;
    align-items: stretch;
    /* Ensure cards fill height */
}

.productsCard {
    background: #fff;
    border-radius: 10px;
    /* Slightly softer radius */
    box-shadow: 0px -4px 6px rgba(0, 0, 0, 0.10),
        0px 4px 6px rgba(0, 0, 0, 0.1),
        0px 10px 15px rgba(0, 0, 0, 0.1),
        0px 20px 15px rgba(0, 0, 0, 0.05);
    padding: 20px;
    /* Increased padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    /* Push button to bottom */
    text-align: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    /* Added transform transition */
    overflow: hidden;
    /* Prevent content overflow */
}

.productsCard:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    /* Enhanced hover shadow */
    transform: translateY(-5px);
    /* Slight lift effect */
}

.productImage {
    height: 200px;
    /* Or your desired height */
    object-fit: contain;
    border-radius: 5px;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    /* Add this */
    margin-right: auto;
    /* Add this */
}

.product-title {
    color: var(--primary-color);
    min-height: 4.2em;
    /* Approx 3 lines based on 1.4 line-height */
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1.4;
    /* Control line height */
}

.product-description {
    display: none;
    /* Hidden in grid view */
}

.more-detail-button {
    color: #fff;
    padding: 10px 20px;
    font-size: 14px;
    text-transform: capitalize;
    font-weight: 500;
    background-color: var(--primary-color);
    border-radius: 4px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-top: 10px;
    /* Ensure space above button */
    align-self: center;
    /* Center button in grid card */
    width: 200px;
    height: 40px;
}

.more-detail-button:hover,
.details-btn:hover {
    /* Combined selector for consistency */
    color: #000;
    background-color: var(--secondary-color);
}

/* List View */
.product-container.list {
    display: block;
    /* Override grid display */
}

.product-container.list .productsCard {
    flex-direction: row;
    /* Items side-by-side */
    align-items: center;
    text-align: left;
    margin-bottom: 20px;
    padding: 20px;
    justify-content: flex-start;
    /* Align items to start */
    transform: none;
    /* Disable hover transform in list view */
}

.product-container.list .productsCard:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    /* Consistent hover shadow */
    /* No transform */
}


.product-container.list .productImage {
    height: 200px;
    /* Smaller image for list */
    width: 200px;
    margin-right: 20px;
    margin-bottom: 0;
    /* Remove bottom margin */
    flex-shrink: 0;
    /* Prevent shrinking */
}

.product-container.list .product-infor {
    flex: 1;
    /* Take remaining space */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    /* Align text left */
    min-width: 0;
    /* Prevent overflow */
}

.product-container.list .product-title {
    min-height: auto;
    /* Remove min-height */
    margin-bottom: 5px;
    font-size: 1.3rem;
    /* Slightly larger title in list */
}

.product-container.list .product-description {
    display: block;
    /* Show description */
    color: #555;
    font-weight: 400;
    font-size: 1.0rem;
    /* Slightly smaller description */
    margin-bottom: 15px;
    line-height: 1.5;
    /* Optional: Limit lines shown */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* Show max 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: justify;
    min-height: auto;
    /* Remove min-height */
}

.product-container.list .more-detail-button {
    margin-top: 0;
    /* Remove top margin */
    align-self: flex-start;
    /* Align button left */
}

/* ================================== */
/*          Responsive Design         */
/* ================================== */

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    .filter-area {
        width: 200px;
        /* Slightly smaller filter */
    }

    .product-container:not(.list) {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        /* Adjust min card width */
    }

    .catalogue-button,
    .search-product-name {
        width: 154px;
    }

}


/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    .main-container {
        flex-direction: column;
        /* Stack filter and products */
        padding: 0 15px;
        /* Adjust padding */
        margin-bottom: 20px;
    }

    .filter-area {
        width: 100%;
        /* Full width filter */
        margin-bottom: 20px;
        /* Add space below filter */
        padding: 15px;
        /* border-right: none; */
        /* Remove border if it was enabled */
        /* border-bottom: 1px solid #ddd; */
        /* Optional: add bottom border */
    }

    .catalogue-button {
        width: 100%;
        max-width: 220px;
        height: 60px;
        padding: 8px;
        font-size: 12px;
    }

    .catalogue-button a {
        font-size: 1.0rem;
    }

    .category-item {
        max-width: 220px;
    }

    .search-product-name {
        width: 220px;
    }

    .product-container {
        width: 100%;
        /* Ensure product container takes full width */
    }

    .product-container:not(.list) {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        /* Further adjust min card width */
        gap: 15px;
    }

    .product-view-options {
        justify-content: center;
        /* Center view options */
        margin: 0 0 20px 0;
    }

    /* List view adjustments for small screens */
    .product-container.list .productsCard {
        flex-direction: column;
        /* Stack image and info */
        align-items: center;
        /* Center items */
        text-align: center;
        padding: 15px;
    }

    .product-container.list .productImage {
        height: 150px;
        /* Adjust image size */
        width: 150px;
        margin-right: 0;
        /* Remove right margin */
        margin-bottom: 15px;
        /* Add bottom margin */
    }

    .product-container.list .product-infor {
        align-items: center;
        /* Center text */
        width: 100%;
        /* Ensure info takes full width */
    }

    .product-container.list .product-title {
        font-size: 1.1em;
    }

    .product-container.list .product-description {
        font-size: 0.9em;
        -webkit-line-clamp: 2;
        /* Show fewer lines */
        text-align: center;
    }

    .product-container.list .more-detail-button {
        align-self: center;
        /* Center button */
    }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {


    .product-view-options {
        display: none;
    }

    .product-container:not(.list) {
        /* Switch to single column */
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .productsCard {
        padding: 15px;
        /* Reduce card padding */
    }

    .productImage {
        height: 160px;
        /* Adjust grid image height */
    }

    .product-title {
        font-size: 1em;
        min-height: auto;
        /* Remove min-height */
    }

    .more-detail-button {
        font-size: 13px;
        padding: 8px 16px;
    }

    .product-view-options button {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Further list view adjustments if needed */
    .product-container.list .productImage {
        height: 120px;
        width: 120px;
    }

}