/* ============================================================
   Shop Page — Ellaithy Auto
   Senior UI/UX Overhaul
   ============================================================ */

/* ── CSS Variables ───────────────────────────────────────────────────── */
:root {
    --sh-primary: #db2d2e;
    --sh-primary-dark: #c12425;
    --sh-primary-light: rgba(219, 45, 46, 0.08);
    --sh-primary-glow: rgba(219, 45, 46, 0.18);
    --sh-dark: #0f1a2e;
    --sh-text: #2d3748;
    --sh-text-muted: #718096;
    --sh-text-light: #a0aec0;
    --sh-border: #e8ecf1;
    --sh-border-light: #f1f4f8;
    --sh-bg: #ffffff;
    --sh-bg-hover: #f8f9fb;
    --sh-bg-subtle: #f4f6f9;
    --sh-radius: 10px;
    --sh-radius-sm: 6px;
    --sh-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --sh-shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --sh-shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --sh-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --sh-sidebar-w: 310px;
}

/* ── Sidebar layout ──────────────────────────────────────────────────── */
.car-listing-sidebar {
    overflow: visible !important;
}

.car-listing-sidebar > .container-fluid > .row {
    display: flex !important;
    align-items: flex-start;
}

.car-listing-sidebar-left {
    position: sticky !important;
    top: 72px !important;
    left: auto !important;
    width: var(--sh-sidebar-w);
    flex-shrink: 0;
    align-self: flex-start;
    z-index: 9;
}

.car-listing-sidebar-right {
    flex: 1;
    min-width: 0;
    padding-left: 0 !important;
}

/* ── Sidebar card container ─────────────────────────────────────────── */
.listing-sidebar {
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    background: var(--sh-bg);
    border-radius: 0 0 var(--sh-radius) var(--sh-radius);
    box-shadow: var(--sh-shadow-md);
    border: 1px solid var(--sh-border-light);
}

/* Elegant thin scrollbar */
.listing-sidebar::-webkit-scrollbar { width: 3px; }
.listing-sidebar::-webkit-scrollbar-track { background: transparent; }
.listing-sidebar::-webkit-scrollbar-thumb {
    background: var(--sh-primary);
    border-radius: 3px;
}
.listing-sidebar { scrollbar-width: thin; scrollbar-color: var(--sh-primary) transparent; }

