/**
 * Search Page Specific Styles
 * Extracted from products/search.blade.php
 * Version: 1.0
 * Last Updated: 2026-02-10
 */

/* ========================================
   Product Brand Checkbox
   ======================================== */
.product_brand span {
    height: 20px;
    width: 20px;
}

/* ========================================
   Widget Adjustments (Uniform Spacing)
   ======================================== */

.sidebar .widget_title {
    margin-bottom: 12px !important;
    display: block;
    /* Ensure it's treated as block for margins */
}

/* Reset any global spacing that adds extra gaps */
.sidebar .widget+.widget {
    border-top: unset !important;
    margin-top: 0px !important;
    padding-top: 0px !important;
}

.sidebar .widget.first-widget {
    margin-top: 0px !important;
}

/* ========================================
   Input Placeholder
   ======================================== */
input::placeholder {
    font-size: 13px;
}

/* ========================================
   Checkbox Button Styles
   ======================================== */
.btn-checkbox2btn {
    color: #000;
    background-color: #eee;
}

.btn-checkbox-checked {
    color: #FFF;
    background-color: #bb1f2a;
}

.btn-checkbox-checked:hover {
    color: #FFF;
    background-color: #bb1f2a;
}

.checkbox2button .btn-sm {
    padding: 4px 6px;
}

.checkbox2button .icon:before {
    content: none !important;
    display: none !important;
}

.widget .nav input[type=checkbox],
.checkbox2button input[type=checkbox] {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
}

/* ========================================
   Category Horizontal Scroll
   ======================================== */
.category-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scroll-behavior: smooth;
    cursor: grab;
    scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-items {
    display: flex;
    flex-wrap: nowrap;
    gap: 0px;
}

.category-box {
    flex-shrink: 0;
}

/* ========================================
   Custom Color Checkboxes
   ======================================== */
.custom-checkboxs input[type=checkbox]+label span {
    display: inline-block;
    width: 30px;
    height: 30px;
    margin: -1px 4px 0 0;
    vertical-align: middle;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.33);
    background-repeat: no-repeat;
    background-position: center;
    text-align: center;
    line-height: 26px;
}

.custom-checkboxs input[type=checkbox]+label span img {
    opacity: 0;
    transition: all 0.3s ease;
}

.custom-checkboxs input[type=checkbox]:checked+label span img {
    opacity: 1;
}

.custom-checkboxs input[type=checkbox]:checked+label span {
    border: 2px solid #bb1f2a !important;
}

/* ========================================
   Control Header Row (Desktop & Mobile)
   ======================================== */
.control-header-row {
    flex-wrap: nowrap;
}

.total-products-wrap h6 {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    line-height: 34px;
    /* Match height of controls for perfect centering */
}

.controls-right {
    gap: 10px;
}

/* Hide Filter Trigger on Desktop (Sidebar is visible) */
.products_view {
    display: none !important;
}

.shorting_icon.grid {
    height: 34px;
    width: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    padding: 0;
}

.shorting_icon.grid:hover {
    background: #f8f8f8;
    color: #bb1f2a;
}

.control-header-row select.form-control-sm {
    height: 34px !important;
    line-height: 1;
    padding-top: 0;
    padding-bottom: 0;
    min-width: 100px;
}

/* Mobile Specific Adjustments */
@media (max-width: 768px) {
    .control-header-row {
        justify-content: space-between;
    }

    .total-products-wrap h6 {
        font-size: 13px;
    }

    .category-scroll-wrapper {
        width: 100%;
        padding: 5px 0;
        border-top: 1px solid #eee;
        border-bottom: 1px solid #eee;
        margin-top: 10px;
    }

    .category-scroll {
        margin-bottom: 0;
    }
}

/* ========================================
   Custom Scrollbar (Perfect Scrollbar)
   ======================================== */
.custom-scroll {
    position: relative;
    overflow: auto;
}

/* Show scrollbar only on hover for desktop */
.custom-scroll .ps__rail-x {
    opacity: 0;
    transition: opacity 0.3s;
    height: 6px;
}

.custom-scroll.show-scroll .ps__rail-x {
    opacity: 1;
}

