@import url("./components/header.css");
@import url("./components/footer.css");

/* =======================
   LAYOUT
======================= */
section .filter-sections {
    padding: 4rem 0;
    background: #efefef;
}

main {
    margin-top: 20px;
    margin-bottom: 50px;
}

.products-hero {
    position: relative;
    min-height: 30vh;              /* balanced height */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    overflow: hidden;
    margin-top: -170px;
}

.products-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* DARK GRADIENT OVERLAY */
.products-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.45) 50%,
        rgba(0, 0, 0, 0.25) 100%
    );
    z-index: 1;
}

/* HERO CONTENT */
.products-hero .container {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 4rem 1rem;
}

.products-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    margin-top: 180px;
}

.products-hero p {
    font-size: 1.15rem;
    opacity: 0.95;
}

/* =======================
   FILTER SIDEBAR
======================= */
.filter-sidebar {
    background: #fff;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    position: sticky;
    top: 2rem;
}

/* Filter header */
.filter-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =======================
   FILTER ACTION BUTTONS
======================= */
.filter-actions {
    display: flex;
    gap: 8px;
}

.btn-apply-filters {
    background: var(--btn-color);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-clear-filters {
    background: #ed1c24;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}

/* =======================
   CATEGORY LIST
======================= */
.filter-sidebar .form-check {
    padding: 5px 0px 5px 13px;
    border-radius: 8px;
    transition: background .3s;
}
.form-check-label{
    cursor: pointer;
}

.filter-sidebar .form-check:hover {
    background: #f8f9ff;
}

.filter-sidebar .form-check-input:checked {
    background-color: var(--btn-color);
    border-color: var(--btn-color);
}

/* =======================
   PRICE FILTER
======================= */
.price-inputs {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
}

.price-inputs input {
    flex: 1;
    padding: .5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.price-inputs input:focus {
    border-color: var(--btn-color);
    outline: none;
}

/* =======================
   JQUERY UI SLIDER
======================= */
.ui-slider {
    height: 6px;
    background: #e0e0e0;
    border-radius: 5px;
}

.ui-slider-range {
    background: var(--btn-color);
}

.ui-slider-handle {
    width: 18px;
    height: 18px;
    top: -6px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--btn-color);
}

/* =======================
   PRODUCT CARD
======================= */
.ingredient-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform .3s ease;
}

.ingredient-card > a:first-child {
    display: block;
    flex-shrink: 0;
}

.product-image-wrapper {
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image-wrapper .ingredient-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
    transition: transform .45s ease;
    display: block;
}

.ingredient-card:hover .ingredient-image {
    transform: scale(1.15);
}

@media (hover: none) {
    .ingredient-card:hover .ingredient-image {
        transform: none;
    }
}

/* =======================
   PRODUCT TITLE / PRICE
======================= */
.ingredient-title {
    font-size: 1.2rem;
    margin: 10px 0 6px;
    padding: 0 14px;
    color: #2c2c2c;
    text-align: center;
}

.ingredient-title:hover {
    color: var(--btn-color);
}

.product-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 0 0 0.85rem;
    padding: 0 14px;
    flex-wrap: wrap;
}

.product-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 0.16rem;
    color: #f2b01e;
    font-size: 0.9rem;
}

.product-rating-count {
    color: #7b8088;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.2;
}

.product-rating-count:empty {
    display: none;
}

.product-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.price-current {
    font-size: 18px;
    font-weight: 700;
    color: #198754;
}