/* ── Widget override ─────────────────────────────────────────────────── */
.listing-sidebar .widget {
    margin: 0;
    padding: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   SIDEBAR HEADER — "Advanced Search"
   ══════════════════════════════════════════════════════════════════════ */
.product-listing .listing-sidebar .widget-search {
    padding: 0 !important;
    margin: 0;
}

.sidebar-header {
    background: linear-gradient(135deg, var(--sh-dark) 0%, #1a2642 100%);
    padding: 20px 20px 16px;
    border-radius: var(--sh-radius) var(--sh-radius) 0 0;
    position: relative;
    overflow: hidden;
}

/* Decorative accent line */
.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sh-primary), #ff6b6b, var(--sh-primary));
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.sidebar-header__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.sidebar-header__title i {
    font-size: 14px;
    opacity: 0.7;
}

.sidebar-header__title .header-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-header__title .header-icon i {
    font-size: 13px;
    opacity: 1;
    color: var(--sh-primary);
}

/* Results count pill */
.sidebar-header__results {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    letter-spacing: 0.2px;
}

.sidebar-header__results-count {
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    background: var(--sh-primary);
    min-width: 28px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 11px;
    padding: 0 7px;
    display: inline-block;
    transition: transform var(--sh-transition);
}

/* Pulse animation when count changes */
.sidebar-header__results-count.updated {
    animation: countPulse 0.4s ease;
}

@keyframes countPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ══════════════════════════════════════════════════════════════════════
   ACTIVE FILTERS CHIP BAR
   ══════════════════════════════════════════════════════════════════════ */
.active-filters-bar {
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.active-filters-bar.has-filters {
    padding: 10px 16px 6px;
    max-height: 200px;
    border-bottom: 1px solid var(--sh-border-light);
}

.active-filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 10px;
    background: var(--sh-primary-light);
    border: 1px solid rgba(219, 45, 46, 0.15);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--sh-primary-dark);
    cursor: pointer;
    transition: all var(--sh-transition);
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-chip:hover {
    background: var(--sh-primary);
    color: #fff;
    border-color: var(--sh-primary);
}

.filter-chip__remove {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(219, 45, 46, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all var(--sh-transition);
    line-height: 1;
}

.filter-chip:hover .filter-chip__remove {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════
   ACTION BUTTONS BAR
   ══════════════════════════════════════════════════════════════════════ */
.filter-actions-bar {
    display: flex;
    gap: 6px;
    padding: 12px 16px 8px;
}

.filter-actions-bar a {
    flex: 1;
    text-align: center;
    padding: 7px 10px;
    font-size: 11px;
    border-radius: var(--sh-radius-sm);
    text-decoration: none !important;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: all var(--sh-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.filter-actions-bar .btn-toggle-all {
    background: var(--sh-bg-subtle);
    border: 1px solid var(--sh-border);
    color: var(--sh-text-muted);
}

.filter-actions-bar .btn-toggle-all:hover {
    background: var(--sh-border-light);
    color: var(--sh-text);
    border-color: #d1d8e0;
}

.filter-actions-bar .btn-clear-all {
    background: var(--sh-primary-light);
    border: 1px solid rgba(219, 45, 46, 0.15);
    color: var(--sh-primary);
}

.filter-actions-bar .btn-clear-all:hover {
    background: var(--sh-primary);
    border-color: var(--sh-primary);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════
   FILTER ACCORDION — Groups
   ══════════════════════════════════════════════════════════════════════ */
.product-listing ul.list-group {
    border: none;
    margin: 0;
}

.product-listing .list-group-item {
    border: none !important;
    border-bottom: 1px solid var(--sh-border-light) !important;
    padding: 0 !important;
    background: transparent;
    border-radius: 0 !important;
}

.product-listing .list-group-item:last-child {
    border-bottom: none !important;
}

/* ── Filter Toggle Header ──────────────────────────────────────────── */
.filter-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-decoration: none !important;
    padding: 13px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--sh-text) !important;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    transition: all var(--sh-transition);
    position: relative;
}

.filter-toggle:hover {
    color: var(--sh-primary) !important;
    background: var(--sh-bg-hover);
}

/* Left accent bar on hover */
.filter-toggle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--sh-primary);
    border-radius: 0 3px 3px 0;
    transition: height var(--sh-transition);
}

[dir="rtl"] .filter-toggle::before {
    left: auto;
    right: 0;
    border-radius: 3px 0 0 3px;
}

.filter-toggle:hover::before {
    height: 60%;
}

/* Chevron icon */
.filter-toggle::after {
    content: '\f107';
    font-family: 'FontAwesome';
    font-size: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--sh-bg-subtle);
    color: var(--sh-text-muted);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.filter-toggle:hover::after {
    background: var(--sh-primary-light);
    color: var(--sh-primary);
}

.filter-toggle.collapsed::after {
    transform: rotate(-90deg);
}

[dir="rtl"] .filter-toggle.collapsed::after {
    transform: rotate(90deg);
}

/* ── Filter icon before label ──────────────────────────────────────── */
.filter-toggle .filter-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--sh-bg-subtle);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
    transition: all var(--sh-transition);
}

[dir="rtl"] .filter-toggle .filter-icon {
    margin-right: 0;
    margin-left: 10px;
}

.filter-toggle:hover .filter-icon {
    background: var(--sh-primary-light);
    color: var(--sh-primary);
}

.filter-toggle .filter-icon i {
    font-size: 11px;
    color: var(--sh-text-muted);
    transition: color var(--sh-transition);
}

.filter-toggle:hover .filter-icon i {
    color: var(--sh-primary);
}

/* Count badge next to filter group title */
.filter-toggle .filter-count {
    font-size: 10px;
    font-weight: 800;
    background: var(--sh-primary);
    color: #fff;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: auto;
    margin-right: 8px;
    display: none;
}

