/* ===== MODAL.CSS - MODAL DE DETALHES DO VEÍCULO ===== */

/* Overlay do modal */
.modal-overlay,
.car-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active,
.car-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

/* Container do modal */
.modal,
.car-modal {
    background: var(--branco);
    border-radius: 24px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

.modal.active,
.car-modal.active {
    transform: scale(1);
}

/* Botão fechar */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: var(--branco);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    color: var(--preto);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--verde-primario);
    color: var(--branco);
    transform: rotate(90deg);
}

/* Conteúdo do modal (grid 2 colunas) */
.modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: 90vh;
    overflow-y: auto;
}

/* ===== GALERIA DO MODAL ===== */
.modal-gallery {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 30px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

/* Container da imagem principal */
.main-image-container {
    position: relative;
    width: 100%;
    height: 350px;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.main-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botões de navegação da galeria */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--verde-primario);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 20;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.gallery-nav-btn:hover {
    background: var(--branco);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.gallery-nav-prev {
    left: 15px;
}

.gallery-nav-next {
    right: 15px;
}

/* Contador de mídia */
.gallery-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    color: var(--branco);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 20;
}

/* Miniaturas */
.thumbnails {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 5px;
    scrollbar-width: thin;
}

.thumbnails::-webkit-scrollbar {
    height: 6px;
}

.thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.thumbnails::-webkit-scrollbar-thumb {
    background: var(--verde-secundario);
    border-radius: 10px;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
}

.thumbnail.active {
    opacity: 1;
    border-color: var(--verde-primario);
    box-shadow: 0 0 0 2px rgba(15, 107, 58, 0.3);
}

/* Thumbnail para vídeo */
.thumbnail-wrapper {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.thumbnail-wrapper .thumbnail {
    width: 80px;
    height: 60px;
    opacity: 0.6;
}

.thumbnail-wrapper.active .thumbnail {
    opacity: 1;
    border: 2px solid var(--verde-primario);
}

.thumbnail-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: var(--verde-primario);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--branco);
    font-size: 0.75rem;
    pointer-events: none;
    opacity: 0.9;
}

/* Wrapper para vídeo principal */
.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: var(--verde-primario);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--branco);
    font-size: 1.8rem;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.video-play-btn:hover {
    background: var(--verde-secundario);
    transform: translate(-50%, -50%) scale(1.1);
}

/* ===== DETALHES DO MODAL ===== */
.modal-details {
    padding: 30px;
    overflow-y: auto;
    background: var(--branco);
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--preto);
    margin-bottom: 10px;
    line-height: 1.2;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--cinza);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.modal-subtitle .car-badge {
    position: static;
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.7rem;
}

/* Preço no modal */
.modal-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--verde-primario);
    margin: 20px 0 25px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--borda);
}

.modal-price-currency {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--verde-secundario);
    margin-right: 5px;
}

/* Especificações em grid */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--cinza-claro);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.spec-item:hover {
    background: #e8f0e8;
    transform: translateX(5px);
}

.spec-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--verde-primario), var(--verde-secundario));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--branco);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.spec-content h4 {
    font-size: 0.75rem;
    color: var(--cinza);
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spec-content p {
    font-size: 1rem;
    font-weight: 700;
    color: var(--preto);
}

/* Descrição */
.car-description {
    margin: 25px 0;
    padding: 20px;
    background: var(--cinza-claro);
    border-radius: 16px;
    border-left: 4px solid var(--verde-primario);
}

.description-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--preto);
    display: flex;
    align-items: center;
    gap: 8px;
}

.description-title i {
    color: var(--verde-primario);
}

.description-text {
    color: var(--cinza);
    line-height: 1.7;
    font-size: 0.9rem;
}

/* Botões de ação do modal */
.modal-cta {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.modal-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--verde-primario), var(--verde-secundario));
    color: var(--branco);
}

.modal-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(15, 107, 58, 0.3);
}

.modal-btn-secondary {
    background: transparent;
    color: var(--verde-primario);
    border: 2px solid var(--verde-primario);
}

.modal-btn-secondary:hover {
    background: rgba(15, 107, 58, 0.05);
    transform: translateY(-3px);
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-details {
    animation: slideInUp 0.4s ease-out;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 992px) {
    .modal-content {
        grid-template-columns: 1fr;
    }
    
    .modal-gallery {
        min-height: auto;
    }
    
    .main-image-container {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .modal-title {
        font-size: 1.4rem;
    }
    
    .modal-price {
        font-size: 1.6rem;
    }
    
    .modal-price-currency {
        font-size: 1rem;
    }
    
    .specs-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .modal-cta {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
    
    .main-image-container {
        height: 250px;
    }
    
    .modal-gallery,
    .modal-details {
        padding: 20px;
    }
    
    .gallery-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .video-play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .thumbnail,
    .thumbnail-wrapper .thumbnail {
        width: 60px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .modal-overlay,
    .car-modal-overlay {
        padding: 10px;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .modal-price {
        font-size: 1.3rem;
    }
    
    .spec-item {
        padding: 10px;
    }
    
    .spec-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .spec-content p {
        font-size: 0.85rem;
    }
    
    .car-description {
        padding: 15px;
    }
    
    .description-text {
        font-size: 0.85rem;
    }
}