/*
 * Pagina de detalhes do veiculo.
 * Regras isoladas para proteger a galeria e o conteudo de overflow.
 */

.detail-main,
.detail-main > .gallery,
.vehicle-gallery {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.vehicle-gallery {
    overflow: hidden;
}

.vehicle-gallery .swiper-wrapper,
.vehicle-gallery .swiper-slide,
.gallery-open {
    min-width: 0;
    max-width: 100%;
}

.detail-card,
.interest-card {
    min-width: 0;
    max-width: 100%;
}

.detail-heading h1,
.description,
.spec-grid strong,
.features-grid span {
    overflow-wrap: anywhere;
}

@media (max-width: 860px) {
    .vehicle-detail {
        overflow: clip;
        padding-bottom: 115px;
    }

    .detail-layout {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .breadcrumbs {
        flex-wrap: wrap;
        white-space: normal;
    }

    .vehicle-gallery {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .gallery-open {
        overflow: hidden;
    }

    .gallery-open img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    .spec-grid > div,
    .features-grid > div {
        min-width: 0;
    }

    .mobile-contact-bar {
        gap: 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .mobile-contact-bar > div {
        min-width: 0;
        white-space: nowrap;
    }
}

@media (max-width: 560px) {
    .vehicle-detail {
        padding-top: 92px;
    }

    .vehicle-detail .breadcrumbs {
        display: none;
    }

    .detail-heading {
        margin-bottom: 22px;
    }

    .detail-heading h1 {
        font-size: clamp(1.85rem, 9vw, 2.25rem);
    }

    .share-actions {
        margin-top: 14px;
    }

    .share-actions button {
        width: 46px;
        height: 42px;
        padding: 0;
        display: grid;
        place-items: center;
    }

    .vehicle-gallery {
        border-radius: 11px;
    }

    .gallery-nav {
        width: 42px;
        height: 42px;
    }

    .gallery-count {
        right: 10px;
        bottom: 10px;
    }

    .detail-card {
        width: 100%;
        margin-top: 20px;
        padding: 20px;
    }

    .detail-title h2 {
        font-size: 1.3rem;
    }

    .spec-grid {
        gap: 20px 12px;
    }

    .features-grid {
        gap: 12px 8px;
    }

    .interest-card {
        width: 100%;
        padding: 22px;
    }

    .mobile-contact-bar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .mobile-contact-bar .btn {
        min-height: 44px;
        padding-inline: 14px;
    }
}