[dir="rtl"] .filter-toggle .filter-count {
    margin-left: 8px;
    margin-right: auto;
}

.filter-toggle .filter-count.visible {
    display: inline-block;
    animation: countPulse 0.3s ease;
}

/* ── Filter Options List ────────────────────────────────────────────── */
.product-listing ul.list-group li.list-group-item ul {
    margin: 0;
}

.product-listing ul.list-group li.list-group-item ul li {
    list-style: none;
}

.filter-options-list {
    padding: 4px 16px 12px !important;
    display: block;
}

/* ══════════════════════════════════════════════════════════════════════
   CUSTOM CHECKBOXES
   ══════════════════════════════════════════════════════════════════════ */
.product-listing ul.list-group li.list-group-item ul li .form-check {
    margin-bottom: 2px !important;
    padding: 6px 8px 6px 32px;
    border-radius: var(--sh-radius-sm);
    transition: background var(--sh-transition);
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

[dir="rtl"] .product-listing ul.list-group li.list-group-item ul li .form-check {
    padding: 6px 32px 6px 8px;
}

.product-listing ul.list-group li.list-group-item ul li .form-check:hover {
    background: var(--sh-bg-hover);
}

/* Custom checkbox */
.product-listing .form-check .form-check-input {
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all var(--sh-transition);
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    flex-shrink: 0;
}

[dir="rtl"] .product-listing .form-check .form-check-input {
    left: auto;
    right: 8px;
}

.product-listing .form-check .form-check-input:hover {
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 3px var(--sh-primary-glow);
}

.product-listing .form-check .form-check-input:checked {
    background: var(--sh-primary);
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 3px var(--sh-primary-glow);
}

.product-listing .form-check .form-check-input:checked::after {
    content: '';
    display: block;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%) rotate(45deg);
}

.product-listing .form-check .form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--sh-primary-glow);
}

/* Label */
.product-listing .form-check .form-check-label {
    font-size: 13px;
    color: var(--sh-text) !important;
    font-weight: 500;
    cursor: pointer;
    padding-left: 0 !important;
    transition: color var(--sh-transition);
    line-height: 1.4;
    user-select: none;
}

.product-listing .form-check:hover .form-check-label {
    color: var(--sh-primary) !important;
}

.product-listing .form-check .form-check-input:checked ~ .form-check-label {
    color: var(--sh-primary) !important;
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════════════
   MANUFACTURER → MODEL NESTING
   ══════════════════════════════════════════════════════════════════════ */
.mfr-group {
    margin-bottom: 0;
}

.mfr-parent-check {
    position: relative;
    display: flex;
    align-items: center;
}

.mfr-parent-check .form-check-label {
    flex: 1;
    font-weight: 600 !important;
    font-size: 13px !important;
    color: var(--sh-text) !important;
}

/* Model count badge on manufacturer row */
.mfr-parent-check .mfr-model-count {
    font-size: 10px;
    font-weight: 600;
    color: var(--sh-text-light);
    background: var(--sh-bg-subtle);
    border-radius: 10px;
    padding: 1px 7px;
    margin: 0 4px;
    transition: all var(--sh-transition);
}

.mfr-parent-check:hover .mfr-model-count {
    background: var(--sh-primary-light);
    color: var(--sh-primary);
}

/* ── Manufacturer row — flex container for checkbox + badge + toggle ─── */
.mfr-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mfr-row .form-check {
    flex: 1;
    margin-bottom: 0 !important;
}

/* Toggle arrow for expanding models */
.model-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--sh-text-light);
    text-decoration: none !important;
    transition: all var(--sh-transition);
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.model-toggle:hover {
    background: var(--sh-primary-light);
    color: var(--sh-primary);
}

.model-toggle i {
    font-size: 10px;
    transition: transform 0.25s ease;
}

.model-toggle.expanded i {
    transform: rotate(180deg);
}

