@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-teal: #14B8A6;
    --primary-teal-hover: #0D9488;
    --accent-orange: #F59E0B;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border-light: #E5E7EB;
    --bg-light: #F9FAFB;
    --white: #FFFFFF;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
}

/* Sidebar Styling */
.sidebar-filter {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    height: 100%;
}

/* Sidebar Responsive Logic: Mobile Drawer */
@media (max-width: 1199px) {
    .sidebar-filter {
        position: fixed;
        left: -320px;
        top: 0;
        bottom: 0;
        width: 300px;
        z-index: 2000;
        background: #fff;
        overflow-y: auto;
        transition: left 0.3s ease;
        padding-top: 60px;
        box-shadow: 10px 0 20px rgba(0, 0, 0, 0.1);
    }

    .sidebar-filter.open {
        left: 0;
    }

    .close-filter-btn {
        position: absolute;
        top: 15px;
        right: 15px;
        font-size: 24px;
        cursor: pointer;
    }
}

@media (min-width: 1200px) {
    .close-filter-btn {
        display: none;
    }
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.filter-header h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.clear-all {
    color: var(--primary-teal);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.sidebar-search {
    position: relative;
    margin-bottom: 30px;
}

.sidebar-search input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid var(--border-light);
    border-radius: 9999px;
    background: var(--bg-light);
    font-size: 0.875rem;
}

.sidebar-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.filter-widget {
    margin-bottom: 30px;
}

.filter-widget h5 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
}

.filter-list li .name {
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.2s;
}

.filter-list li:hover .name,
.filter-list li.active .name {
    color: var(--primary-teal);
}

.filter-list li .count {
    background: #E0F2F1;
    color: var(--primary-teal);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
}

/* Toggle Switch */
.prescription-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #D1D5DB;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary-teal);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-primary);
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 1px;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 4px;
}

.custom-checkbox:hover input~.checkmark {
    border-color: var(--primary-teal);
}

.custom-checkbox input:checked~.checkmark {
    background-color: var(--primary-teal);
    border-color: var(--primary-teal);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Price Range Inputs */
.price-inputs {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    align-items: center;
}

.price-inputs input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.875rem;
    text-align: center;
    background: var(--bg-light);
}

.price-divider {
    color: var(--text-secondary);
}

/* Top Control Custom */
.shop-top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 20px;
}

.search-results-summary {
    font-size: 1rem;
    color: var(--text-secondary);
}

.search-results-summary strong {
    color: var(--text-primary);
}

.sort-dropdown-custom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sort-custom {
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--white);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

#open-sidebar-filter.btn-sort-custom {
    color: var(--text-primary);
}

.search-results-summary {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.search-results-summary strong {
    color: var(--text-primary);
}

.top-bar-flex-container {
    gap: 12px;
}

/* Product Grid Layout */
.tf-grid-layout.tf-col-4 {
    grid-template-columns: repeat(4, 1fr);
    display: grid;
    gap: 20px;
}

@media (max-width: 1199px) {
    .tf-grid-layout.tf-col-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .tf-grid-layout.tf-col-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .search-results-summary {
        font-size: 0.8125rem;
    }

    .btn-sort-custom {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

/* Product Card Customization */
.card-product-custom {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-light);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-product-custom:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-product_wrapper {
    background: #EBF7F7;
    border-radius: 8px;
    position: relative;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1;
}

.custom-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent-orange);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rate_wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.rate_wrap i {
    color: #FBBF24;
    font-size: 0.875rem;
}

.rating-val {
    font-weight: 600;
    font-size: 0.875rem;
}

.rating-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.name-product {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.4;
}

.name-product a {
    color: var(--text-primary);
    text-decoration: none;
}

.product-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.card-bottom {
    margin-top: auto;
}

.price-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.price-new {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.price-old {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.btn-add-cart {
    width: 100%;
    background: var(--primary-teal);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
    cursor: pointer;
}

.btn-add-cart:hover {
    background: var(--primary-teal-hover);
}

/* Breadcrumb Top Bar */
.breadcrumb-top-bar {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
}

@media (max-width: 767px) {
    .breadcrumb-top-bar .row {
        gap: 12px;
    }

    .breadcrumb-top-bar .col-md-3,
    .breadcrumb-top-bar .col-md-6 {
        text-align: left !important;
    }

    .breadcrumb-top-bar .col-md-3.text-end {
        text-align: right !important;
    }
}

.breadcrumb-top-bar .breadcrumbs-page {
    list-style: none;
    display: flex;
    align-items: center;
}

.breadcrumb-top-bar .breadcrumbs-page a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

.breadcrumb-top-bar .breadcrumbs-page .current-page {
    font-size: 0.875rem;
}

.breadcrumb-top-bar .search-results-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb-top-bar .search-results-summary strong {
    color: var(--text-primary);
}

.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 991px) {
    .breadcrumb-top-bar .col-md-6 {
        display: none;
        /* Hide results summary on small screens to save space */
    }
}

/* Pagination Custom */
.wg-pagination-custom {
    display: flex;
    gap: 8px;
    margin-top: 40px;
}

.pagination-item-custom {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-item-custom.active {
    background: var(--primary-teal);
    color: white;
    border-color: var(--primary-teal);
}

.pagination-item-custom:hover:not(.active) {
    background: var(--bg-light);
    border-color: var(--primary-teal);
}

/* ── Dual-Range Price Slider ── */
.price-range-slider-container {
    padding-top: 8px;
}

/* Track wrapper: stacks the two range inputs on top of each other */
.price-track-wrap {
    position: relative;
    height: 18px;
    margin-bottom: 16px;
}

/* Visible track bar */
.price-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

/* Filled (teal) portion between the two thumbs */
.price-track-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: var(--primary-teal);
    border-radius: 2px;
}

/* Both range inputs are stacked, transparent, and full-width */
.price-range-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 2;
}

/* Only allow thumb interaction */
.price-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 2px solid var(--primary-teal);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
    z-index: 3;
}

.price-range-input::-webkit-slider-thumb:hover,
.price-range-input:focus::-webkit-slider-thumb {
    border-color: var(--primary-teal-hover);
    transform: scale(1.15);
}

.price-range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #fff;
    border: 2px solid var(--primary-teal);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Price inputs row (bottom of widget) */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.price-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 6px 10px;
    background: var(--bg-light);
    transition: border-color 0.2s;
}

.price-input-wrap:focus-within {
    border-color: var(--primary-teal);
    background: #fff;
}

.price-input-wrap span {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.price-input-wrap input[type="number"] {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    -moz-appearance: textfield;
}

.price-input-wrap input[type="number"]::-webkit-outer-spin-button,
.price-input-wrap input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.price-divider {
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0;
}