: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;
}

/*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;
    gap: 10px;
}

.product-view-options button {
    color: #000;
    padding: 10px 20px;
    font-size: 14px;
    text-transform: capitalize;
    font-weight: 500;
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

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

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

/* Main Layout */
.main-container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    padding: 0 20px;
    margin-bottom: 50px;
}

/*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;
    align-self: center;
    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;
}

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

.filter-by-categories,
.filter-by-product-name {
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--primary-color);
    margin: 20px 0 10px 0;
}

.search-product-name {
    margin-top: 10px;
    width: 210px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.categories {
    padding: 0;
    margin: 10px 0;
    list-style: none;
}

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

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

.category-item.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

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

/* Product Display Section */
.product-container {
    flex: 1;
    padding: 0;
    min-width: 0;
}

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

.productsCard {
    background: #fff;
    border-radius: 10px;
    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;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.productsCard:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

.productImage {
    height: 200px;
    object-fit: contain;
    border-radius: 5px;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.product-title {
    color: var(--primary-color);
    min-height: 4.2em;
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1.4;
}

.product-description {
    display: none;
}

.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;
    align-self: center;
    width: 200px;
    height: 40px;
}

.more-detail-button:hover,
.details-btn:hover {
    color: #000;
    background-color: var(--secondary-color);
}

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

.product-container.list .productsCard {
    flex-direction: row;
    align-items: center;
    text-align: left;
    margin-bottom: 20px;
    padding: 20px;
    justify-content: flex-start;
    transform: none;
}

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


.product-container.list .productImage {
    height: 200px;
    width: 200px;
    margin-right: 20px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.product-container.list .product-infor {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
}

.product-container.list .product-title {
    min-height: auto;
    margin-bottom: 5px;
    font-size: 1.3rem;
}

.product-container.list .product-description {
    display: block;
    color: #555;
    font-weight: 400;
    font-size: 1.0rem;
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: justify;
    min-height: auto;
}

.product-container.list .more-detail-button {
    margin-top: 0;
    align-self: flex-start;
}

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

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {

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

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

}


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

    .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%;
    }

    .product-container:not(.list) {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

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

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

    .product-container.list .productImage {
        height: 150px;
        width: 150px;
        margin-right: 0;
        margin-bottom: 15px;
    }

    .product-container.list .product-infor {
        align-items: center;
        width: 100%;
    }

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

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

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

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


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

    .product-container:not(.list) {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .productsCard {
        padding: 15px;
    }

    .productImage {
        height: 160px;
    }

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

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

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

    .product-container.list .productImage {
        height: 120px;
        width: 120px;
    }

}