/* Model sub-list — indented tree */
.model-sub-list {
    list-style: none;
    padding: 2px 0 6px 16px;
    margin: 0 0 0 18px;
    border-left: 2px solid var(--sh-border);
    position: relative;
    transition: border-color var(--sh-transition);
}

.model-sub-list:hover {
    border-left-color: var(--sh-primary-glow);
}

[dir="rtl"] .model-sub-list {
    border-left: none;
    border-right: 2px solid var(--sh-border);
    padding: 2px 16px 6px 0;
    margin: 0 18px 0 0;
}

[dir="rtl"] .model-sub-list:hover {
    border-right-color: var(--sh-primary-glow);
}

.model-sub-list li {
    margin-bottom: 0;
}

.model-sub-list .form-check {
    padding: 4px 8px 4px 30px !important;
    border-radius: 4px;
}

[dir="rtl"] .model-sub-list .form-check {
    padding: 4px 30px 4px 8px !important;
}

.model-sub-list .form-check-label {
    font-weight: 400 !important;
    font-size: 12px !important;
    color: var(--sh-text-muted) !important;
}

.model-sub-list .form-check .form-check-input {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.model-sub-list .form-check .form-check-input:checked ~ .form-check-label {
    color: var(--sh-primary) !important;
    font-weight: 500 !important;
}

/* ══════════════════════════════════════════════════════════════════════
   GRID LAYOUT
   ══════════════════════════════════════════════════════════════════════ */
#cars-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}
#cars-container {
    width: 90%;
    margin: auto;
}

#cars-grid .car-grid-col {
    width: 33.33%;
    box-sizing: border-box;
}

#cars-grid .car-grid-col .car-item {

    border-radius: var(--sh-radius);
    margin: 10px;
}

/* ══════════════════════════════════════════════════════════════════════
   CUSTOM PAGINATION
   ══════════════════════════════════════════════════════════════════════ */
.shop-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 20px 12px;
    border-top: 1px solid var(--sh-border);
    margin-top: 8px;
}

.shop-pagination__info {
    margin: 0;
    font-size: 13px;
    color: var(--sh-text-muted);
}

.shop-pagination__nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pgn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--sh-border);
    background: var(--sh-bg);
    color: var(--sh-text);
    text-decoration: none !important;
    border-radius: var(--sh-radius-sm);
    transition: all var(--sh-transition);
    line-height: 1;
    cursor: pointer;
}

.pgn-btn:hover {
    background: var(--sh-primary);
    border-color: var(--sh-primary);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(219, 45, 46, 0.3);
}

.pgn-btn--active {
    background: var(--sh-primary) !important;
    border-color: var(--sh-primary) !important;
    color: #fff !important;
    cursor: default;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(219, 45, 46, 0.3);
}

.pgn-btn--disabled {
    background: var(--sh-bg-subtle);
    border-color: var(--sh-border-light);
    color: var(--sh-text-light);
    cursor: not-allowed;
    pointer-events: none;
}

.pgn-btn--nav { font-size: 16px; }

.pgn-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 36px;
    font-size: 14px;
    color: var(--sh-text-light);
}

/* ══════════════════════════════════════════════════════════════════════
   MOBILE — Overlay & Sidebar Drawer
   ══════════════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 26, 46, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Mobile header strip inside sidebar drawer */
.sidebar-mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--sh-dark) 0%, #1a2642 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.sidebar-mobile-header span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-mobile-header button {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background var(--sh-transition);
}

.sidebar-mobile-header button:hover {
    background: rgba(255,255,255,0.2);
}

/* Mobile filter toggle button (in toolbar) */
.mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    background: var(--sh-dark);
    color: #fff;
    border: none;
    border-radius: var(--sh-radius-sm);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    min-height: 40px;
    transition: all var(--sh-transition);
    box-shadow: var(--sh-shadow-sm);
}

.mobile-filter-btn:hover {
    background: var(--sh-primary);
}

.mobile-filter-btn .filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    background: var(--sh-primary);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    padding: 0 4px;
    transition: all var(--sh-transition);
}

