:root {
    --primary-color: #d32f2f;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.page-header {
    background: linear-gradient(330deg, #ffffff 60%, var(--primary-color) 533%);
    color: #454548;
    padding: 40px 30px 30px;
    text-align: right;
    margin-bottom: 30px;
}

.header-carlist {
    padding-bottom: 20px;
    padding-top: 40px;
}

.car-list-container {
    max-width: 100% !important;
    width: 100%;
    margin: 0 !important;
    background-color: #fff;
    border-radius: 0;
    box-shadow: none;
}

.container-main {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    align-items: flex-start;
}

.sidebar-area {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    z-index: 900;
    width: 20%;
}

.mobile-close-btn {
    display: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.mobile-filter-trigger {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.mobile-filter-trigger:active {
    transform: translateX(-50%) scale(0.95);
}

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

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

.filter-section {
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    color: #333;
    padding: 8px 0;
    transition: color 0.3s;
}

.filter-header:hover {
    color: var(--primary-color);
}

.filter-header i {
    transition: transform 0.3s ease;
}

.filter-header.collapsed i {
    transform: rotate(180deg);
}

.filter-content {
    margin-top: 10px;
    position: relative;
}

.filter-content.hidden {
    display: none;
}

.filter-search-input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.85rem;
    margin-bottom: 10px;
    outline: none;
}

.filter-search-input:focus {
    border-color: var(--primary-color);
}

.filter-item-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f1f1f1;
}

.filter-item-list::-webkit-scrollbar {
    width: 8px;
}

.filter-item-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
    margin: 5px 0;
}

.filter-item-list::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

.filter-item-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-color);
    cursor: pointer;
}

.filter-item {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 5px;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.filter-item label::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.filter-item:hover {
    background-color: #f9f9f9;
}

.filter-item input[type="checkbox"] {
    margin-left: 8px;
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    position: relative;
    z-index: 2;
}

.filter-item .color-circle {
    position: relative;
    z-index: 2;
}

.brand-count {
    font-size: 0.75rem;
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 10px;
    margin-inline-start: auto;
    color: #777;
    font-weight: bold;
}

html[dir="rtl"] .brand-count {
    margin-right: auto;
    margin-left: 0;
}

html[dir="ltr"] .brand-count {
    margin-left: auto;
    margin-right: 0;
}

.color-circle {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #ddd;
    margin-left: 8px;
    vertical-align: middle;
}

.range-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.range-input-group {
    display: flex;
    flex-direction: column;
    width: 50%;
}

.range-input-group label {
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 3px;
}

.range-input-group input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.85rem;
    background: #f9f9f9;
    font-weight: 600;
    color: #333;
    transition: all 0.3s;
    text-align: center;
}

.range-input-group input:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.btn-apply-filters {
    width: 100%;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    margin-top: 15px;
    transition: background 0.3s;
}

.btn-apply-filters:hover {
    background-color: var(--primary-color);
    filter: brightness(0.94);
}

.noUi-target {
    background: #e9ecef;
    border: none;
    border-radius: 10px;
    box-shadow: none;
    height: 6px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.noUi-connect {
    background: var(--primary-color);
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.3);
}

.noUi-horizontal .noUi-handle {
    width: 18px;
    height: 18px;
    right: -9px;
    top: -6px;
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.noUi-handle:before, .noUi-handle:after {
    display: none;
}

.noUi-handle:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
}

.noUi-handle:active {
    cursor: grabbing;
    transform: scale(1.3);
    background: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.2);
}

.btn-reset-filters-bottom {
    display: block;
    width: 100%;
    text-align: center;
    background-color: transparent;
    color: #777;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-reset-filters-bottom:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
    border-color: #ccc;
    text-decoration: none;
}

.btn-reset-filters-bottom i {
    font-size: 0.85rem;
    margin-left: 5px;
}

#filterSidebar .btn-reset-filters-bottom {
    margin-bottom: 5px;
}

.filter-maker-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    border-radius: 2px;
    pointer-events: none;
}

.cars-section {
    flex: 1;
}

.cars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

html[dir="rtl"] .cars-grid {
    padding-left: 20px;
}

html[dir="ltr"] .cars-grid {
    padding-right: 20px;
}

