/* ===================================
   THEME TOGGLE - DARK/LIGHT MODE CORRIGIDO
   Fix: Scrollbar dupla removida
   =================================== */

/* ===================================
   VARIÁVEIS DO TEMA
   =================================== */
:root {
    --bg-color: #ffffff;
    --text-color: #1F2937;
    --navbar-bg: #1F2937;
    --card-bg: #ffffff;
    --border-color: #E5E7EB;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-color: #0a0e1a;
    --bg-secondary: #0f1419;
    --text-color: #e2e8f0;
    --navbar-bg: #0f1419;
    --card-bg: rgba(32, 49, 56, 0.4);
    --border-color: rgba(96, 165, 250, 0.3);
    --shadow-color: rgba(96, 165, 250, 0.2);
    --accent-blue: #60A5FA;
    --accent-blue-dark: #3B82C8;
}

/* ===================================
   BACKGROUND DARK - SEM OVERFLOW FORÇADO
   =================================== */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease;
}

[data-theme="dark"] body {
    background-color: #0a0e1a;
    background-image: 
        radial-gradient(at 20% 30%, rgba(96, 165, 250, 0.05) 0%, transparent 50%),
        radial-gradient(at 80% 70%, rgba(59, 130, 200, 0.05) 0%, transparent 50%);
}

[data-theme="dark"] .bg-light {
    background-color: #0f1419 !important;
}

[data-theme="dark"] .bg-white {
    background-color: #0f1419 !important;
}

/* ===================================
   SEÇÕES COM BOLAS DECORATIVAS
   EXCLUINDO: parallax-banner e hero-section
   =================================== */
[data-theme="dark"] section:not(.parallax-banner):not(.hero-section):not(.hero-carousel) {
    position: relative;
    isolation: isolate;
}

[data-theme="dark"] section:not(.parallax-banner):not(.hero-section):not(.hero-carousel)::before {
    content: '';
    position: absolute;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.15), transparent 70%);
    filter: blur(80px);
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] section:not(.parallax-banner):not(.hero-section):not(.hero-carousel):nth-of-type(odd)::before {
    top: 20%;
    left: -15%;
}

[data-theme="dark"] section:not(.parallax-banner):not(.hero-section):not(.hero-carousel):nth-of-type(even)::before {
    top: 20%;
    right: -15%;
}

[data-theme="dark"] section:not(.parallax-banner):not(.hero-section):not(.hero-carousel) > * {
    position: relative;
    z-index: 1;
}

/* ===================================
   DIVISÓRIAS COM CLARÃO AZUL
   EXCLUINDO: parallax-banner, hero-section e footer
   =================================== */
[data-theme="dark"] section:not(.parallax-banner):not(.hero-section):not(.hero-carousel)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(96, 165, 250, 0.1) 10%, 
        rgba(96, 165, 250, 0.6) 50%, 
        rgba(96, 165, 250, 0.1) 90%, 
        transparent 100%
    );
    box-shadow: 
        0 0 20px rgba(96, 165, 250, 0.4),
        0 0 40px rgba(96, 165, 250, 0.2);
    z-index: 2;
}

/* Remover linha divisória do footer */
[data-theme="dark"] footer::after {
    display: none !important;
}

/* ===================================
   HERO E PARALLAX - SEM ONDAS NO DARK
   =================================== */
[data-theme="dark"] .hero-section::after,
[data-theme="dark"] .hero-slide::after {
    display: none !important;
}

/* ===================================
   BOTÃO DE TEMA
   =================================== */
.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 2px solid rgba(96, 165, 250, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    padding: 0;
    z-index: 10;
    margin-right: 0.75rem;
}

.theme-toggle:hover {
    border-color: rgba(96, 165, 250, 0.8);
    background: rgba(96, 165, 250, 0.15);
    transform: scale(1.05);
}

.theme-toggle i {
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

.theme-toggle .fa-sun {
    color: #FDB022;
    filter: drop-shadow(0 0 8px rgba(253, 176, 34, 0.6));
}

.theme-toggle .fa-moon {
    color: #60A5FA;
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.6));
}

@keyframes flashPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.theme-toggle.flash {
    animation: flashPulse 0.6s ease-out;
}