.mobile-filter-btn:hover .filter-badge {
    background: #fff;
    color: var(--sh-primary);
}

/* ══════════════════════════════════════════════════════════════════════
   SKELETON LOADING CARDS
   ══════════════════════════════════════════════════════════════════════ */
@keyframes skeletonShimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton-card,
.skeleton-card-list {
    background: #fff;
    border-radius: var(--sh-radius);
    overflow: hidden;
    box-shadow: var(--sh-shadow-sm);
    border: 1px solid var(--sh-border-light);
}

.skeleton-card-list {
    display: flex;
    margin-bottom: 16px;
}

.skeleton-card-list .skeleton-img {
    width: 280px;
    min-height: 180px;
    flex-shrink: 0;
}

.skeleton-card .skeleton-img {
    width: 100%;
    height: 200px;
}

.skeleton-img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeletonShimmer 1.5s infinite ease-in-out;
}

.skeleton-body {
    padding: 16px;
}

.skeleton-line {
    height: 14px;
    border-radius: 6px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeletonShimmer 1.5s infinite ease-in-out;
}

.skeleton-line.w75 { width: 75%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.w30 { width: 30%; }
.skeleton-line:last-child { margin-bottom: 0; }

@media (max-width: 768px) {
    .skeleton-card-list { flex-direction: column; }
    .skeleton-card-list .skeleton-img { width: 100%; min-height: 200px; }
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */

/* ── Large desktop: tighten sidebar at 1200–1399px ─── */
@media (max-width: 1399px) and (min-width: 992px) {
    :root { --sh-sidebar-w: 270px; }
}

/* ── TABLET LANDSCAPE & below (≤ 991px): sidebar → fixed drawer ── */
@media (max-width: 991px) {

    /* Show mobile filter toggle in toolbar */
    .mobile-filter-btn     { display: flex; }
    .sidebar-mobile-header { display: flex; }

    /* Desktop sidebar header hidden — mobile header takes over */
    .sidebar-header { display: none; }

    /* Sidebar: fixed full-height off-screen drawer */
    .car-listing-sidebar-left {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        right: auto !important;
        width: min(320px, 88vw) !important;
        height: 100vh !important;
        z-index: 999 !important;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        background: var(--sh-bg);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        box-shadow: var(--sh-shadow-lg);
        border-radius: 0;
    }

    .car-listing-sidebar-left.sidebar-open { left: 0 !important; }

    [dir="rtl"] .car-listing-sidebar-left {
        left: auto !important;
        right: -100% !important;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    [dir="rtl"] .car-listing-sidebar-left.sidebar-open {
        right: 0 !important;
        left: auto !important;
    }

    .listing-sidebar {
        max-height: 100%;
        flex: 1;
        overflow-y: auto;
        border-radius: 0;
        box-shadow: none;
        border: none;
    }

    /* Right panel: full-width (sidebar is off-canvas) */
    .car-listing-sidebar-right {
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Grid: 3 columns with full right-panel width */
    #cars-grid .car-grid-col { width: 33.33%; }
}

/* ── TABLET PORTRAIT (≤ 768px): 2-column grid ── */
@media (max-width: 768px) {
    #cars-grid .car-grid-col { width: 50%; }

    /* List view: image stacks above card body */
    #cars-list-view > div                       { flex-direction: column !important; }
    #cars-list-view > div > div:first-child     { width: 100% !important; }
    #cars-list-view > div > div:first-child img { height: 200px !important; }

    /* Pagination: centered column layout */
    .shop-pagination {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* ── SMALL MOBILE (≤ 575px): 2-column grid, full-width container ── */
@media (max-width: 575px) {
    #cars-grid .car-grid-col { width: 50%; }
    #cars-container { width: 100% !important; }
}

/* ── TINY MOBILE (≤ 420px): single-column ── */
@media (max-width: 420px) {
    #cars-grid .car-grid-col { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════════
   PRICE RANGE FILTER
   ══════════════════════════════════════════════════════════════════════ */
.price-range-section {
    padding: 18px 18px 20px;
    border-bottom: 1px solid var(--sh-border-light);
    border-radius: var(--sh-radius) var(--sh-radius) 0 0;
    background: var(--sh-bg);
}

.price-range-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--sh-text);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 14px;
}

.price-range-section__title .filter-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--sh-bg-subtle);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.price-range-section__title .filter-icon i {
    font-size: 11px;
    color: var(--sh-text-muted);
}

.price-values-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.price-val-box {
    flex: 1;
    /* background: var(--sh-bg-subtle);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius-sm);
    padding: 7px 10px; */
}

.price-val-box__label {
    display: block;
    font-size: 12px;
    color: var(--sh-text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

[dir="rtl"] .price-val-box__label { text-align: right; }

.price-val-box__amount {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--sh-primary);
    white-space: nowrap;
}

[dir="rtl"] .price-val-box__amount { text-align: right; direction: ltr; }

/* Dual range slider */
.dual-range-wrap {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
    margin: 0 6px;
}

.dual-range-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--sh-border);
    border-radius: 2px;
    pointer-events: none;
}

.dual-range-fill {
    position: absolute;
    height: 4px;
    background: var(--sh-primary);
    border-radius: 2px;
    pointer-events: none;
}

.dual-range-input {
    position: absolute;
    width: 100%;
    height: 4px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    outline: none;
    pointer-events: none;
    margin: 0;
    padding: 0;
    top: 50%;
    transform: translateY(-50%);
}

.dual-range-input::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid var(--sh-primary);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 6px rgba(219, 45, 46, 0.25);
    transition: transform var(--sh-transition), box-shadow var(--sh-transition);
}

.dual-range-input::-webkit-slider-thumb:hover,
.dual-range-input::-webkit-slider-thumb:active {
    transform: scale(1.25);
    box-shadow: 0 2px 10px rgba(219, 45, 46, 0.45);
}

.dual-range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid var(--sh-primary);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 6px rgba(219, 45, 46, 0.25);
    transition: transform var(--sh-transition);
}

.dual-range-input::-moz-range-thumb:hover {
    transform: scale(1.25);
}

/* ══════════════════════════════════════════════════════════════════════
   MANUFACTURER LOGO IN FILTER
   ══════════════════════════════════════════════════════════════════════ */
.mfr-logo-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 6px;
    display: inline-block;
    flex-shrink: 0;
}

