/* --- ESTILO COMPLETO E IDÊNTICO PARA TODOS OS MODAIS --- */

/* --- Base para Modais --- */
body.modal-is-open {
    overflow: hidden;
}

/* --- Modais Genéricos (Features, Details) --- */
.app-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.app-modal.open {
    display: flex;
}

.app-modal-content {
    background: #fff;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    border-radius: 8px;
    padding: 25px;
    position: relative;
}

.app-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.popup-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.popup-body {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #495057; /* var(--vdp-text-color) */
}

/* --- Grid de Features no Popup --- */
.features-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.popup-feature-item {
    background: #f8f9fa; /* var(--vdp-light-gray) */
    padding: 10px;
    border-radius: 5px;
}

/* --- Grid de Detalhes no Popup --- */
.details-popup-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.popup-detail-item {
    background: #f8f9fa; /* var(--vdp-light-gray) */
    padding: 10px;
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap;
}

.popup-detail-label {
    font-weight: bold;
    margin-right: 5px;
}

/* --- MODAL DE TEST DRIVE --- */
#test-drive-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#test-drive-modal-content {
    background: white;
    padding: 30px 40px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

#test-drive-modal-content h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

#test-drive-modal-content p {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
}

.car-selection-info {
    background: #f8f8f8;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

#test-drive-form .form-row {
    display: flex;
    gap: 20px;
}

#test-drive-form .form-row .form-group {
    flex: 1;
}

#test-drive-form .form-group {
    margin-bottom: 15px;
}

#test-drive-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

#test-drive-form input[type="text"],
#test-drive-form input[type="tel"],
#test-drive-form input[type="email"],
#test-drive-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    background-color: #fff;
}

.btn-submit-drive {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background-color: #BF8F3F; /* var(--vdp-primary-color) */
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit-drive:hover {
    background: #a87a2d !important;
}

.form-status {
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
}


/* --- MODAL DE VÍDEO 360 --- */
#video-360-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2001;
    display: none; /* Changed by JS to 'flex' */
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#video-360-modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    padding-top: 50vh;
}

#video-360-modal-content .video-container {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background: transparent;
    border-radius: 5px;
    overflow: hidden;
}

#video-360-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

#close-video-360-modal {
    position: absolute;
    top: 45vh;
    right: 5vw;
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    padding: 5px;
    line-height: 1;
}

/* --- BOTÃO DE FECHAR (COMPARTILHADO) --- */
.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

/* --- RESPONSIVIDADE PARA OS MODAIS --- */
@media (min-width: 500px) {
    .details-popup-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .features-popup-grid {
        grid-template-columns: 1fr;
    }

    #test-drive-form .form-row {
        flex-direction: column;
        gap: 0;
    }

    #video-360-modal-content {
        padding-top: 0;
    }

    #close-video-360-modal {
        top: -5vh;
    }
}