@keyframes iconRotate {
    0% { transform: rotate(0deg) scale(1); opacity: 1; }
    50% { transform: rotate(180deg) scale(0.8); opacity: 0.5; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

.theme-toggle i.rotating {
    animation: iconRotate 0.6s ease-in-out;
}

/* ===================================
   TÍTULOS AZUL CLARO NO DARK
   =================================== */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] .section-title h2 {
    color: #93C5FD !important;
    text-shadow: none;
}

[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5 {
    color: #93C5FD;
}

[data-theme="dark"] .section-title::after {
    background: linear-gradient(90deg, transparent, #60A5FA, transparent);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.5);
}

/* ===================================
   NAVBAR DARK
   =================================== */
[data-theme="dark"] .navbar {
    background-color: rgba(15, 20, 25, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(96, 165, 250, 0.2);
    box-shadow: 0 4px 20px rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .navbar-dark .navbar-nav .nav-link:hover {
    color: #93C5FD;
}

[data-theme="dark"] .navbar-dark .navbar-nav .nav-link.active {
    color: #60A5FA;
}

/* ===================================
   MENU NAVIGATION COM LINHAS ANIMADAS
   =================================== */
.navbar-nav .nav-link {
    position: relative;
    padding: 0.5rem 1rem !important;
    font-weight: 500;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3B82C8, transparent);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-nav .nav-link:hover::after {
    width: 40px;
}

.navbar-nav .nav-link.active::after {
    width: 40px;
    background: linear-gradient(90deg, transparent, #60A5FA, transparent);
}

[data-theme="dark"] .navbar-nav .nav-link::after {
    background: linear-gradient(90deg, transparent, #60A5FA, transparent);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.8);
}

[data-theme="dark"] .navbar-nav .nav-link.active::after {
    background: linear-gradient(90deg, transparent, #93C5FD, transparent);
    box-shadow: 0 0 15px rgba(147, 197, 253, 1);
}

/* ===================================
   FILTRO ESCURO NAS IMAGENS (DARK MODE)
   =================================== */
[data-theme="dark"] .owl-carousel .owl-item img {
    filter: brightness(0.6) contrast(1.1);
}

[data-theme="dark"] .owl-carousel:hover .owl-item img {
    filter: brightness(0.7) contrast(1.1);
}

[data-theme="dark"] .vehicle-card img,
[data-theme="dark"] .blog-card img {
    filter: brightness(0.7) contrast(1.1);
    transition: filter 0.3s ease;
}

[data-theme="dark"] .vehicle-card:hover img,
[data-theme="dark"] .blog-card:hover img {
    filter: brightness(0.85) contrast(1.1);
}

/* ===================================
   CARDS COM GLASSMORPHISM
   =================================== */
[data-theme="dark"] .card,
[data-theme="dark"] .vehicle-card,
[data-theme="dark"] .blog-card,
[data-theme="dark"] .testimonial-card,
[data-theme="dark"] .info-box,
[data-theme="dark"] .contact-form,
[data-theme="dark"] .info-box-contact,
[data-theme="dark"] .blog-content,
[data-theme="dark"] .filter-section {
    background: rgba(32, 49, 56, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(96, 165, 250, 0.3);
    box-shadow: 0 8px 32px rgba(96, 165, 250, 0.15);
    color: var(--text-color);
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .vehicle-card:hover,
[data-theme="dark"] .blog-card:hover,
[data-theme="dark"] .testimonial-card:hover {
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 
        0 0 20px rgba(96, 165, 250, 0.3),
        0 8px 32px rgba(96, 165, 250, 0.25);
    transform: translateY(-8px);
}

/* ===================================
   INFO CARDS (DARK MODE)
   =================================== */
[data-theme="dark"] .info-card {
    background: rgba(32, 49, 56, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(96, 165, 250, 0.3);
    box-shadow: 
        0px 3px 6px rgba(96, 165, 250, 0.1),
        0px 8px 15px rgba(96, 165, 250, 0.15),
        0 0 0 1px rgba(96, 165, 250, 0.2);
}

[data-theme="dark"] .info-card::before {
    background-color: rgba(96, 165, 250, 0.03);
}

[data-theme="dark"] .info-card:hover {
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 
        0 0 20px rgba(96, 165, 250, 0.3),
        0px 8px 32px rgba(96, 165, 250, 0.25),
        0 0 0 1px rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .info-card .icon::after {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(96, 165, 250, 0.1));
    border-color: rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .info-card .icon i,
[data-theme="dark"] .info-box i {
    color: #60A5FA;
    filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.6));
}

[data-theme="dark"] .info-card h4 {
    color: #93C5FD;
}

[data-theme="dark"] .info-card p {
    color: #cbd5e1;
}

[data-theme="dark"] .info-card .shine::before {
    background: conic-gradient(
        from 205deg at 50% 50%,
        rgba(96, 165, 250, 0) 0deg,
        #60A5FA 25deg,
        rgba(96, 165, 250, 0.5) 295deg,
        rgba(96, 165, 250, 0) 360deg
    );
}

[data-theme="dark"] .info-card .tile {
    background-color: rgba(96, 165, 250, 0.12);
}

[data-theme="dark"] .info-card .line::before,
[data-theme="dark"] .info-card .line::after {
    background: linear-gradient(90deg, transparent, #60A5FA, transparent);
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
}

[data-theme="dark"] .info-card:hover .icon::after {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.3), rgba(96, 165, 250, 0.2));
    border-color: rgba(96, 165, 250, 0.6);
}

[data-theme="dark"] .info-card:hover .icon i {
    color: #93C5FD;
    filter: drop-shadow(0 0 15px rgba(147, 197, 253, 0.8));
}

/* ===================================
   LIST-GROUP GLASSMORPHISM
   =================================== */
[data-theme="dark"] .list-group,
[data-theme="dark"] .list-group-flush {
    background: rgba(32, 49, 56, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(96, 165, 250, 0.3);
    box-shadow: 0 8px 32px rgba(96, 165, 250, 0.15);
    border-radius: 12px;
    overflow: visible !important;
}

[data-theme="dark"] .list-group-item,
[data-theme="dark"] .list-group-flush .list-group-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(96, 165, 250, 0.1);
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem 1.25rem;
    overflow: visible !important;
    position: relative;
}

[data-theme="dark"] .list-group-item:last-child,
[data-theme="dark"] .list-group-flush .list-group-item:last-child {
    border-bottom: none;
}

[data-theme="dark"] .list-group-item:hover,
[data-theme="dark"] .list-group-flush .list-group-item:hover {
    background: rgba(96, 165, 250, 0.08);
    padding-left: 1.5rem;
}

[data-theme="dark"] .list-group-item-action {
    color: var(--text-color);
}

[data-theme="dark"] .list-group-item-action:hover {
    background: rgba(96, 165, 250, 0.08);
    color: #93C5FD;
}

[data-theme="dark"] .list-group-item:hover i {
    color: #60A5FA;
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.6));
    transition: all 0.3s ease;
}

[data-theme="dark"] .list-group-item .badge {
    background: rgba(96, 165, 250, 0.2);
    color: #93C5FD;
    border: 1px solid rgba(96, 165, 250, 0.3);
    transition: all 0.3s ease;
}

[data-theme="dark"] .list-group-item:hover .badge {
    background: rgba(96, 165, 250, 0.3);
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.4);
}

/* ===================================
   INPUTS E FORMULÁRIOS
   =================================== */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] input,
[data-theme="dark"] textarea {
    background-color: rgba(15, 20, 25, 0.8);
    border-color: rgba(96, 165, 250, 0.3);
    color: var(--text-color);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus {
    background-color: rgba(15, 20, 25, 0.9);
    border-color: #60A5FA;
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25),
                0 0 15px rgba(96, 165, 250, 0.3);
    color: var(--text-color);
}

/* Placeholders azuis claros no dark */
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .form-select::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #93C5FD !important;
    opacity: 0.7;
}

[data-theme="dark"] .form-control:focus::placeholder,
[data-theme="dark"] input:focus::placeholder,
[data-theme="dark"] textarea:focus::placeholder {
    color: #60A5FA !important;
    opacity: 0.8;
}

/* ===================================
   FOOTER
   =================================== */
[data-theme="dark"] footer {
    background: linear-gradient(180deg, rgba(15, 20, 25, 0.98), rgba(10, 14, 26, 1));
    border-top: 1px solid rgba(96, 165, 250, 0.2);
    box-shadow: 0 -4px 20px rgba(96, 165, 250, 0.1);
    position: relative;
    z-index: 10;
}

[data-theme="dark"] footer a {
    color: rgba(255, 255, 255, 0.7) !important;
}

[data-theme="dark"] footer a:hover {
    color: #93C5FD !important;
    text-decoration: none !important;
}

[data-theme="dark"] footer .social-links a:hover {
    color: #93C5FD !important;
}

/* ===================================
   BOTÕES
   =================================== */
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #60A5FA, #3B82C8);
    border: none;
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #93C5FD, #60A5FA);
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.6);
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-outline-primary {
    color: #60A5FA;
    border-color: #60A5FA;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background: linear-gradient(135deg, #60A5FA, #3B82C8);
    border-color: transparent;
    color: white;
}

/* ===================================
   TEXTO
   =================================== */
[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-theme="dark"] p {
    color: #cbd5e1;
}

/* ===================================
   BADGES
   =================================== */
[data-theme="dark"] .vehicle-badge,
[data-theme="dark"] .category-badge {
    background: linear-gradient(135deg, #60A5FA, #3B82C8);
    color: white;
    border: 1px solid rgba(96, 165, 250, 0.5);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .vehicle-price {
    color: #60A5FA;
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.5);
}

/* ===================================
   SCROLLBAR DARK - FINA E BONITA
   =================================== */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0f1419;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #60A5FA, #3B82C8);
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #93C5FD, #60A5FA);
}

/* ===================================
   TRANSIÇÃO
   =================================== */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease,
                box-shadow 0.3s ease !important;
}

/* ===================================
   RESPONSIVO
   =================================== */
@media (max-width: 991px) {
    .theme-toggle {
        margin-left: auto;
        margin-right: 1rem;
    }
}

@media (max-width: 768px) {
    [data-theme="dark"] section:not(.parallax-banner):not(.hero-section):not(.hero-carousel)::before {
        width: 60vw;
        height: 60vw;
    }
}

/* ===================================
   ACESSIBILIDADE
   =================================== */
.theme-toggle:focus {
    outline: 2px solid #60A5FA;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .theme-toggle,
    .theme-toggle i,
    .navbar-nav .nav-link,
    .navbar-nav .nav-link::after,
    [data-theme="dark"] section::before {
        transition: none !important;
        animation: none !important;
    }
}

/* ===================================
   CORREÇÃO DEFINITIVA - CTA OVERFLOW
   =================================== */

/* Remover TODOS os pseudo-elementos da CTA */
.cta-section::before,
.cta-section::after,
[data-theme="dark"] .cta-section::before,
[data-theme="dark"] .cta-section::after {
    display: none !important;
    content: none !important;
}

/* Garantir overflow hidden na CTA */
.cta-section {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

/* Garantir que o container dentro da CTA também não cause overflow */
.cta-section .container,
.cta-section .row,
.cta-section .col-lg-8 {
    overflow: visible !important;
    max-width: 100% !important;
}

/* Dark mode - forçar overflow hidden */
[data-theme="dark"] .cta-section {
    overflow: hidden !important;
    overflow-x: hidden !important;
    position: relative !important;
    isolation: isolate !important;
}

/* Remover efeitos decorativos que causam overflow */
[data-theme="dark"] section.cta-section::before,
[data-theme="dark"] section.cta-section::after {
    content: none !important;
    display: none !important;
}

/* Garantir que nenhum elemento filho cause overflow */
.cta-section * {
    max-width: 100% !important;
}

/* IMPORTANTE: Excluir CTA de TODOS os seletores */
[data-theme="dark"] section:not(.cta-section):not(.parallax-banner):not(.hero-section):not(.hero-carousel) {
    position: relative;
    isolation: isolate;
}

[data-theme="dark"] section:not(.cta-section):not(.parallax-banner):not(.hero-section):not(.hero-carousel)::before {
    content: '';
    position: absolute;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.15), transparent 70%);
    filter: blur(80px);
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] section:not(.cta-section):not(.parallax-banner):not(.hero-section):not(.hero-carousel):nth-of-type(odd)::before {
    top: 20%;
    left: -15%;
}

[data-theme="dark"] section:not(.cta-section):not(.parallax-banner):not(.hero-section):not(.hero-carousel):nth-of-type(even)::before {
    top: 20%;
    right: -15%;
}

/* Divisórias - excluir CTA */
[data-theme="dark"] section:not(.cta-section):not(.parallax-banner):not(.hero-section):not(.hero-carousel):not(footer)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(96, 165, 250, 0.1) 10%, 
        rgba(96, 165, 250, 0.6) 50%, 
        rgba(96, 165, 250, 0.1) 90%, 
        transparent 100%
    );
    box-shadow: 
        0 0 20px rgba(96, 165, 250, 0.4),
        0 0 40px rgba(96, 165, 250, 0.2);
    z-index: 2;
}