/* Style scrollbar thumb */
.custom-scroll .ps__thumb-x {
    background-color: #888;
    border-radius: 3px;
    height: 2px;
}

.custom-scroll .ps__thumb-x:hover {
    background-color: #555;
}

/* Hide scrollbar entirely on mobile */
@media (max-width: 768px) {
    .custom-scroll::-webkit-scrollbar {
        display: none;
    }

    .custom-scroll {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

.custom_select {
    position: relative;
}

.custom_select::before {
    content: "";
    position: absolute;
    right: 12px;
    /* move to where you want the arrow */
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    /* important for selects */

    width: 18px;
    height: 18px;

    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23919191' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") no-repeat center;
    background-size: contain;
}

/* ========================================
   Sticky Filter Buttons (Mobile)
   ======================================== */
@media (max-width: 768px) {

    /* Show Filter Trigger on Mobile */
    .products_view {
        display: block !important;
    }

    /* Floating Filter Trigger Button */
    .shorting_icon.grid {
        position: fixed !important;
        bottom: 135px !important;
        right: 20px !important;
        z-index: 1500 !important;
        width: 50px !important;
        height: 50px !important;
        background-color: #bb1f2a !important;
        color: #fff !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 6px 16px rgba(187, 31, 42, 0.35) !important;
        border: none !important;
        margin: 0 !important;
        line-height: normal !important;
        transition: all 0.2s ease !important;
    }

    .shorting_icon.grid:active {
        transform: scale(0.92);
    }

    .shorting_icon.grid svg {
        width: 22px !important;
        height: 22px !important;
        stroke: #fff !important;
        margin: 0 !important;
    }

    #filter_popup {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 2000 !important;
        background: #fff !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        transform: translateY(-100%);
        transition: transform 0.3s ease-out !important;
    }

    #filter_popup.filter-in {
        display: flex !important;
        flex-direction: column !important;
        transform: translateY(0);
        overflow: hidden !important;
        padding-bottom: 0 !important;
    }

    .filter-popup-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 15px !important;
        border-bottom: 1px solid #f0f0f0 !important;
        flex-shrink: 0 !important;
        background: #fff !important;
        z-index: 10 !important;
    }

    .filter-popup-header h5 {
        margin: 0 !important;
        font-size: 18px !important;
        font-weight: 700 !important;
        color: #000 !important;
        text-transform: capitalize !important;
    }

    .filter-popup-header .close {
        position: static !important;
        width: auto !important;
        height: auto !important;
        padding: 0 !important;
        opacity: 1 !important;
        color: #333 !important;
        background: transparent !important;
        border: none !important;
        line-height: 1 !important;
    }

    .filter-popup-header .close svg {
        display: block !important;
    }

    #search_product {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow: hidden !important;
        margin-top: 0 !important;
    }



    .sidebar {
        flex: 1 !important;
        overflow-y: auto !important;

        -webkit-overflow-scrolling: touch;
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
    }

    .filter-buttons-widget {
        position: sticky !important;
        bottom: 0 !important;

        padding: 10px 0px !important;
        margin: 0 !important;
        margin-bottom: 0 !important;
        margin-top: auto !important;
        z-index: 1000 !important;
        /* Higher z-index */

        display: flex !important;
        gap: 10px !important;
        border-top: 1px solid #f0f0f0 !important;
        flex-shrink: 0 !important;
    }

    .filter-buttons-widget button {
        flex: 1 !important;
        margin: 0 !important;
        height: 38px !important;
        /* Balanced height */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-transform: uppercase !important;
        font-weight: 700 !important;
        font-size: 13px !important;
        border-radius: 4px !important;
        letter-spacing: 0.5px !important;
    }


    #submit {
        background-color: #bb1f2a !important;
        border-color: #bb1f2a !important;
        color: #fff !important;
    }

    #reset {
        background-color: #333 !important;
        border-color: #333 !important;
        color: #fff !important;
    }
}

/* Sticky filter for desktop */
@media (min-width: 992px) {
    #filter_popup {
        position: sticky;
        top: 78px;
        /* distance from top when stuck */
        align-self: flex-start;
        /* important for bootstrap columns */
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        z-index: 10;
    }
}