/* ==========================================================================
   CARMOTOR ERP - DESIGN SYSTEM "LUX" (MASTER CSS)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES GLOBALES
   -------------------------------------------------------------------------- */
:root {
    /* Paleta Premium "Lux" */
    --lux-bg: #f1f5f9;         
    --lux-card: #ffffff;       
    --lux-text-main: #1e293b;
    --lux-text-muted: #64748b;
    --lux-accent: #0f172a;     
    --lux-primary: #245fc1;    /* Azul Carmotor */
    --lux-secondary: #FF6D00;  /* Naranja para botones B2C/Call to Action */
    --lux-border: #e2e8f0;
    --lux-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
    
    /* Tipografías */
    --font-body: 'Manrope', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
    --font-text: 'Open Sans', sans-serif;

    /* Dashboard ERP */
    --sidebar-width: 260px;
    --sidebar-bg: var(--lux-accent);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-text: #cbd5e1;
    --sidebar-active: #ffffff;
}

/* --------------------------------------------------------------------------
   2. RESET Y TIPOGRAFÍA BASE
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    background-color: var(--lux-bg); 
    font-family: var(--font-body); 
    color: var(--lux-text-main);
    -webkit-font-smoothing: antialiased;
    padding-top: 70px; 
}

h1, h2, h3, h4, h5, h6, .car-title-main, .car-title, .car-price, .results-count, .swal2-title { 
    font-family: var(--font-heading); 
}

p, span, label, input, button, .val, .btn-action, .meta-item, .swal2-popup { 
    font-family: var(--font-text); 
}

a { text-decoration: none; color: var(--lux-primary); transition: 0.2s; }
a:hover { color: var(--lux-accent); }

/* --------------------------------------------------------------------------
   3. HEADER & NAVEGACIÓN SUPERIOR
   -------------------------------------------------------------------------- */
.main-header { 
    position: fixed; top: 0; left: 0; right: 0; height: 70px; 
    background: var(--lux-primary); 
    box-shadow: var(--lux-shadow); z-index: 1000; 
    display: flex; align-items: center; justify-content: space-between; padding: 0 5%; 
}

.logo { 
    display: flex; 
    align-items: center; 
    height: 100%; 
    text-decoration: none; 
}

.logo img { 
    max-height: 45px; 
    width: auto; 
    object-fit: contain; 
    
    /* 🔥 Magia Anti-Aliasing (Fuerza el suavizado de bordes mediante la Tarjeta Gráfica) */
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
    
    /* Le exige al navegador que use el mejor algoritmo posible para achicar la imagen */
    image-rendering: high-quality; 
}

.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { color: rgba(255,255,255,0.9); font-weight: 600; transition: 0.3s; font-family: var(--font-body);}
.nav-links a:hover { color: var(--lux-card); }

.btn-post { 
    background: var(--lux-secondary) !important; color: var(--lux-card) !important; 
    padding: 8px 18px; border-radius: 20px; transition: 0.3s; border: none; font-weight: 700 !important;
}
.btn-post:hover { background: #e66000 !important; transform: scale(1.05); box-shadow: 0 4px 10px rgba(255, 109, 0, 0.3); }

.btn-dealer { border: 1px solid rgba(255,255,255,0.5); padding: 7px 16px; border-radius: 20px; font-size: 0.9rem; transition: 0.3s; }
.btn-dealer:hover { background: rgba(255,255,255,0.1); border-color: var(--lux-card); }

.hamburger { display: none; background: none; border: none; color: var(--lux-card); cursor: pointer; transition: 0.3s; align-items: center; justify-content: center;}

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .nav-links { 
        position: fixed; top: 70px; right: -100%; width: 260px; height: calc(100vh - 70px); 
        background: var(--lux-card); flex-direction: column; padding: 30px 20px; 
        box-shadow: -4px 0 25px rgba(0,0,0,0.1); transition: right 0.3s ease; 
    }
    .nav-links.active { right: 0; }
    
    .nav-links a { font-size: 1.1rem; border-bottom: 1px solid var(--lux-border); padding-bottom: 15px; width: 100%; text-align: center; color: var(--lux-text-main); }
    .nav-links a:hover { color: var(--lux-primary); }
    
    .nav-links .btn-post { border-bottom: none; margin-top: 10px; color: var(--lux-card) !important; }
    
    .nav-links .btn-dealer { border-color: var(--lux-primary); color: var(--lux-primary) !important; margin-bottom: 10px; }
    .nav-links .btn-dealer:hover { background: rgba(2, 132, 199, 0.05); }
}

