/* Products Page Listing (1440px baseline) */

.products-page-section {
    width: 100%;
    background-color: #FFFFFF;
    position: relative;
    /* We precisely position elements from the top of this section */
    /* Assuming section starts at 0px from top (layout wrapper) */
    padding-top: 0; 
    padding-bottom: 6.944vw;
}

.products-page-container {
    padding-left: 1.527vw; /* 22px / 1440 */
    padding-right: 1.527vw;
    width: 100%;
    position: relative;
}

/* MAIN PAGE TITLE (Figma: 230px from top) */
.products-page-title {
    font-family: 'Open Sans', sans-serif !important;
    font-size: calc((62 / 1440) * 100vw) !important;
    font-weight: 400 !important;
    color: #000;
    line-height: normal;
    margin: 0;
    padding: 0;
    padding-top: calc((230 / 1440) * 100vw); /* EXACT 230px OFFSET */
    text-transform: uppercase;
}

/* DIVIDER LINE (Figma: 1396 x 1 at 335px Top) */
.products-divider {
    width: 96.944vw; /* 1396px / 1440 */
    height: 1px;
    background-color: #EEEEEE;
    /* 335 - 230 = 105px from the Top of Title */
    /* But since Title has its own height (62px), we use absolute math */
    margin-top: calc((43 / 1440) * 100vw); 
    /* 105 (total gap) - 62 (font size approx) = 43px margin */
    margin-bottom: 0;
}

/* FILTERS BOXES (Figma: 357px Absolute Top) */
.products-filters-row {
    display: flex;
    gap: 12px;
    /* 357 - 335 (Line) - 1 (LineHeight) = 21px Gap */
    margin-top: calc((21 / 1440) * 100vw);
    margin-bottom: calc((80 / 1440) * 100vw);
}

.filter-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background-color: #F8F8F8;
    border-radius: 4px;
    border: 1px solid #EEEEEE;
    width: calc((223 / 1440) * 100vw);
    height: calc((40 / 1440) * 100vw);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-box span {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #000;
}

.filter-checkbox-wrap {
    position: relative; width: calc((20 / 1440) * 100vw); height: calc((20 / 1440) * 100vw);
}

.filter-checkbox-wrap input[type="checkbox"] {
    position: absolute; opacity: 0; cursor: pointer; width: 100%; height: 100%; margin: 0; z-index: 2;
}

.custom-checkbox {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #FFF; border: 1.5px solid #D0D0D0; border-radius: 2px;
    display: flex; align-items: center; justify-content: center; z-index: 1;
}
.custom-checkbox img { width: 70%; height: auto; opacity: 0; transition: opacity 0.2s ease; }
.filter-box input[type="checkbox"]:checked + .custom-checkbox { border-color: #CC4443; }
.filter-box input[type="checkbox"]:checked + .custom-checkbox img { opacity: 1; }

/* PRODUCT LISTING GRID */
.products-listing-grid { display: flex; flex-direction: column; gap: 20px; }

.product-card-container {
    width: 96.944vw; 
    min-height: calc((340 / 1440) * 100vw);
    border: 1px solid #EEEEEE;
    border-radius: 4px;
    display: flex;
    background-color: #FFF;
    overflow: hidden;
    padding: calc((4 / 1440) * 100vw);
}

.product-card-img-wrap {
    width: calc((571 / 1440) * 100vw) !important;
    height: calc((332 / 1440) * 100vw) !important;
    border-radius: 4px; overflow: hidden; flex-shrink: 0;
}
.product-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.product-card-info { padding-left: calc((129 / 1440) * 100vw); padding-top: calc((20 / 1440) * 100vw); }
.product-card-info h2 { font-family: 'Open Sans', sans-serif !important; font-size: calc((32 / 1440) * 100vw) !important; font-weight: 400 !important; line-height: calc((36 / 1440) * 100vw) !important; letter-spacing: -0.01em !important; color: #000; margin: 0 0 12px 0; }
.product-card-info p { font-family: 'Open Sans', sans-serif !important; font-size: calc((16 / 1440) * 100vw) !important; font-weight: 400 !important; line-height: calc((24 / 1440) * 100vw) !important; color: #2D2D2D; margin: 0 0 24px 0; }

.product-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: calc((40 / 1440) * 100vw); }
.product-badge { background-color: #F5F5F5; color: #000; padding: 4px 12px; font-size: 12px; border-radius: 4px; }
.product-view-link { font-family: 'Open Sans', sans-serif; font-size: 16px; font-weight: 600; color: #CC4443; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.product-view-link::after { content: '→'; font-size: 20px; }

/* RESPONSIVE */
@media (max-width: 991px) {
    .products-page-section {
        padding-top: 75px; /* Further reduced for compact mobile view */
        padding-bottom: 40px;
    }

    .products-page-container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .products-page-title {
        font-size: 28px !important;
        margin-bottom: 30px;
    }

    .products-divider {
        width: 100%;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .products-filters-row {
        flex-wrap: wrap; /* Allow boxes to wrap if they don't fit */
        gap: 10px;
        margin-top: 15px;
        margin-bottom: 40px;
    }

    .filter-box {
        width: calc(50% - 10px); /* 2 per row on mobile */
        min-width: 140px;
        height: 44px; /* Slightly taller for touch */
    }

    .filter-box span { font-size: 14px; }

    .filter-checkbox-wrap {
        width: 22px !important;
        height: 22px !important;
    }

    .custom-checkbox img {
        width: 80% !important;
    }

    .products-listing-grid {
        gap: 30px;
    }

    /* Stack cards vertically on mobile */
    .product-card-container {
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: auto;
        padding-bottom: 20px;
    }

    .product-card-img-wrap {
        width: 100% !important;
        height: 220px !important; /* Fixed height for consistent look */
    }

    .product-card-info {
        padding-left: 15px;
        padding-right: 15px;
        padding-top: 20px;
    }

    .product-card-info h2 {
        font-size: 22px !important;
        line-height: 28px !important;
        margin-bottom: 10px;
    }

    .product-card-info p {
        font-size: 14px !important;
        line-height: 20px !important;
        margin-bottom: 20px;
    }

    .product-badges {
        margin-bottom: 25px;
    }

    .product-badge {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .filter-box {
        width: 100%; /* Full width on very small phones */
    }
}
