/* ══════════════════════════════════════════════════════════
   AutoSaaS Frontend - main.css
   Variables de colores vienen del layout (tenant dinámico)
   ══════════════════════════════════════════════════════════ */

/* ── Variables globales ─────────────────────────────────── */
:root {
    --color-primary:       #1a56db;
    --color-secondary:     #7e3af2;
    --color-primary-dark:  #1241a8;
    --color-primary-light: #eff6ff;
    --font-base:           'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-card:         12px;
    --shadow-card:         0 2px 12px rgba(0,0,0,.08);
    --header-height:       64px;
    --transition:          .2s ease;
}

/* ── Reset / Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-base);
    color: #1e2329;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--color-primary); transition: color var(--transition); }
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; height: auto; }

/* ── Bootstrap overrides ────────────────────────────────── */
.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}
.btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-outline-primary:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.text-primary { color: var(--color-primary) !important; }
.bg-primary   { background-color: var(--color-primary) !important; }

.pagination .page-item.active .page-link {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.page-link { color: var(--color-primary); }

/* ── Header / Navbar ────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 1030; }

.navbar { min-height: var(--header-height); padding: .5rem 0; }

.navbar-logo { object-fit: contain; }

.navbar-nav .nav-link {
    font-weight: 500;
    color: #374151;
    padding: .5rem .75rem;
    border-radius: 6px;
    transition: background var(--transition), color var(--transition);
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ── Hero Carousel ──────────────────────────────────────── */
.hero-carousel-section { position: relative; }

.hero-slide {
    height: 450px !important;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    position: relative;
}
@media (max-width: 768px) { .hero-slide { height: 380px; } }

.hero-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,.3) 100%);
}
.hero-slide-content {
    position: relative;
    z-index: 2;
    padding: 2rem 0;
}

.hero-title { text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.hero-subtitle { text-shadow: 0 1px 4px rgba(0,0,0,.3); }

/* Buscador flotante debajo del carrusel */
.hero-search-bar {
    background: var(--color-primary);
    padding: 1.25rem 0;
}
.hero-search-form .form-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.hero-search-form .form-select { border: none; box-shadow: none; font-size: .875rem; }
.hero-search-form .form-select:focus { box-shadow: 0 0 0 .2rem rgba(255,193,7,.5); }

/* ── Hero Estático ──────────────────────────────────────── */
.hero-static-section {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.hero-overlay,
.hero-gradient {
    position: absolute;
    inset: 0;
}
.hero-overlay  { background: rgba(0,0,0,.5); }
.hero-gradient { background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%); }

.hero-static-content {
    position: relative;
    z-index: 2;
    padding: 5rem 0 6rem;
    color: white;
}

.hero-stat-num { line-height: 1; }

.hero-inline-search .input-group { border-radius: 10px; overflow: hidden; }
.hero-inline-search .form-control { border-radius: 10px 0 0 10px; padding: .875rem 1.25rem; }

.badge-filter {
    background: rgba(255,255,255,.15);
    color: white;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 20px;
    padding: .35rem .9rem;
    font-size: .8rem;
    text-decoration: none;
    transition: background var(--transition);
}
.badge-filter:hover { background: rgba(255,255,255,.3); color: white; }

/* ── Secciones ──────────────────────────────────────────── */
.section-vehicles { }
.section-brands   { }
.section-cta      { }

.section-header {}

/* ── Vehicle Card ───────────────────────────────────────── */
.vehicle-card {
    border-radius: var(--radius-card);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.vehicle-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }

.vehicle-card-img-wrap { position: relative; overflow: hidden; }

.vehicle-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform .3s ease;
    display: block;
}
.vehicle-card:hover .vehicle-thumb { transform: scale(1.03); }

