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

* {
    box-sizing: border-box;
}

@media (max-width: 576px) {
    .container {
        padding: 15px 10px;
        margin: 10px auto;
        border-radius: 0;
    }
}

.details-wrapper {
    max-width: 100%;
    margin: 20px auto;
    display: grid;
    grid-template-columns: 2.9fr 1fr;
    gap: 20px;
    align-items: start;
    padding-inline:15px;
}

.header-spec {
    font-size: 1.2rem;
    color: #1e1e1e;
}

.gallery-container {
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #eee;
    width: 100%;
}

.main-img-box {
    width: 100%;
    background: #f8f8f8;
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
    cursor: zoom-in;
    position: relative;
}

.main-img-box img {
    width: 100%;
    height: 100%;
    min-height: 600px;
    max-height: 600px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thumbs-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    width: 100%;
}

.thumb-item {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: all 0.2s;
}

.thumb-item:hover, .thumb-item.active {
    opacity: 1;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
    animation: zoomIn 0.3s;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-lightbox:hover {
    color: var(--primary-color);
}

@keyframes zoomIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.specs-panel {
    background: #fff;
    border-radius: 16px;
    margin-top: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    margin-bottom: 25px;
    border: 1px solid #f1f1f1;
    width: 100%;
}

.panel-title {
    margin-bottom: 20px;
    color: #222;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title i {
    color: var(--primary-color);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

@media (max-width: 400px) {
    .specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.spec-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px 5px;
    text-align: center;
    transition: transform 0.2s;
    border: 1px solid #eee;
}

.spec-card:hover {
    transform: translateY(-3px);
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
}

.spec-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: none;
}

.spec-label {
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 4px;
}

.spec-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
}

.inspection-panel {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border: 1px solid #f1f1f1;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.insp-main-img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 15px;
}

.sidebar-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 80px;
    height: fit-content;
    z-index: 10;
}

.price-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    text-align: center;
}

.car-main-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 15px;
    line-height: 1.4;
}

.price-box {
    background: #f9f9f9;
    color: var(--primary-color);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px dashed var(--primary-color);
}

.price-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
    padding-inline: 6px;
    justify-self: start;
}

.price-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.price-curr {
    font-size: 1rem;
    font-weight: 600;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    margin-bottom: 10px;
    font-size: 1rem;
    border: none;
    cursor: pointer;
}

.btn-wapp {
    background: #25D366;
    color: #fff;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-wapp:hover {
    background: #128C7E;
    color: #fff;
    transform: translateY(-2px);
}

.btn-fav-outline {
    background: #fff;
    color: #333;
    border: 2px solid #eee;
}

.btn-fav-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.auction-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: start;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 10px;
    align-items: center;
}

.info-row span:first-child {
    color: #777;
}

.auct-sourc {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    color: white;
    padding: 5px 2px 2px;
    font-weight: bold;
}

.tags-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
    padding: 0;
}

.tag {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #ffffff;
    padding: 6px 14px 6px 8px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8d8d8d;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.circle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff !important;
}

.circle.w { background-color: #8d8d8d; }
.circle.x { background-color: #8d8d8d; }
.circle.rx, .circle.r { background-color: #8d8d8d; }

.similar-cars-section {
    position: relative;
    overflow: hidden;
}

.similar-cars-section .swiper-button-next,
.similar-cars-section .swiper-button-prev {
    color: #333;
    background-color: rgba(255, 255, 255, 0.95);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.similar-cars-section .swiper-button-next:hover,
.similar-cars-section .swiper-button-prev:hover {
    background-color: #686766;
    color: #fff;
}

.similar-cars-section .swiper-button-next::after,
.similar-cars-section .swiper-button-prev::after {
    font-size: 18px;
    font-weight: bold;
}

@media (max-width: 991px) {
    .details-wrapper {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 0;
    }

    .main-content {
        position: static;
        width: 100%;
    }

    .sidebar-wrapper {
        position: static;
        width: 100%;
        order: 1;
        margin-top: 10px;
        margin-bottom: 5px;
    }

    .main-img-box {
        height: 100%;
        min-height: 200px !important;
    }

    .main-img-box img {
        min-height: 200px !important;
        max-height: 150px;


    }

    .thumbs-grid {
        display: grid !important;
        grid-template-columns: none !important;
        grid-template-rows: repeat(2, 60px) !important;
        grid-auto-flow: column !important;
        grid-auto-columns: 85px !important;
        gap: 8px;
        overflow-x: auto;
        padding: 10px 15px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .thumb-item {
        width: 100%;
        height: 100%;
        object-fit: cover;
        scroll-snap-align: start;
    }

    .thumbs-grid::-webkit-scrollbar {
        height: 4px;
    }

    .thumbs-grid::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .thumbs-grid::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 10px;
    }

    .gallery-container {
        margin-bottom: 20px;
    }

    .car-main-title {
        font-size: 1.3rem;
    }

    .specs-panel, .inspection-panel, .price-card {
        padding: 15px;
    }

    .specs-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .spec-card {
        padding: 12px 5px;
    }

    .inspection-panel {
        overflow: hidden !important;
    }

    #smart-damage-map {
        width: 100%;
        display: flex !important;
        justify-content: center !important;
        overflow: hidden !important;
        padding-top: 15px;
    }

    .car_blueprint {
        transform: scale(0.60) !important;
        transform-origin: top center;
        margin-bottom: -120px !important;
        flex-shrink: 0 !important;
    }

    .tags-container {
        padding: 0 10px !important;
        gap: 8px;
        margin-top: 15px;
    }

    .tag {
        padding: 4px 10px 4px 6px;
        font-size: 0.8rem;
    }

    .circle {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
    }

    .similar-cars-section .swiper-button-next,
    .similar-cars-section .swiper-button-prev {
        display: none;
    }
}

@media (max-width: 380px) {
    .car_blueprint {
        transform: scale(0.50) !important;
        margin-bottom: -150px !important;
    }

    .specs-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.whatsapp-float {
    display: none !important;
}