/* Category Page Styles */

.category-page {
    background-color: #f8fafc;
    /* Light background for contrast if needed, or keep white */
}

/* Sidebar Overrides/Additions */
.sidebar-widget {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Custom Checkbox */
.custom-checkbox {
    display: block;
    min-height: 1.5rem;
    padding-left: 1.7rem;
    /* Space for the custom indicator */
    position: relative;
    margin-bottom: 0.5rem;
}

.custom-checkbox .custom-control-input {
    position: absolute;
    left: 0;
    z-index: -1;
    width: 1rem;
    height: 1.25rem;
    opacity: 0;
}

.custom-checkbox .custom-control-label {
    position: relative;
    margin-bottom: 0;
    vertical-align: top;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
}

.custom-checkbox .custom-control-label::before {
    position: absolute;
    top: 0.25rem;
    left: -1.7rem;
    /* Match padding-left */
    display: block;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    content: "";
    background-color: #fff;
    border: 1px solid #adb5bd;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.custom-checkbox .custom-control-label::after {
    position: absolute;
    top: 0.25rem;
    left: -1.7rem;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
    background: no-repeat 50% / 50% 50%;
}

.custom-checkbox .custom-control-input:checked~.custom-control-label::before {
    color: #fff;
    border-color: #000;
    background-color: #000;
}

.custom-checkbox .custom-control-input:checked~.custom-control-label::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e");
}

.custom-checkbox .custom-control-input:checked~.custom-control-label {
    color: #000;
    font-weight: 600;
}

/* Reduce Product Title Size in Grid */
.product-title {
    font-size: 15px !important;
    /* Force override if needed or ensure high specificity */
    line-height: 1.4;
    font-weight: 600;
    text-transform: none !important;
    /* Remove uppercase if it makes it look too big */
}

/* Price Inputs */
.price-input-group input {
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    padding: 10px;
    font-size: 14px;
    color: #0f172a;
    background: #f8fafc;
}

.price-input-group input:focus {
    background: #fff;
    border-color: #000;
    box-shadow: none;
}

/* Submit Button */
.btn-filter {
    background: #000;
    color: #fff;
    border-radius: 6px;
    padding: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
    border: 1px solid #000;
    transition: all 0.2s;
}

.btn-filter:hover {
    background: #fff;
    color: #000;
}

/* Category Links */
.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #f8fafc;
    transition: all 0.2s;
    font-size: 14px;
}

.category-link:last-child {
    border-bottom: none;
}

.category-link:hover,
.category-link.active {
    color: #000;
    padding-left: 5px;
    font-weight: 600;
}

.category-link i {
    font-size: 18px;
}

/* Filters Badges (Selected) */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-badge {
    background: #000;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-badge a {
    color: #fff;
    text-decoration: none;
}

/* Sort Select */
.sort-select {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    background-color: #fff;
}

.sort-select:focus {
    border-color: #000;
    outline: none;
}

/* Mobile Filter */
@media (max-width: 991px) {
    .filter-drawer-wrapper {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        z-index: 1051;
        padding: 20px;
        overflow-y: auto;
        transition: left 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    }

    .filter-drawer-wrapper.active {
        left: 0;
    }

    .mobile-filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1050;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .mobile-filter-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Ensure sidebar widgets look good in drawer */
    .filter-drawer-wrapper .sidebar-widget {
        border: none;
        padding: 0;
        box-shadow: none;
        margin-bottom: 30px;
    }

    .filter-drawer-wrapper .sidebar-title {
        font-size: 15px;
        margin-bottom: 15px;
    }
}