/* ========================================================================= 
   products.css - Collection / Products Listing Page Styles
   ========================================================================= */

/* ── Page Banner ── */
.page-banner {
    background: linear-gradient(135deg, rgba(15, 50, 40, 0.95) 0%, rgba(31, 111, 95, 0.9) 100%),
        radial-gradient(rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px);
    background-size: cover, 20px 20px;
    color: #fff;
    text-align: center;
    padding: 60px 20px;
    border-radius: 20px;
    margin: 32px 0 40px;
    box-shadow: 0 10px 30px rgba(31, 111, 95, 0.2);
}

.page-banner h1 {
    margin: 0 0 12px;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-banner p {
    margin: 0 auto;
    max-width: 600px;
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.6;
}

.products-page .container {
    max-width: 100%;
    width: 100%;
    padding-left: 2%;
    padding-right: 2%;
}

/* Minimal product cards on products page */
.products-page .products-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.products-page .product-card {
    background: #FFFFFF;
    border: 1px solid rgba(6, 51, 40, 0.503);
    border-radius: 12px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.products-page .product-card .card-image {
    position: relative;
}


.products-page .product-card .card-body {
    padding: 11px;
}

.products-page .product-card .card-name {
    font-size: 1rem;
    margin-bottom: 6px;
}

.products-page .product-card .card-desc {
    font-size: 11px;
    margin-bottom: 8px;

}

.products-page .product-card .card-price {
    gap: 6px;
    margin-bottom: 8px;
}

.products-page .product-card .p-sale {
    font-size: 1.2rem;
}

.products-page .product-card .p-mrp {
    font-size:1rem;
}

.products-page .product-card .qty-row {
    padding: 4px 8px;
    width: 50%;
    margin-bottom: 8px;
}

.products-page .product-card .qty-ctrl button {
    width: 24px;
    height: 24px;
}

.products-page .product-card .qty-ctrl input {
    width: 32px;
    font-size: 13px;
}

.products-page .product-card .btn-cart {
    padding: 9px 0;
    font-size: 12px;
}

.sticky-controls {
    position: sticky;
    width: 100%;
    top: 56px;
    padding-top: 1%;
    z-index: 99;
    background: var(--bg-color);
    transition: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-filter-trigger {
    display: none;
}

.mobile-top-actions {
    display: none;
}

.mobile-filter-overlay {
    display: none;
}

.mobile-filter-drawer {
    display: none;
}

/* Pseudo-element to bleed background upwards and cover any gaps during scroll */
.sticky-controls::before {
    content: '';
    position: absolute;
    top: -20px; /* Reduced from -100px to avoid covering the header/compliance bar */
    left: 0;
    right: 0;
    height: 20px;
    /* background: inherit; */
    z-index: -1;
    pointer-events: none;
}

/* Sidebar Category Options */
.products-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    margin-top: 2%;
    gap: 18px;
    align-items: start;
}

.products-layout > * {
    min-width: 0;
}

.categories-sidebar {
    position: sticky;
    top: 132px;
    border: 1px solid rgba(47, 160, 132, 0.15);
    border-radius: 12px;
    padding: 12px;
}

.categories-sidebar-head {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    margin-bottom: 8px;
}

.category-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}

.category-option i {
    font-size: 12px;
    width: 14px;
    color: #64748b;
}

.category-option:hover {
    border-color: rgba(47, 160, 132, 0.18);
    color: var(--jade-green);
}

.category-option.active {
    color: var(--dark-teal);
    border-color: rgba(47, 160, 132, 0.22);
}

.category-option:hover i,
.category-option.active i {
    color: var(--jade-green);
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 20px;
    border: 1px dashed rgba(47, 160, 132, 0.3);
    color: var(--text-muted);
}

.empty-state i {
    font-size: 56px;
    color: rgba(47, 160, 132, 0.2);
    margin-bottom: 20px;
    display: block;
}

/* ── Collection Toolbar ── */
.collection-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0; /* Tighter padding */
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Custom Dropdown System */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: #fff;
    border: 1px solid rgba(47, 160, 132, 0.2);
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: all .2s;
    font-family: var(--font-body);
}

.dropdown-btn:hover {
    border-color: var(--jade-green);
    color: var(--jade-green);
}

.dropdown-btn i.fa-chevron-down {
    font-size: 10px;
    transition: transform .3s;
}