.badge-featured, .badge-condition {
    position: absolute;
    top: .6rem;
    left: .6rem;
    padding: .25rem .6rem;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.4;
}
.badge-condition { left: auto; right: .6rem; }
.badge-featured  { background: var(--color-primary); color: white; }
.badge-new       { background: #16a34a; color: white; }
.badge-used      { background: #6b7280; color: white; }

.vehicle-card-title a:hover { color: var(--color-primary) !important; }
.vehicle-card-specs span    { font-size: .78rem; }
.price-main                 { font-size: 1.05rem; }

/* ── Brands scroll ──────────────────────────────────────── */
.brands-scroll { gap: .5rem; }
.brand-chip { font-size: .8rem; border-radius: 20px; }

/* ── Catalog ────────────────────────────────────────────── */
.filters-panel { border-radius: var(--radius-card); }
.catalog-toolbar { border-bottom: 1px solid #e9ecef; padding-bottom: .75rem; }

/* ── Vehicle Detail ─────────────────────────────────────── */
.vehicle-main-img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: var(--radius-card);
}
@media (max-width: 576px) { .vehicle-main-img { height: 260px; } }

.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.gallery-thumb {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition);
    flex-shrink: 0;
}
.gallery-thumb:hover,
.gallery-thumb.active { border-color: var(--color-primary); }

.vehicle-price-box  { border-radius: var(--radius-card); }
.vehicle-specs td   { padding: .5rem .75rem; vertical-align: middle; }
.vehicle-specs tbody tr:not(:last-child) { border-bottom: 1px solid #f3f4f6; }

.feature-item  { padding: .25rem 0; }

/* ── CTA section ────────────────────────────────────────── */
.section-cta { }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer   { margin-top: auto; }
.footer-main   { background: #1a1d23; color: #9ca3af; }
.footer-bottom { background: #111317; color: #6b7280; font-size: .8rem; }

.footer-title { color: #f9fafb; font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .75rem; }
.footer-desc  { font-size: .875rem; line-height: 1.6; margin-top: .5rem; }
.footer-links a { color: #9ca3af; text-decoration: none; font-size: .875rem; display: block; margin-bottom: .4rem; transition: color var(--transition); }
.footer-links a:hover { color: #f9fafb; }
.footer-contact a,
.footer-contact li { color: #9ca3af; text-decoration: none; font-size: .875rem; display: flex; align-items: center; margin-bottom: .5rem; }
.footer-contact a:hover { color: #f9fafb; }
.footer-legal a { color: #6b7280; text-decoration: none; font-size: .78rem; transition: color var(--transition); }
.footer-legal a:hover { color: #9ca3af; }

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: #9ca3af;
    font-size: 1rem;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.social-link:hover { background: var(--color-primary); color: white; }

/* ── WhatsApp FAB ───────────────────────────────────────── */
.wa-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1040;
    background: #25d366;
    color: white;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37,211,102,.5);
    transition: transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
}
.wa-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37,211,102,.65);
    color: white;
}

/* ── Scroll to top ──────────────────────────────────────── */
.scroll-top-btn {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    z-index: 1035;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    transition: opacity var(--transition), transform var(--transition);
}
.scroll-top-btn:hover { transform: translateY(-2px); }

/* ── Contact page ───────────────────────────────────────── */
.contact-info-list li { align-items: flex-start; }
.branch-item:last-child { border-bottom: none !important; padding-bottom: 0 !important; margin-bottom: 0 !important; }

/* ── CMS page ───────────────────────────────────────────── */
.cms-content { line-height: 1.8; }
.cms-content h2, .cms-content h3 { margin-top: 2rem; }
.cms-content img { border-radius: 8px; margin: 1rem 0; }

/* ── Modal ──────────────────────────────────────────────── */
#leadModal .modal-content { border-radius: 16px; border: none; }

/* ── Utilities ──────────────────────────────────────────── */
.opacity-90 { opacity: .9; }
.opacity-75 { opacity: .75; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .hero-slide         { height: 340px; }
    .vehicle-main-img   { height: 300px; }
}

@media (max-width: 767.98px) {
    .hero-static-section { min-height: 420px; }
    .hero-static-content { padding: 3.5rem 0 5rem; }
    .hero-stats          { flex-direction: row; gap: 1.5rem !important; }
    .navbar-actions      { padding: .5rem 0; }
    .filters-panel       { border-radius: var(--radius-card) var(--radius-card) 0 0; }
    .wa-fab              { bottom: 1rem; right: 1rem; width: 50px; height: 50px; }
}

@media (max-width: 575.98px) {
    .vehicle-thumb  { height: 160px; }
    .hero-search-bar .btn-warning { font-size: .875rem; }
}