/* --- MODAL DE TEST DRIVE --- */
#test-drive-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 2000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
#test-drive-modal-content { background: white; padding: 30px 40px; border-radius: 10px; width: 90%; max-width: 600px; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.2); max-height: 90vh; overflow-y: auto; }
.close-modal-btn { position: absolute; top: 10px; right: 15px; font-size: 2rem; color: #aaa; background: none; border: none; cursor: pointer; transition: color 0.2s ease-in-out; }
#test-drive-modal-content h2 { text-align: center; margin-top: 0; margin-bottom: 10px; color: #333; }
#test-drive-modal-content p { text-align: center; color: #666; margin-bottom: 25px; }
.car-selection-info { background: #f8f8f8; padding: 10px 15px; border-radius: 5px; margin-bottom: 20px; text-align: center; }
#test-drive-form .form-row { display: flex; gap: 20px; }
#test-drive-form .form-row .form-group { flex: 1; }
#test-drive-form .form-group { margin-bottom: 15px; }
#test-drive-form label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 0.9em; }
#test-drive-form input[type="text"], #test-drive-form input[type="tel"], #test-drive-form input[type="email"], #test-drive-form select { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 1em; background-color: #fff; }
.btn-submit-drive { display: block; width: 100%; padding: 12px; border: none; border-radius: 5px; background: var(--vdp-primary-color); color: white; background-color: #BF8F3F; font-size: 1.1em; font-weight: bold; cursor: pointer; transition: background 0.3s; }
.btn-submit-drive:hover { background: #a87a2d; }
.form-status { margin-top: 15px; text-align: center; font-weight: bold; }


/* --- LOADER --- */
.vdp-loader { text-align: center; padding: 100px 20px; font-size: 1.5rem; color: #666; }
.vdp-loader i { font-size: 2.5rem; color: #BF8F3F; margin-bottom: 20px; display: block; }

/* --- LAYOUT BASE --- */
.vdp-container { --vdp-primary-color: #BF8F3F; --vdp-secondary-color: #000000; --vdp-light-gray: #f8f9fa; --vdp-border-color: #dee2e6; --vdp-text-color: #495057; --vdp-heading-color: #212529; }
body.template-full-width .wrap, body.template-full-width #primary.content-area { width: 100%; max-width: 100%; padding: 0; margin: 0; }
body.modal-is-open { overflow: hidden; }
.vdp-container .vdp-vehicle { max-width: 1280px; margin: 0 auto; padding: 2rem 1rem; }
.vdp-container .vdp-section-title { font-size: 1.8rem; font-weight: 600; margin: 3rem 0 1.5rem 0; padding-bottom: 0.5rem; border-bottom: 2px solid var(--vdp-border-color); }

/* --- GALERIA SUPERIOR --- */
.vdp-container .full-width-gallery { width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; background-color: #f1f1f1; padding: 0; }
.vdp-container .vdp-main-gallery { width: 100%; }
.vdp-container .vdp-main-gallery .swiper-slide { text-align: center; display: flex; align-items: center; justify-content: center; background: #e9e9e9; }
.vdp-container .vdp-main-gallery .swiper-slide a { display: block; width: 100%; height: auto; cursor: pointer; aspect-ratio: 16 / 9; }
.vdp-container .vdp-main-gallery .swiper-slide img { display: block; width: 100%;  object-fit: cover; }
.vdp-container .vdp-main-gallery .swiper-button-next, .vdp-container .vdp-main-gallery .swiper-button-prev { color: var(--vdp-primary-color); }

/* ========================================================== */
/* === [INÍCIO] CORREÇÃO DESKTOP E MOBILE (FINAL) === */
/* ========================================================== */

/* --- SEÇÃO PRINCIPAL (DUAS COLUNAS) --- */
.vdp-container .vdp-core-info { 
    display: flex; 
    gap: 2rem; 
    flex-wrap: wrap; 
    align-items: flex-start; /* <-- CORREÇÃO DO ESPAÇO EM BRANCO (DESKTOP) */
}
.vdp-container .vdp-details-column { 
    flex: 2; 
    min-width: 300px; 
}
.vdp-container .vdp-pricing-column { 
    flex: 1; 
    min-width: 280px; 
    align-self: flex-start; 
    position: sticky; 
    top: 40px; 
}

/* Regras de Show/Hide removidas, pois não são mais necessárias */

/* ========================================================== */
/* === [FIM] CORREÇÃO DESKTOP E MOBILE (FINAL) === */
/* ========================================================== */


.vdp-container .vdp-title { font-size: 2.2rem; margin-top: 0; margin-bottom: 1rem; line-height: 1.2; }
.vdp-media-buttons { margin-bottom: 1.5rem; }
.vdp-media-buttons img { max-width: 180px; height: auto; transition: opacity 0.2s ease; }

/* --- DETALHES DO VEÍCULO --- */
.vdp-details-wrapper { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    width: 100%; 
    gap: 20px; 
}
.vdp-details-block { 
    flex-basis: 48%; 
}
.detail-item { display: flex; flex-wrap: nowrap; margin-bottom: 0.8rem; }
.detail-label { font-weight: 600; color: #000; font-size: 15px; margin-right: 5px; white-space: nowrap; }
.detail-value { color: var(--vdp-text-color); font-size: 15px; }
.view-more-wrapper { margin-top: 1rem; }
.btn-view-more-details { background: none; border: none; color: var(--vdp-primary-color); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0; }

/* --- BOX DE PREÇO --- */
.pricing-box { border: 1px solid var(--vdp-border-color); border-radius: 8px; padding: 1.5rem; background: #fff; text-align: center; }
.price-market { margin-bottom: 1rem; color: var(--vdp-text-color); }
.price-final-label { font-size: 1rem; }
.price-final { font-size: 2.5rem; font-weight: 700; color: var(--vdp-primary-color); margin-bottom: 1.5rem; }
.pricing-actions { display: grid; gap: 0.75rem; }
.vdp-button { display: block; padding: 0.8rem 1rem; text-align: center; text-decoration: none; border-radius: 5px; font-weight: 600; transition: all 0.2s; border: 1px solid transparent; }
.vdp-button.primary { background-color: var(--vdp-primary-color); color: white !important; }
.vdp-button.secondary { background-color: var(--vdp-secondary-color); color: white !important; }
.vdp-button.tertiary { background-color: #fff; color: var(--vdp-secondary-color) !important; border-color: var(--vdp-border-color); }

/* --- FEATURES --- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.feature-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 6px; background: var(--vdp-light-gray); font-size: 0.9rem; }
.feature-item i { color: var(--vdp-primary-color); width: 20px; text-align: center; }
.btn-view-all-features { background: none; border: none; color: var(--vdp-primary-color); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0; margin-top: 1.5rem; display: inline-flex; align-items: center; gap: 8px; }

/* --- CARROS RELACIONADOS (CORRIGIDO) --- */
.related-cars-slider { padding-bottom: 40px; }
.related-car-card { display: block; text-decoration: none; color: inherit; border: 1px solid var(--vdp-border-color); border-radius: 8px; overflow: hidden; background: #fff; height: 100%; display: flex; flex-direction: column; }
.related-car-image { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #f0f0f0; }
.related-car-image img { width: 100%; height: 100%; object-fit: cover; }
.related-car-info { padding: 1rem; flex-grow: 1; }
.related-car-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.5rem 0; color: var(--vdp-heading-color); }
.related-car-price { font-size: 1.2rem; font-weight: 700; color: var(--vdp-primary-color); }
.related-cars-slider .swiper-button-next, .related-cars-slider .swiper-button-prev { color: var(--vdp-primary-color); }

/* --- MODAIS --- */
.app-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; justify-content: center; align-items: center; }
.app-modal.open { display: flex; }
.app-modal-content { background: #fff; max-width: 800px; width: 90%; max-height: 80vh; overflow: auto; border-radius: 8px; padding: 25px; position: relative; }
.app-modal-close { position: absolute; top: 10px; right: 15px; font-size: 24px; cursor: pointer; color: #666; }
.popup-title { font-size: 1.5rem; font-weight: bold; margin-bottom: 1rem; }
.features-popup-grid, .details-popup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }
.popup-feature-item, .popup-detail-item { background: var(--vdp-light-gray); padding: 10px; border-radius: 5px; }
.popup-detail-label { font-weight: bold; margin-right: 5px; }

/* ========================================================== */
/* === [INÍCIO] CORREÇÃO DO LAYOUT MOBILE === */
/* ========================================================== */

/* --- RESPONSIVIDADE --- */
@media (max-width: 900px) {
    /* 1. Empilha as colunas (o JS move o bloco, o CSS empilha) */
    .vdp-container .vdp-core-info { 
        flex-direction: column; 
    }
    
    /* 2. Garante que a coluna de detalhes ocupe 100% (Correção do bug do 1º print) */
    .vdp-container .vdp-details-column {
        width: 100%;
        flex-basis: 100%;
        min-width: 0; /* Reseta o min-width do desktop */
    }

    /* 3. Garante que a coluna de preço (agora estática) ocupe 100% */
    .vdp-container .vdp-pricing-column { 
        position: static; 
        width: 100%; 
        margin: 2rem auto; 
    }

    /* 4. Corrige os detalhes e features para coluna única no mobile */
    .vdp-details-wrapper { 
        flex-direction: column; 
        gap: 0; 
    }
    .vdp-details-block { 
        flex-basis: 100%; 
        width: 100%; 
    }
    .features-grid { 
        grid-template-columns: 1fr; 
    }
    
    /* 5. Regras de Show/Hide removidas */
}

/* Regra de 768px não é mais necessária para isso */
@media (max-width: 768px) {
    /* As regras foram movidas para o bloco de 900px */
}

/* ========================================================== */
/* === [FIM] CORREÇÃO DO LAYOUT MOBILE === */
/* ========================================================== */


/* ========================================================== */
/* === [INÍCIO] NOVOS ESTILOS (COPIADOS DO INVENTORY) === */
/* ========================================================== */

/* === ESTILOS PARA BADGES (360 E CARFAX) === */
.vdp-media-buttons {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}
.vdp-media-buttons .car-badge {
    padding: 0;
    background: none;
    line-height: 0;
}
.vdp-media-buttons .car-badge-360 img {
    max-width: 130px;
    height: auto;
    display: block;
}
.vdp-media-buttons .car-badge-carfax img {
    max-width: 135px;
    height: auto;
    display: block;
}

/* === ESTILOS DE PREÇO (COPIADO DO INVENTORY) === */
.price-info { 
    margin: 10px 0; 
    padding-bottom: 10px;
    border-bottom: 1px solid #eee; 
    text-align: left; /* Alinhado à esquerda para VDP */
}
.price-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 8px; 
    font-size: 1.05em; 
    color: #333;
}
.price-row .price-label {
    font-weight: 400; /* Suave (normal) */
    color: #555;
    font-size: 0.95em; 
}
.price-row .retail-value {
    font-size: 1.05em; 
    color: #333;
    font-weight: 500; /* Suave (medium) */
    text-decoration: none; 
}
.price-row .discount-value {
    font-weight: 500; /* Suave (medium) */
    font-size: 1.05em;
    color: #58c549; /* Cor verde */
}
/* [COMENTADO]
.price-row .trade-in-info {
    font-size: 0.9em;
    color: #777;
    cursor: pointer; 
    margin-left: 4px;
}
*/
.price-row.final-price-row {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e5e5; 
    align-items: flex-end; 
}
.price-row.final-price-row .price-label {
    font-weight: 600; /* Destaque (semi-bold) */
    font-size: 1.1em;
    color: #BF8F3F; 
}
.price-row .sale-price {
    font-size: 1.6em; 
    font-weight: 700; /* Destaque (bold) */
    color: #BF8F3F;
    line-height: 1;
}

/* Sobrescreve estilos antigos do pricing-box que conflitam */
.pricing-box .price-market,
.pricing-box .price-final-label,
.pricing-box .price-final {
    display: none; /* Oculta a estrutura de preço antiga */
}
.pricing-box {
    text-align: left; /* Alinha o box de preço à esquerda */
}
.pricing-actions {
    margin-top: 1.5rem; /* Adiciona espaço entre preço e botões */
}


/* === [COMENTADO] ESTILOS PARA MODAL TRADE-IN === */
/*
.fazza-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none; 
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.fazza-modal-overlay.active {
    display: flex;
    opacity: 1;
}
.fazza-modal-content {
    background: white;
    padding: 30px 40px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px; 
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.fazza-modal-overlay.active .fazza-modal-content {
    transform: scale(1);
}
.fazza-modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
    z-index: 10;
}
.fazza-modal-close-btn:hover {
    color: #888;
}
.fazza-modal-content h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.fazza-modal-content h2 .fas {
    color: #BF8F3F; 
}
.fazza-modal-content p {
    text-align: center;
    color: #555;
    font-size: 1.05em;
    line-height: 1.6;
    margin-bottom: 20px;
}
.fazza-modal-content p.disclaimer {
    font-size: 0.9em;
    color: #888;
    margin-top: 25px;
    margin-bottom: 0;
    border-top: 1px solid #eee;
    padding-top: 15px;
}
*/