.price-old {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

/* =======================
   ACTION BUTTONS
======================= */
.ingredient-actions {
    margin-top: auto;
    padding: 12px;
    display: flex;
    gap: 10px;
    justify-content: center;
}
.btn-buy-now{
background: #ffffff;
    border: 2px solid var(--btn-color);
    color: var(--btn-color);
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
}
.btn-add-cart,
.btn-select-options {
    background: var(--btn-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .5rem 1.2rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}

.btn-out-of-stock {
    background: #ccc;
    color: #666;
    border-radius: 10px;
    padding: .6rem 1rem;
    cursor: not-allowed;
}

/* =======================
   MOBILE FILTER TOGGLE
======================= */
.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 2px solid #6b8e23;
    background: #fff;
    color: #2c2c2c;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
}

/* FUNNEL ICON */
.filter-icon {
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h18l-7 8v6l-4 2v-8z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h18l-7 8v6l-4 2v-8z'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
}

.filter-toggle.active .filter-icon {
    transform: rotate(180deg);
}

/* =======================
   MOBILE DRAWER
======================= */
@media (max-width: 991px) {

    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        height: 100%;
        z-index: 1050;
        transition: left .3s ease;
        border-radius: 0;
        overflow-y: auto;
    }
    .ingredient-actions {
        display: grid;
    }
    .ingredient-title {
        font-size: 0.9rem !important;
    }
    .product-rating {
        gap: 0.35rem;
        margin-bottom: 0.7rem;
    }
    .product-rating-stars {
        font-size: 0.82rem;
    }
    .product-rating-count {
        font-size: 0.8rem;
    }
    main {
    margin-top: 0px;
    margin-bottom: 0px;
}
    .btn-select-options {
    padding: .7rem 0.6rem;
}
    .filter-sidebar.show {
        left: 0;
    }

    .filter-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        opacity: 0;
        pointer-events: none;
        transition: .3s;
    }

    .filter-overlay.show {
        opacity: 1;
        pointer-events: all;
    }
}
.filter-overlay {
    touch-action: none !important;
}
.filter-sidebar {
    touch-action: pan-y !important;
}
.subcategory-bar{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-bottom:15px;
}

.subcategory-chip{
    padding: 6px 12px;
    border-radius: 20px;
    background: #eee;
    cursor: pointer;
    transition: .2s;
    font-size: 13px;
    border: 1px solid #c3c3c3;
}

.subcategory-chip.active,
.subcategory-chip:hover{
    background:#7dbc44;
    color:#fff;
}
.category-scroll{
    max-height:460px;
    overflow-y:auto;
}

/* =====================================================
   PRODUCT ACTION AREA
===================================================== */

.ingredient-actions{
    padding:14px;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:12px;
}

/* WRAPPER */
.qty-cart-wrapper{
    width:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:10px;
}

/* =====================
   QUANTITY
===================== */

.qty-row{
    display:flex;
    align-items:center;
    border:1px solid #e5e5e5;
    border-radius:6px;
    overflow:hidden;
}

.qty-row button{
    width:30px;
    height:30px;
    border:none;
    background:#046104;
    color:#fff;
    font-size:16px;
    cursor:pointer;
}

.qty-value{
    width:40px;
    text-align:center;
    font-weight:600;
    font-size:14px;
}

/* =====================
   BUTTON ROW
===================== */

.cart-row{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    width:100%;
}

/* BUY NOW */

.btn-buy-now{
    flex:1;
    border:2px solid var(--btn-color);
    background:#fff;
    color:var(--btn-color);
    border-radius:6px;
    padding:7px 10px;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
}

/* ADD CART */

.btn-add-cart{
    width:42px;
    height:36px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--btn-color);
    color:#fff;
    border:none;
    border-radius:6px;
    font-size:16px;
    cursor:pointer;
}

/* WISHLIST */

.btn-wishlist-icon{
    width:32px;
    height:32px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:none;
    border:none;
    font-size:18px;
    color:#d33;
    cursor:pointer;
}

/* OUT OF STOCK */

.btn-out-of-stock {
    background: linear-gradient(135deg, #ff4d4d, #d32f2f);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-weight: bold;
    letter-spacing: 0.5px;
    cursor: not-allowed;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.3);
        font-size: 0.85rem;
}

.btn-out-of-stock:hover {
    background: #c62828; /* darker red on hover */
}