[dir="rtl"] .mfr-logo-img {
    margin-right: 0;
    margin-left: 6px;
}

.mfr-logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--sh-bg-subtle);
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 6px;
    font-size: 9px;
    color: var(--sh-text-muted);
    flex-shrink: 0;
}

[dir="rtl"] .mfr-logo-placeholder {
    margin-right: 0;
    margin-left: 6px;
}

/* ══════════════════════════════════════════════════════════════════════
   FEATURED CAR SPOTLIGHT
   ══════════════════════════════════════════════════════════════════════ */
.featured-car-spotlight {
    background: linear-gradient(135deg, #0f1a2e 0%, #1a2a4a 100%);
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
}

.featured-car-spotlight__inner {
    display: flex;
    align-items: stretch;
    min-height: 210px;
}

.featured-car-spotlight__image {
    width: 48%;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.featured-car-spotlight__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.featured-car-spotlight:hover .featured-car-spotlight__image img {
    transform: scale(1.05);
}

/* Gradient fade from image into the info panel */
.featured-car-spotlight__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent 55%, #1a2a4a 100%);
    pointer-events: none;
}

[dir="rtl"] .featured-car-spotlight__image::after {
    background: linear-gradient(to left, transparent 55%, #1a2a4a 100%);
}

.featured-car-spotlight__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--sh-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(219, 45, 46, 0.4);
}

[dir="rtl"] .featured-car-spotlight__badge {
    left: auto;
    right: 12px;
}

.featured-car-spotlight__info {
    flex: 1;
    padding: 22px 22px 22px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
}

[dir="rtl"] .featured-car-spotlight__info {
    padding: 22px 14px 22px 22px;
}

.featured-car-spotlight__make {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.featured-car-spotlight__title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}

.featured-car-spotlight__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.featured-car-spotlight__meta span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.featured-car-spotlight__meta i {
    font-size: 10px;
    color: var(--sh-primary);
}

.featured-car-spotlight__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.featured-car-spotlight__price .price-amount {
    font-size: 20px;
    font-weight: 800;
    color: var(--sh-primary);
    line-height: 1;
}

.featured-car-spotlight__price .price-call {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

.featured-car-spotlight__price .price-type-badge {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.btn-featured-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--sh-primary);
    color: #fff !important;
    text-decoration: none !important;
    padding: 8px 16px;
    border-radius: var(--sh-radius-sm);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    width: fit-content;
    margin-top: 2px;
    transition: background var(--sh-transition), box-shadow var(--sh-transition);
    box-shadow: 0 2px 8px rgba(219, 45, 46, 0.3);
}

.btn-featured-view:hover {
    background: var(--sh-primary-dark);
    box-shadow: 0 4px 14px rgba(219, 45, 46, 0.45);
    color: #fff !important;
}

@media (max-width: 768px) {
    .featured-car-spotlight__inner {
        flex-direction: column;
    }
    .featured-car-spotlight__image {
        width: 100%;
        height: 200px;
    }
    .featured-car-spotlight__image::after {
        background: linear-gradient(to bottom, transparent 55%, #1a2a4a 100%);
    }
    .featured-car-spotlight__info {
        padding: 18px;
    }
    .featured-car-spotlight__title {
        font-size: 15px;
    }
    .featured-car-spotlight__price .price-amount {
        font-size: 17px;
    }
}

/* Price range section needs top radius since it's first in sidebar */
.listing-sidebar .price-range-section:first-child {
    border-radius: var(--sh-radius) var(--sh-radius) 0 0;
}

/* When price range is present, sidebar-header loses its top radius */
.listing-sidebar .price-range-section + .widget-search .sidebar-header {
    border-radius: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   SHOP HERO BANNER
   ══════════════════════════════════════════════════════════════════════ */
.shop-hero-banner {
    height: 300px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    width: 90%;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
}

@media (max-width: 1199px) {
    .shop-hero-banner {
        height: 260px;
        width: 95%;
    }
}

@media (max-width: 991px) {
    .shop-hero-banner {
        height: 240px;
        width: 100%;
        border-radius: 10px;
    }
}

@media (max-width: 768px) {
    .shop-hero-banner {
        height: 200px;
        border-radius: 0;
    }
}

@media (max-width: 575px) {
    .shop-hero-banner { height: 165px; }
}

/* ══════════════════════════════════════════════════════════════════════
   ADDITIONAL RESPONSIVE POLISH
   ══════════════════════════════════════════════════════════════════════ */

/* Mobile filter button — touch-friendly at very small sizes */
@media (max-width: 420px) {
    .mobile-filter-btn {
        font-size: 11px;
        padding: 8px 12px;
    }
}

/* Skeleton loader — stack on tiny screens */
@media (max-width: 575px) {
    .skeleton-card-list             { flex-direction: column; }
    .skeleton-card-list .skeleton-img { width: 100%; min-height: 180px; }
}

/* Pagination buttons — compact on tiny screens */
@media (max-width: 420px) {
    .pgn-btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 6px;
    }
    .pgn-btn--nav { font-size: 14px; }
}

/* Featured car spotlight — extra small screens */
@media (max-width: 420px) {
    .featured-car-spotlight__title      { font-size: 14px; }
    .featured-car-spotlight__price .price-amount { font-size: 15px; }
    .btn-featured-view                  { font-size: 10px; padding: 6px 12px; }
}

/* Filter chip bar — prevent overflow on very small screens */
@media (max-width: 420px) {
    .filter-chip {
        max-width: 110px;
        font-size: 10px;
    }
}

/* Price values row — compact on small screens */
@media (max-width: 420px) {
    .price-val-box {
        padding: 5px 8px;
    }
    .price-val-box__amount {
        font-size: 11px;
    }
}
