/* ============================================================
   Browse Pages CSS — shared by global_browse & store_browse
   ============================================================ */

/* Prevent horizontal scroll globally on mobile */
html, body { overflow-x: hidden; }

/* Cap offcanvas width to viewport so it never exceeds screen width */
.offcanvas { max-width: 100vw !important; }
.offcanvas-body { overflow-x: hidden !important; }

/* ---------- Filter Groups ---------- */
.transition-icon { transition: transform 0.2s ease; }
.filter-group.collapsed .transition-icon { transform: rotate(-90deg); }
.filter-group.collapsed .filter-options { display: none; }
.filter-checkbox:disabled + label { opacity: 0.45; text-decoration: line-through; pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.quick-filter-chip { font-size: 0.8rem; white-space: nowrap; }

/* Keep filter UI neutral — no blue or theme color overrides */
.form-check-input:checked {
    background-color: #495057;
    border-color: #495057;
}
.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(73, 80, 87, 0.25);
}

/* ---------- Mobile Quick-Filter Row ---------- */
.mobile-filter-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    overflow: hidden;
}
#mobile-quick-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    flex-grow: 1;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}
#mobile-quick-filters::-webkit-scrollbar {
    display: none;
}
#mobile-quick-filters .quick-filter-chip {
    scroll-snap-align: start;
}
.filter-btn-fixed {
    flex-shrink: 0 !important;
    white-space: nowrap;
}

/* ---------- Pill Filter Buttons (mobile accordion) ---------- */
.filter-pill-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
    border: 1.5px solid #dee2e6;
    color: #495057;
    background: #fff;
    transition: all 0.15s ease;
    font-weight: 500;
}
.filter-pill-btn:hover {
    border-color: var(--adminuiux-theme-1, #3b82f6);
    color: var(--adminuiux-theme-1, #3b82f6);
    background: rgba(59,130,246,0.05);
}
.btn-check:checked + .filter-pill-btn {
    background: var(--adminuiux-theme-1, #3b82f6) !important;
    border-color: var(--adminuiux-theme-1, #3b82f6) !important;
    color: #fff !important;
}
.btn-check:disabled + .filter-pill-btn {
    opacity: 0.4;
    pointer-events: none;
    text-decoration: line-through;
}

/* ---------- Accordion Styling (store_browse mobile) ---------- */
#mobileFilterAccordion .accordion-button:not(.collapsed) {
    background: #f8f9fa;
    color: var(--adminuiux-theme-1, #3b82f6);
}
#mobileFilterAccordion .accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

/* ---------- Global Browse Skeleton (gb-) ---------- */
@keyframes gb-skeleton-shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}
.gb-skeleton-card {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
}
.gb-skeleton-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #e9ecef;
    background-image: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 40%, #e9ecef 80%);
    background-size: 200px 100%;
    background-repeat: no-repeat;
    animation: gb-skeleton-shimmer 1.4s ease-in-out infinite;
}
.gb-skeleton-body {
    padding: 10px;
}
.gb-skeleton-line {
    height: 0.8rem;
    border-radius: 6px;
    background: #e9ecef;
    background-image: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 40%, #e9ecef 80%);
    background-size: 200px 100%;
    background-repeat: no-repeat;
    animation: gb-skeleton-shimmer 1.4s ease-in-out infinite;
    margin-bottom: 8px;
}
.gb-skeleton-line.short { width: 60%; }
.gb-skeleton-line.price { width: 40%; height: 1rem; }

/* ---------- Store Browse Skeleton (sb-) ---------- */
@keyframes sb-skeleton-shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}
.sb-skeleton-card {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
}
.sb-skeleton-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #e9ecef;
    background-image: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 40%, #e9ecef 80%);
    background-size: 200px 100%;
    background-repeat: no-repeat;
    animation: sb-skeleton-shimmer 1.4s ease-in-out infinite;
}
.sb-skeleton-body {
    padding: 10px;
}
.sb-skeleton-line {
    height: 0.8rem;
    border-radius: 6px;
    background: #e9ecef;
    background-image: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 40%, #e9ecef 80%);
    background-size: 200px 100%;
    background-repeat: no-repeat;
    animation: sb-skeleton-shimmer 1.4s ease-in-out infinite;
    margin-bottom: 8px;
}
.sb-skeleton-line.short { width: 60%; }
.sb-skeleton-line.price { width: 40%; height: 1rem; }

/* ---------- Inline-style replacements ---------- */
#filterOffcanvas { max-width: 360px; }
#mobileFilterAccordion .accordion-button {
    font-size: 0.9rem;
    background: #f8f9fa;
}
.filter-scrollable { overflow-y: auto; padding-inline-end: 4px; }

/* ---------- Modern thin scrollbars ---------- */
.filter-scrollable,
#desktop-sidebar-filters,
#mobile-filter-body,
.search-suggestions-dropdown {
    scrollbar-width: thin;
    scrollbar-color: #ccd1d9 transparent;
}
.filter-scrollable::-webkit-scrollbar,
#desktop-sidebar-filters::-webkit-scrollbar,
#mobile-filter-body::-webkit-scrollbar,
.search-suggestions-dropdown::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.filter-scrollable::-webkit-scrollbar-track,
#desktop-sidebar-filters::-webkit-scrollbar-track,
#mobile-filter-body::-webkit-scrollbar-track,
.search-suggestions-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.filter-scrollable::-webkit-scrollbar-thumb,
#desktop-sidebar-filters::-webkit-scrollbar-thumb,
#mobile-filter-body::-webkit-scrollbar-thumb,
.search-suggestions-dropdown::-webkit-scrollbar-thumb {
    background: #ccd1d9;
    border-radius: 8px;
}
.filter-scrollable:hover::-webkit-scrollbar-thumb,
#desktop-sidebar-filters:hover::-webkit-scrollbar-thumb {
    background: #adb5bd;
}

/* ---------- Manual price inputs ---------- */
.price-input-visible {
    text-align: center;
    font-size: 0.85rem;
}
.price-input-visible::-webkit-outer-spin-button,
.price-input-visible::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.price-input-visible { -moz-appearance: textfield; appearance: textfield; }
.products-loading-overlay {
    background: rgba(255,255,255,0.7);
    z-index: 10;
    border-radius: 16px;
}
.scroll-sentinel { height: 1px; }

.glp-card-price-wrap {
    padding-left: 40px;
    text-align: right;
}

/* ---------- Empty State ---------- */
.browse-empty-state {
    padding: 3rem 1rem;
}
.browse-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--bs-tertiary-bg, #f8f9fa);
    display: flex;
    align-items: center;
    justify-content: center;
}
.browse-empty-icon i {
    font-size: 2.2rem;
    color: var(--bs-secondary-color);
    opacity: 0.5;
}