/* --------------------------------------------------------------------------
   4. CONTENEDORES Y GRILLAS GLOBALES
   -------------------------------------------------------------------------- */
.aviso-container { max-width: 1150px; margin: 40px auto; padding: 0 20px; display: grid; grid-template-columns: 1fr 340px; gap: 30px; align-items: start; }
.catalog-container { max-width: 1300px; margin: 40px auto; padding: 0 20px; display: grid; grid-template-columns: 280px 1fr; gap: 35px; align-items: start; }
.form-container { max-width: 800px; margin: 40px auto; background: var(--lux-card); padding: 30px; border-radius: 12px; box-shadow: var(--lux-shadow); }
.home-container { padding: 50px 5%; max-width: 1300px; margin: 0 auto; position: relative; z-index: 1;}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.grid-2-mobile-keep { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; } /* Mantiene 2 columnas en móvil */
.col-span-2 { grid-column: span 2; }
.section-title { font-size: 1.2rem; color: var(--lux-accent); margin: 25px 0 15px; font-weight: 700; border-bottom: 2px solid var(--lux-border); padding-bottom: 10px; }

/* --------------------------------------------------------------------------
   5. FORMULARIOS FLOTANTES (Inputs, Textarea, TomSelect)
   -------------------------------------------------------------------------- */
.input-group { position: relative; margin-bottom: 20px; margin-top: 10px; }
.input-group input, .input-group select, .input-group textarea { 
    width: 100%; padding: 18px 15px 6px; border: 2px solid var(--lux-border); 
    border-radius: 8px; outline: none; font-size: 1rem; background: var(--lux-bg); transition: 0.3s; 
}

.input-group label { 
    position: absolute; top: 16px; left: 15px; color: var(--lux-text-muted); 
    transition: 0.2s ease all; pointer-events: none; background: transparent; padding: 0 4px; font-weight: 600;
}

.input-group input, .input-group select { height: 55px; }
.input-group textarea { min-height: 100px; resize: vertical; padding-top: 20px;}

/* Normalizamos los selects para que no se deformen en distintos navegadores */
.input-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2364748b" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    padding-right: 40px;
}
.input-group input:focus, .input-group textarea:focus { border-color: var(--lux-primary); background: var(--lux-card); }

.input-group input:focus ~ label, .input-group input:valid ~ label, .input-group input:disabled ~ label,
.input-group textarea:focus ~ label, .input-group textarea:valid ~ label, .label-active, .active-label { 
    top: -8px !important; left: 10px !important; font-size: 12px !important; color: var(--lux-primary) !important; 
    font-weight: 700 !important; background: var(--lux-card) !important; border-radius: 4px; z-index: 2;
}

.input-group input:disabled { background-color: #f8fafc; border-style: dashed; color: #94a3b8; }
.ppu-input { text-transform: uppercase; text-align: center; font-size: 1.5rem !important; font-weight: 900; letter-spacing: 3px; }

/* Checkboxes */
.checkbox-group { display: flex; align-items: left; gap: 10px; margin-bottom: 20px; font-size: 0.95rem; font-weight: 600;}
.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--lux-primary); }

