/* Search Page Specific Styles */
body {
    background-color: #f8f9fa;
    padding-top: 76px;
    /* Space for fixed navbar */
}

.filter-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-title {
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.product-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    background: white;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.badge-distance {
    background-color: #e9ecef;
    color: #495057;
    font-size: 0.8rem;
}

.stock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.btn-filter {
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
}

.btn-filter:hover {
    background-color: #0b5ed7;
}

/* Modal Specific Styles */
#productModal .modal-content {
    overflow: hidden;
}



@media (min-width: 992px) {
    .modal-split-col {
        height: 750px;
        max-height: 85vh;
        overflow-y: auto;
    }
}

.custom-pin div {
    transition: transform 0.2s;
}

/* User Location Pulse */
.user-pin-pulse {
    background-color: #0d6efd !important;
    /* Blue */
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

/* Mobile Filter Toggle */
@media (max-width: 768px) {
    .filter-sidebar {
        display: none;
    }

    .filter-sidebar.active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        overflow-y: auto;
    }
}

/* Dual Range Slider Styles */
.range-slider-container {
    position: relative;
    height: 24px;
    margin: 30px 0 15px 0;
    width: 100%;
}

/* The visual track background */
.range-slider-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    width: 100%;
    background-color: #dee2e6;
    border-radius: 2px;
    z-index: 0;
}

/* The active blue range bar */
.range-slider-progress {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background-color: #0d6efd;
    border-radius: 2px;
    z-index: 1;
}

/* The actual inputs - invisible but clickable thumbs */
.range-input {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) !important;
    /* Force center */
    left: 0;
    width: 100%;
    pointer-events: none;
    /* Let clicks pass through track area */
    appearance: none;
    -webkit-appearance: none;
    background: none;
    /* Transparent background */
    border: none;
    height: 0;
    /* height 0 wrapper, thumb has height */
    z-index: 2;
    margin: 0;
    padding: 0;
}

/* Webkit Thumb */
.range-input::-webkit-slider-thumb {
    pointer-events: auto;
    /* Re-enable clicks on thumb */
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 2px solid #0d6efd;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 3;
    margin-top: -7px;
    /* Adjust for height 0 input */
}

/* Mozilla Thumb */
.range-input::-moz-range-thumb {
    pointer-events: auto;
    appearance: none;
    border: none;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 2px solid #0d6efd;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 3;
}

.range-input:focus {
    outline: none;
}

.range-input:active::-webkit-slider-thumb {
    background: #e9ecef;
}

.price-values {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 5px;
}

/* ===== 3-Column Search Results Layout ===== */

/* Column headers */
.col-header {
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* Left & right columns: sticky top on large screens */
@media (min-width: 992px) {
    #store-col,
    #local-col,
    #affiliate-col {
        position: sticky;
        top: 80px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        scrollbar-width: thin;
    }
    /* Thin scrollbar for webkit */
    #store-col::-webkit-scrollbar,
    #local-col::-webkit-scrollbar,
    #affiliate-col::-webkit-scrollbar { width: 4px; }
    #store-col::-webkit-scrollbar-thumb,
    #local-col::-webkit-scrollbar-thumb,
    #affiliate-col::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 4px; }
}

/* Map container */
#search-map {
    height: 280px;
    z-index: 1;
    overflow: hidden;
}

/* Numbered badge in place cards */
.place-num-badge {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #0d6efd;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 2px 5px rgba(13,110,253,.35);
}

/* Place card highlight (hover sync) */
.place-card-inner {
    transition: background 0.2s, box-shadow 0.2s;
}

/* Affiliate card hover */
.affiliate-card-inner {
    transition: transform 0.2s, box-shadow 0.2s;
}
.affiliate-card:hover .affiliate-card-inner {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.1) !important;
}

/* Mobile: columns stack, map/local goes between store and affiliates */
@media (max-width: 991px) {
    #three-col-layout > .col-lg-4,
    #three-col-layout > .col-lg-5,
    #three-col-layout > .col-lg-3 {
        max-height: none;
        overflow-y: visible;
        position: static;
    }
    #search-map { height: 220px; }
}