.dropdown-btn i:not(.fa-chevron-down) {
    font-size: 14px;
    color: var(--jade-green);
}

.custom-dropdown.active .dropdown-btn {
    border-color: var(--jade-green);
    background: #f0fdf4;
}

.custom-dropdown.active .dropdown-btn i {
    transform: rotate(180deg);
}

.dropdown-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 320px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(47, 160, 132, 0.15);
    padding: 24px;
    z-index: 1000;
    display: none;
    animation: popoverFadeIn .25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-dropdown.active .dropdown-popover {
    display: block;
}

/* Price Popover specific */
.popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.popover-header span {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.popover-header .reset-link {
    font-size: 12px;
    color: var(--jade-green);
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popover-header .reset-link:hover {
    text-decoration: underline;
}

.price-range-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.input-pill-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.input-pill {
    width: 100%;
    padding: 12px 12px 12px 28px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    outline: none;
    transition: all .2s;
}

.input-pill:focus {
    border-color: var(--jade-green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(47, 160, 132, 0.1);
}

/* Availability Popover specific */
.avail-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.avail-option:hover {
    background: #f8fafc;
}

.avail-option input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--jade-green);
    margin: 0;
}

.avail-option label {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0;
    flex-grow: 1;
}

.apply-row {
    margin-top: 20px;
    text-align: right;
}

.btn-apply {
    padding: 10px 24px;
    background: var(--dark-teal);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(31, 111, 95, 0.2);
}

.res-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-select {
    padding: 9px 16px;
    border: 1px solid rgba(47, 160, 132, 0.2);
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    background: #fff;
    outline: none;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.filter-select:focus,
.filter-select:hover {
    border-color: var(--jade-green);
}

/* Sort Popover specific overrides */
#sortDropdown .dropdown-popover {
    min-width: 240px;
    right: 0;
    left: auto;
}

.sort-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.sort-option:hover {
    background: #f1f5f9;
}

.sort-option.active {
    background: rgba(47, 160, 132, 0.08);
    color: var(--jade-green);
    font-weight: 700;
}

.sort-option i {
    font-size: 12px;
    opacity: 0;
    margin-left: 10px;
}

.sort-option.active i {
    opacity: 1;
}

.btn-clear {
    font-size: 13px;
    color: var(--jade-green);
    text-decoration: none;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 50px;
    background: rgba(47, 160, 132, 0.1);
    transition: all 0.2s;
}

.btn-clear:hover {
    background: rgba(47, 160, 132, 0.2);
    color: var(--dark-teal);
}

/* Animation Stagger For Grid */
.stagger-fade {
    animation: fadeUpIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes fadeUpIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-top-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
    }

    .mobile-sort-box {
        position: relative;
        flex: 1;
    }

    .mobile-sort-trigger,
    .mobile-filter-trigger {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        border: 1px solid rgba(47, 160, 132, 0.25);
        background: #fff;
        color: var(--text-dark);
        border-radius: 999px;
        padding: 9px 14px;
        font-weight: 700;
        font-size: 12px;
        cursor: pointer;
    }

    .mobile-sort-trigger {
        width: fit-content;
        justify-content: center;
    }

    .mobile-filter-trigger {
        margin-bottom: 0;
    }

    .mobile-sort-menu {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        background: #fff;
        border: 1px solid #dbe3ec;
        border-radius: 10px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        display: none;
        z-index: 10070;
        overflow: hidden;
    }

    .mobile-sort-box.active .mobile-sort-menu {
        display: block;
    }

    .mobile-sort-menu a {
        display: block;
        padding: 10px 12px;
        text-decoration: none;
        color: var(--text-dark);
        font-size: 13px;
        font-weight: 600;
        border-bottom: 1px solid #eef2f7;
    }

    .mobile-sort-menu a:last-child {
        border-bottom: none;
    }

    .mobile-sort-menu a.active {
        color: var(--jade-green);
        background: rgba(47, 160, 132, 0.08);
    }

    .collection-toolbar {
        display: none;
    }

    .mobile-filter-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: all 0.25s ease;
        z-index: 10050;
    }

    .mobile-filter-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-filter-drawer {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.28s ease;
        z-index: 10060;
        max-height: 85vh;
        overflow: auto;
    }

    .mobile-filter-drawer.active {
        transform: translateY(0);
    }

    .mobile-filter-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 1px solid #eef2f7;
    }

    .mobile-filter-head h3 {
        margin: 0;
        font-size: 17px;
    }

    .mobile-filter-head button {
        border: none;
        background: transparent;
        font-size: 20px;
        color: #64748b;
    }

    .mobile-filter-body {
        padding: 14px 16px 16px;
    }

    .mobile-filter-group {
        margin-bottom: 14px;
    }

    .mobile-filter-group > label {
        display: block;
        font-size: 12px;
        font-weight: 700;
        color: #64748b;
        margin-bottom: 8px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .mobile-filter-options {
        display: grid;
        gap: 8px;
    }

    .mobile-filter-options label {
        font-size: 14px;
        color: var(--text-dark);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-price-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .mobile-price-row input,
    .mobile-filter-group select {
        width: 100%;
        border: 1px solid #dbe3ec;
        border-radius: 10px;
        padding: 10px 11px;
        font-family: var(--font-body);
        font-size: 13px;
    }

    .mobile-filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 8px;
    }

    .mobile-clear-btn,
    .mobile-apply-btn {
        text-align: center;
        border-radius: 10px;
        padding: 10px 12px;
        font-size: 13px;
        font-weight: 700;
        text-decoration: none;
        border: 1px solid rgba(47, 160, 132, 0.3);
    }

    .mobile-clear-btn {
        color: var(--dark-teal);
        background: #fff;
    }

    .mobile-apply-btn {
        color: #fff;
        background: var(--dark-teal);
        border-color: var(--dark-teal);
    }
    .page-banner {
        padding: 40px 20px;
        border-radius: 16px;
        margin: 20px 0 24px;
    }

    .page-banner h1 {
        font-size: 28px;
    }

    .collection-toolbar {
        padding: 10px 0;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .collection-toolbar::-webkit-scrollbar {
        display: none;
    }

    .toolbar-left {
        width: auto;
        flex-wrap: nowrap;
        gap: 8px;
        flex: 0 0 auto;
    }

    .toolbar-right {
        width: auto;
        justify-content: flex-start;
        padding-top: 0;
        border-top: none;
        flex: 0 0 auto;
    }

    .custom-dropdown {
        flex: 0 0 auto;
    }

    .dropdown-btn {
        width: 100%;
        justify-content: space-between;
        padding: 10px 14px;
        font-size: 12px;
    }

    .dropdown-popover {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        min-width: 100%;
        border-radius: 24px 24px 0 0;
        padding: 24px 20px;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
        z-index: 10001;
        animation: popoverSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes popoverSlideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    .custom-dropdown.active .dropdown-popover {
        display: block;
    }

    /* Backdrop for fixed popover */
    .custom-dropdown.active::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        z-index: 10000;
    }

    .sticky-controls {
        top: 56px;
        margin-bottom: 16px;
        padding-top: 2%;
    }

    .products-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .categories-sidebar {
        position: static;
        padding: 10px;
    }

    .category-options {
        flex-direction: row;
        flex-wrap: nowrap !important;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -ms-overflow-style: none;
        scrollbar-width: none;
        white-space: nowrap;
        padding-bottom: 2px;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .category-options::-webkit-scrollbar {
        display: none;
    }

    .category-option {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 7px 12px;
        border: 1px solid rgba(47, 160, 132, 0.18);
    }

    .products-page .products-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .products-page .product-card {
        width: 100%;
        min-width: 0;
    }

    .btn-clear {
        width: auto;
        justify-content: center;
        margin-top: 0;
    }

    /* Hide WhatsApp when filter is open */
    body.filter-open .whatsapp-float {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: scale(0.8) translateY(20px);
    }
}

@media (max-width: 992px) {
    .products-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .categories-sidebar {
        position: static;
        padding: 10px;
    }

    .category-options {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: none;
        scrollbar-width: none;
        white-space: nowrap;
        padding-bottom: 2px;
    }

    .category-options::-webkit-scrollbar {
        display: none;
    }

    .category-option {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .products-page .products-wrapper {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 480px) {
    .toolbar-left {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .btn-clear {
        grid-column: span 2;
    }

    .price-range-grid {
        gap: 10px;
    }

    .products-page .products-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}