/* TomSelect Global */
.ts-wrapper { width: 100%; }
.ts-control { padding: 16px 15px 6px !important; border: 2px solid var(--lux-border) !important; border-radius: 8px !important; background: var(--lux-bg) !important; font-size: 1rem !important; box-shadow: none !important; min-height: 55px;}
.ts-control.focus { border-color: var(--lux-primary) !important; background: var(--lux-card) !important;}
.ts-dropdown { border-radius: 0 0 8px 8px; box-shadow: var(--lux-shadow); border-color: var(--lux-border); }

/* Subdominio Automotoras */
.subdomain-wrapper { display: flex; align-items: center; border: 2px solid var(--lux-border); border-radius: 8px; overflow: hidden; transition: 0.3s; background: var(--lux-bg);}
.subdomain-wrapper:focus-within { border-color: var(--lux-primary); background: var(--lux-card); }
.subdomain-wrapper input { border: none; height: 51px; padding: 10px 15px; font-weight: 700; color: var(--lux-primary); }
.subdomain-suffix { background: var(--lux-border); color: var(--lux-text-muted); padding: 0 15px; height: 55px; display: flex; align-items: center; font-weight: 600; }

/* --------------------------------------------------------------------------
   6. BOTONES GLOBALES
   -------------------------------------------------------------------------- */