.car-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.car-img-wrapper {
    position: relative;
    height: 200px;
    background-color: #f8f8f8;
    overflow: hidden;
}

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

.car-card:hover .car-img-wrapper img {
    transform: scale(1.05);
}

.car-overlay-logo {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 10;
    width: 35px !important;
    height: 35px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
}

html[dir="rtl"] .car-overlay-logo {
    left: auto !important;
    right: 10px !important;
}

.car-overlay-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    transform: none !important;
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    backdrop-filter: blur(4px);
}

html[dir="rtl"] .status-badge {
    right: auto;
    left: 10px;
}

.price-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: var(--primary-color);
    color: #fff;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

html[dir="rtl"] .price-badge {
    left: auto;
    right: 10px;
}

.price-badge small {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-left: 3px;
}

.car-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.name-brand {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.car-name {
    font-size: 1.0rem;
    font-weight: 800;
    color: #222;
    margin: 0;
    line-height: 1.5;
    padding-bottom: 5px;
    text-transform: uppercase;

}

.spec-badge {
    background-color: #f0f2f5;
    color: #555;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.car-specs-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9f9f9;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #666;
}

.spec-item i {
    color: var(--primary-color);
}

.btn-details {
    margin-top: auto;
    display: block;
    width: 100%;
    text-align: center;
    background-color: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 8px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-details:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.quick-links {
    min-height: 278px;
}

.quick-links .link a {
    background: #ffffff;
    padding: 40px 15px 10px;
    border: 1px solid #f6f6f6;
    margin-right: -1px;
    display: block;
    border-top: 0px;
    text-decoration: unset;
}

.quick-links .link a i {
    font-size: 30px;
    width: 80px;
    height: 80px;
    line-height: 80px;
    color: var(--primary-color);
    display: inline-block;
    text-align: center;
    border-radius: 50%;
    transition: all 0.3s ease-out 0s;
}

.quick-links .link a h6 {
    font-size: 30px;
    color: var(--primary-color);
    padding-top: 10px;
    transition: all 0.3s ease-out 0s;
}

.quick-links .link a:hover {
    background: var(--primary-color);
}

.quick-links .link a:hover i, .quick-links .link a:hover h6 {
    color: #ffffff;
}

.quick-links .link a h5 {
    position: relative;
    color: darkslategray;
    font-size: 0.85rem;
}

.quick-links .link a h5::before {
    position: absolute;
    content: "";
    width: 30px;
    height: 2px;
    background: var(--primary-color);
    left: 50%;
    margin-left: -15px;
    bottom: -6px;
}

.row.no-gutter {
    padding-inline: 90px;
    --bs-gutter-x: 0rem;
}

.row.no-gutter .col-lg-2 {
    padding: 0px;
}

.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    --bs-pagination-active-bg: var(--primary-color);
    --bs-pagination-active-border-color: var(--primary-color);
    --bs-pagination-focus-box-shadow: 0 0 0 0.1rem rgb(230, 230, 230);
    --bs-pagination-hover-color: var(--primary-color);
    --bs-pagination-focus-color: var(--primary-color);
}

.page-link {
    color: #3c3b3b;
}

.active > .page-link, .page-link.active {
    z-index: 3;
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.text-danger {
    color: var(--primary-color) !important;
    --bs-text-opacity: 1;
}

.text-primary {
    color: #555 !important;
    --bs-text-opacity: 1;
}

.sticky-action-bar {
    position: fixed;
    bottom: -100px;
    left: 0;
    width: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    pointer-events: none;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sticky-action-bar.show {
    bottom: 30px;
}

.action-bar-content {
    background: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #f0f0f0;
    pointer-events: auto;
}

.btn-floating-search {
    --bs-btn-padding-y: 8px;
    --bs-btn-padding-x: 30px;
    --bs-btn-border-radius: 30px;
    padding: 8px 30px;
    border-radius: 30px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
    transition: transform 0.2s;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-floating-search:active {
    transform: scale(0.95);
}

.btn-floating-search:hover {
    filter: brightness(0.9);
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    }
.auction-timer {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 15;
}

html[dir="rtl"] .auction-timer {
    left: 10px;
    right: auto;
}

.timer-badge {
    padding: 0px 4px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 8px;
    transition: all 0.3s ease;
    /*background: #00000047; */
        border-radius: 6px;
        text-shadow: 0px 0px 6px #000000;
}

.timer-badge i {
    font-size: 1rem;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.countdown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    direction: ltr;
}

.countdown span {
    background: rgba(255,255,255,0.2);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

.img-skeleton-container {
    background: #e2e5e7;
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.5) 20%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200vw 100%;
    animation: shimmer 1.5s infinite linear;
}

html[dir="rtl"] .img-skeleton-container {
    animation-direction: reverse;
}

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

.img-skeleton-container.loaded {
    background: #f8f8f8;
    animation: none;
}

.lazy-image {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.lazy-image.loaded {
    opacity: 1;
}

.results-sort-bar {
    background: #ffffff;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #eaeaea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    transition: box-shadow 0.3s ease;
    width: inherit;
}

.results-sort-bar:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.results-info-group {
    display: flex;
    flex-direction: column;
}

.results-count-large {
    font-size: 21px;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1;
}

.results-count-label {
    font-size: 16px;
    font-weight: 600;
    color: #4b5563;
}

.results-meta-text {
    font-size: 13px;
    color: #6b7280;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.custom-sort-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 170px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    gap: 12px;
    transition: all 0.2s ease;
}

.custom-sort-btn:hover, .custom-sort-btn:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.custom-sort-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 9999;
    width: 220px;
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: none;
    padding: 8px 0;
    overflow: hidden;
}

.sort-option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    font-size: 14px;
    color: #4b5563;
    text-decoration: none;
    transition: background 0.2s;
}

.sort-option-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.sort-option-item.active {
    background: #fff0f0;
    color: var(--primary-color);
    font-weight: 700;
}

@media (max-width: 991px) {
    .results-sort-bar {
        padding: 12px 16px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-radius: 10px;
        margin-bottom: 16px;
        width: 100%;
    }

    .results-info-group {
        display: flex;
        flex-direction: row;
        align-items: baseline;
        gap: 6px;
    }

    .results-count-large {
        font-size: 22px;
    }

    .results-count-label {
        font-size: 14px;
    }

    .results-meta-text {
        display: none !important;
    }

    .sort-control-wrapper {
        width: auto;
        border-top: none;
        padding-top: 0;
        display: flex;
    }

    .custom-sort-btn {
        min-width: unset;
        padding: 8px 12px;
        font-size: 13px;
        margin: 0 !important;
        border-radius: 8px;
    }

    .custom-sort-menu {
        width: 220px;
        top: calc(100% + 5px);
    }

    html[dir="rtl"] .custom-sort-menu {
        right: auto;
        left: 0;
    }

    html[dir="ltr"] .custom-sort-menu {
        left: auto;
        right: 0;
    }

    .mobile-filter-trigger {
        display: flex;
    }

    .mobile-close-btn {
        display: block;
    }

    .sticky-action-bar {
        display: none !important;
    }

    .container-main {
        flex-direction: column;
    }

    .sidebar-area {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        height: 100vh;
        background: white;
        z-index: 10000;
        padding: 60px 20px 20px 20px;
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        visibility: hidden;
    }

    .sidebar-area.active {
        transform: translateX(0);
        visibility: visible;
    }

    .cars-section {
        width: 100%;
        padding: 0 5px;
    }

    .cars-grid {
        grid-template-columns: repeat(1, 1fr) !important;
        gap: 15px;
        padding: 20px;
    }

    .car-img-wrapper {
        height: 220px;
    }

    .car-name {
        font-size: 0.9rem;
    }

    .price-badge {
        font-size: 0.85rem;
        padding: 3px 8px;
    }

    .auction-timer {
        bottom: 8px;
        left: 5px;
        width: calc(100% - 10px);
    }

    .timer-badge {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .results-sort-bar {
        padding: 16px;
        gap: 15px;
    }

    .sort-control-wrapper {
        display: flex;
        align-items: center;
    }

    .custom-sort-btn {
        flex-grow: 1;
        margin-right: 10px;
    }

    html[dir="rtl"] .custom-sort-btn {
        margin-right: 0;
        margin-left: 10px;
    }

    .custom-sort-menu {
        width: 100%;
    }
}