.btn-submit, .btn-search, .btn-primary { 
    width: 100%; background: var(--lux-primary); color: white; border: none; padding: 16px; 
    font-size: 1.1rem; font-weight: 700; border-radius: 8px; cursor: pointer; transition: 0.3s; 
    display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-body);
}
.btn-submit:hover, .btn-search:hover, .btn-primary:hover { background: #0369a1; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2); }
.btn-submit:disabled { background: #94a3b8; cursor: not-allowed; transform: none; box-shadow: none;}

/* --------------------------------------------------------------------------
   7. COMPONENTE: TARJETAS DE VEHÍCULOS (Catalogo, Home, Panel)
   -------------------------------------------------------------------------- */
.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
.car-card { background: var(--lux-card); border-radius: 12px; overflow: hidden; box-shadow: var(--lux-shadow); transition: transform 0.3s, box-shadow 0.3s; display: flex; flex-direction: column; text-decoration: none; color: inherit; border: 1px solid var(--lux-border); }
.car-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px -5px rgba(0,0,0,0.1); }
.car-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--lux-border); }
.car-info { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.car-price { font-size: 1.6rem; color: var(--lux-text-main); font-weight: 500; margin-bottom: 8px; order: -1; letter-spacing: -0.5px;} 
.car-title { font-size: 1.1rem; color: var(--lux-text-main); font-weight: 700; line-height: 1.3; margin-bottom: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.car-specs { font-size: 0.85rem; color: var(--lux-text-muted); border-top: 1px solid var(--lux-border); padding-top: 15px; font-weight: 600; display: flex; justify-content: space-between;}
.car-location { font-size: 0.8rem; color: #94a3b8; margin-top: 12px; text-align: right; font-weight: 500;}

.list-view { display: grid; grid-template-columns: 1fr; gap: 20px;}
.list-view .car-card { flex-direction: row; align-items: center; }
.list-view .car-img { width: 300px; height: 100%; flex-shrink: 0; }
.list-view .car-info { flex-direction: row; justify-content: space-between; align-items: center; padding: 25px 30px; gap: 20px;}
.list-view .car-title { font-size: 1.4rem; margin-bottom: 12px;}
.list-view .car-specs { gap: 20px; margin-bottom: 0; border: none; padding: 0;}
.list-view .car-price { font-size: 2rem; text-align: right;}

/* --------------------------------------------------------------------------
   8. MÓDULO: HOME / PORTADA
   -------------------------------------------------------------------------- */
.hero { 
    position: relative; z-index: 100; overflow: visible !important; 
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(2, 132, 199, 0.8) 100%), 
                url('https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    padding: 80px 5%; text-align: center; color: white; min-height: 450px;
    display: flex; flex-direction: column; justify-content: center;
}
.hero h1 { font-size: 3rem; margin-bottom: 15px; letter-spacing: -1px;}
.hero p { font-size: 1.2rem; color: #e2e8f0; margin-bottom: 40px; }

.search-container { max-width: 1000px; margin: 0 auto; width: 100%; position: relative; z-index: 101; }
.search-box { background: var(--lux-card); padding: 15px; border-radius: 12px; box-shadow: var(--lux-shadow); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; z-index: 10; position: relative;}
.btn-filter-toggle { background: var(--lux-bg); color: var(--lux-text-main); border: 1px solid var(--lux-border); font-weight: 700; padding: 16px 20px; border-radius: 8px;}
.advanced-filters { background: var(--lux-card); padding: 20px; border-radius: 0 0 12px 12px; margin-top: -8px; box-shadow: var(--lux-shadow); display: none; gap: 15px; flex-wrap: wrap; align-items: center; border-top: 1px dashed var(--lux-border); position: relative; z-index: 9;}
.advanced-filters.show { display: flex; animation: slideDown 0.3s ease-out;}

/* Dropdowns Home */
.dropdown-multiple-trigger { 
    width: 100%; min-height: 55px; padding: 18px 15px 6px; border: 2px solid var(--lux-border); 
    border-radius: 8px; background: var(--lux-bg); text-align: left; cursor: pointer; color: var(--lux-text-main); font-weight: 600;
}
.dropdown-multiple-content { 
    display: none; position: absolute; top: calc(100% + 4px); left: 0; min-width: 250px; 
    background: var(--lux-card); border: 1px solid var(--lux-border); border-radius: 8px; 
    box-shadow: var(--lux-shadow); max-height: 250px; overflow-y: auto; z-index: 999; padding: 10px; 
}
.dropdown-checkbox-label { padding: 10px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 500;}
.dropdown-checkbox-label:hover { background: var(--lux-bg); }

/* --------------------------------------------------------------------------
   9. MÓDULO: CATÁLOGO Y FILTROS LATERALES
   -------------------------------------------------------------------------- */
.filters-sidebar { background: var(--lux-card); padding: 25px; border-radius: 12px; box-shadow: var(--lux-shadow); border: 1px solid var(--lux-border); position: sticky; top: 90px; }
.filters-sidebar h3 { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 20px;}
.filter-group { margin-bottom: 25px; }
.filter-group > label { font-size: 0.8rem; color: var(--lux-text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; display: block;}
.accordion-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 15px; background: var(--lux-bg); border: 1px solid var(--lux-border); border-radius: 8px; cursor: pointer; font-weight: 700;}
.accordion-header.active { border-radius: 8px 8px 0 0; border-bottom: none; }
.checkbox-group-acc { display: none; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; padding: 15px; border: 1px solid var(--lux-border); border-top: none; border-radius: 0 0 8px 8px; background: var(--lux-card); }
.checkbox-group-acc.show { display: flex; }
.btn-clear { width: 100%; background: var(--lux-bg); border: 1px solid var(--lux-border); padding: 14px; font-weight: 700; border-radius: 8px; color: var(--lux-text-main); cursor: pointer;}
.view-toggles { display: flex; gap: 8px; }
.view-btn { background: var(--lux-bg); border: 1px solid var(--lux-border); padding: 10px; border-radius: 8px; cursor: pointer; color: var(--lux-text-muted); }
.view-btn.active { background: var(--lux-primary); color: white; border-color: var(--lux-primary); }

/* Sliders Generales */
.noUi-connect { background: var(--lux-primary); }
.noUi-target { background: var(--lux-border); border: none; box-shadow: none; height: 6px; }
.noUi-handle { width: 22px !important; height: 22px !important; right: -11px !important; top: -8px !important; border-radius: 50%; border: 3px solid var(--lux-primary); background: white; box-shadow: 0 2px 5px rgba(0,0,0,0.1); cursor: grab;}

/* --------------------------------------------------------------------------
   10. MÓDULO: VISTA DE AVISO
   -------------------------------------------------------------------------- */
.car-title-main { font-size: 1.6rem; font-weight: 600; letter-spacing: -1px; margin-bottom: 5px;}
.badge-unique { display: inline-flex; align-items: center; gap: 6px; background: #f0fdf4; color: #15803d; padding: 6px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; border: 1px solid #bbf7d0; margin-bottom: 10px;}
.gallery-container { background: #000; border-radius: 12px; box-shadow: var(--lux-shadow); overflow: hidden; aspect-ratio: 16/9; position: relative;}
.info-card { background: var(--lux-card); border: 1px solid var(--lux-border); box-shadow: var(--lux-shadow); border-radius: 12px; padding: 30px; margin-bottom: 20px;}
.specs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 20px; }
.sticky-panel { background: var(--lux-card); border: 1px solid var(--lux-border); box-shadow: var(--lux-shadow); border-radius: 12px; padding: 30px; position: sticky; top: 100px; }
.price-tag { font-size: 2.5rem; font-weight: 700; letter-spacing: -1px; border-bottom: 1px solid var(--lux-border); padding-bottom: 20px; margin-bottom: 20px;}

/* --------------------------------------------------------------------------
   11. MÓDULO: DRAG & DROP Y ANIMACIONES (Publicar/Panel)
   -------------------------------------------------------------------------- */
.drop-zone { border: 2px dashed var(--lux-primary); border-radius: 12px; padding: 40px; text-align: center; cursor: pointer; transition: 0.3s; background: #f0f9ff; margin-bottom: 20px; }
.drop-zone.dragover { background: #e0f2fe; border-width: 3px; }
.preview-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 15px; margin-bottom: 20px; }
.preview-card { position: relative; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.2); cursor: grab; background: #000; aspect-ratio: 4/3; }
.preview-card img { width: 100%; height: 100%; object-fit: cover; }

.mic-pulse { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; background: #ef4444; color: white; border-radius: 50%; animation: micPulse 1.5s infinite ease-in-out; }
@keyframes micPulse { 0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); } 100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

/* --------------------------------------------------------------------------
   12. MÓDULO: DASHBOARD ERP (Panel Automotoras)
   -------------------------------------------------------------------------- */
.dashboard-layout { display: flex; height: 100vh; overflow: hidden; background: var(--lux-bg);}
.sidebar { width: var(--sidebar-width); background: var(--lux-accent); color: white; display: flex; flex-direction: column; transition: 0.3s; z-index: 1000; }
.sidebar-brand { height: 70px; display: flex; align-items: center; padding: 0 25px; font-size: 1.4rem; font-weight: 900; background: rgba(0,0,0,0.2); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 14px 25px; color: var(--sidebar-text); font-weight: 600; transition: 0.2s; border-left: 4px solid transparent; }
.nav-item:hover, .nav-item.active { background: var(--sidebar-hover); color: var(--lux-card); border-left-color: var(--lux-primary); }
.main-wrapper { flex-grow: 1; display: flex; flex-direction: column; width: calc(100% - var(--sidebar-width)); }
.topbar { background: var(--lux-card); height: 70px; padding: 0 25px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 10px rgba(0,0,0,0.02); z-index: 100; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 20px; }
.kpi-card { background: var(--lux-card); padding: 25px; border-radius: 12px; box-shadow: var(--lux-shadow); border: 1px solid var(--lux-border); display: flex; align-items: center; gap: 20px; transition: 0.2s;}
.kpi-icon { width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.kpi-number { font-size: 2.2rem; font-weight: 900; color: var(--lux-accent); line-height: 1; margin-top: 5px;}
.inventory-tabs { display: flex; gap: 10px; margin-bottom: 25px; overflow-x: auto; scrollbar-width: none; }
.tab-btn { background: var(--lux-bg); border: 1px solid var(--lux-border); padding: 10px 20px; font-weight: 700; color: var(--lux-text-muted); border-radius: 20px; cursor: pointer; transition: 0.2s;}
.tab-btn.active { background: var(--lux-primary); color: white; border-color: var(--lux-primary); }

/* --------------------------------------------------------------------------
   13. MEDIA QUERIES (Mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    /* Aviso & Catalogo: Bloques pegados a los bordes sin radio */
    .aviso-container, .catalog-container { display: flex; flex-direction: column; padding: 0 0 100px 0; gap: 0; }
    .car-main-header, .sticky-panel, .info-card, .gallery-container, .filters-sidebar { border-radius: 0; border-left: none; border-right: none; margin-bottom: 8px; box-shadow: none; width: 100%;}
    .mobile-fixed-bottom { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--lux-primary); backdrop-filter: blur(10px); padding: 15px; gap: 10px; border-top: 1px solid var(--lux-border); z-index: 100;}
    
    /* Vistas de Lista compactas para móvil */
    .list-view .car-card { flex-direction: row; align-items: stretch; height: 140px; padding: 0; }
    .list-view .car-img { width: 40%; border-radius: 12px 0 0 12px; }
    .list-view .car-info { width: 60%; padding: 15px; }
    .list-view .car-title { 
        font-size: 1rem; 
        display: -webkit-box; 
        -webkit-line-clamp: 2; 
        -webkit-box-orient: vertical; 
        overflow: hidden; 
    }
    .list-view .car-price { font-size: 1.2rem; }
    .list-view .car-location { display: none; }

    /* Dashboard */
    .sidebar { position: absolute; left: 0; top: 0; bottom: 0; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { width: 100%; }
}
/* TRUCO MAESTRO: Evita el parpadeo molesto al arrastrar fotos */
body.is-dragging .preview-card * {
    pointer-events: none !important;
}

.preview-card.drag-over {
    border: 2px dashed #0ea5e9 !important;
    transform: scale(1.03);
    opacity: 0.8;
}

.preview-card.dragging {
    opacity: 0.4;
}
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
    /* Rompe todo a 1 columna excepto la clase especial que lo forzará a 35% y 65% */
    .grid-2-mobile-keep { grid-template-columns: 35% 65%; gap: 10px; } 
    .col-span-2 { grid-column: span 1; }
    .hero h1 { font-size: 2.2rem; }
    .search-box { flex-direction: column; align-items: stretch; }
}


/* =======================================================
   REDISEÑO CHATBOT - ESTILO WHATSAPP (CARMOTOR)
   ======================================================= */

/* 1. Fondo del área de mensajes (Estilo WhatsApp con dibujos de autos) */
#cmChatBody {
    background-color: #e5ecf4 !important;
    /*background-image: url('URL_DE_TU_IMAGEN_DE_AUTOS.png') !important;*/
    background-repeat: repeat !important;
    background-blend-mode: soft-light !important;
    padding: 20px !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 2. Diseño base de las burbujas (Agrandamos y oscurecemos la letra) */
.cm-msg {
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
    padding: 10px 14px !important;
    max-width: 85% !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15) !important;
    word-wrap: break-word;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* 3. Burbuja del Usuario (Alineada a la derecha - Color Verde WhatsApp) */
.cm-msg.user {
    background-color: #dcf8c6 !important;
    color: #000000 !important;
    align-self: flex-end !important;
    margin-left: auto !important;
    border-bottom-right-radius: 0 !important;
}

/* 4. Burbuja del Bot (Alineada a la izquierda - Color Blanco Puro) */
.cm-msg.bot {
    background-color: #ffffff !important;
    color: #000000 !important;
    align-self: flex-start !important;
    margin-right: auto !important;
    border-bottom-left-radius: 0 !important;
    border: 1px solid #e2e8f0 !important;
}

/* 5. Ajuste para que los botones de opciones destaquen bien en el fondo nuevo */
.cm-chat-options {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cm-chat-option-btn {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #000000 !important;
    font-size: 1rem !important;
    border-radius: 8px !important;
    padding: 10px !important;
    text-align: left !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.cm-chat-option-btn:hover:not(:disabled) {
    background-color: #e2e8f0 !important;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}