/* =====================================================
   MAGCAR DEPOT - CSS PRINCIPAL
   Colores: Azul #0066CC y Cyan #00A3E0
   ===================================================== */

/* ===========================
   HEADER TOP
   =========================== */
.header-top {
    background: #1a1a1a;
    color: white;
    font-size: 0.85rem;
    border-bottom: 2px solid #00A3E0;
}

.header-top .social-links {
    display: flex;
    align-items: center;
}

.header-top .social-links a {
    color: white;
    transition: color 0.3s ease;
    text-decoration: none;
}

.header-top .social-links a:hover {
    color: #00A3E0;
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.header-controls .btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.3s ease;
}

.header-controls .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00A3E0;
    color: white;
}

/* ===========================
   NAVBAR
   =========================== */
.navbar {
    background: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    max-height: 50px;
    width: auto;
}

.navbar-nav .nav-link {
    color: #333;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #00A3E0;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: #00A3E0;
    border-radius: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, #0066CC, #00A3E0) !important;
    border: none !important;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 163, 224, 0.3);
}

/* ===========================
   SLIDESHOW / HERO CAROUSEL
   Ajustado para desktop, tablet y móvil
   =========================== */
.slideshow {
    position: relative;
    width: 100%;
    height: clamp(320px, 45vw, 560px);
    min-height: 320px;
    max-height: 560px;
    overflow: hidden;
    background: #000;
}

#carouselHero,
#carouselHero .carousel-inner,
#carouselHero .carousel-item {
    height: 100%;
}

#carouselHero .carousel-item {
    position: relative;
    background: #000;
}

#carouselHero .carousel-item img {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
}

/* Ajuste individual de cada slide para que el carro no quede tan arriba */
#carouselHero .carousel-item:nth-child(1) img {
    object-position: center center !important;
}

#carouselHero .carousel-item:nth-child(2) img {
    object-position: center center !important;
}

#carouselHero .carousel-item:nth-child(3) img {
    object-position: center center !important;
}

/* Oscurece ligeramente la imagen completa sin taparla */
#carouselHero .carousel-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.10) 0%,
        rgba(0, 0, 0, 0.15) 45%,
        rgba(0, 0, 0, 0.45) 100%
    );
    z-index: 1;
    pointer-events: none;
}

#carouselHero .carousel-caption {
    z-index: 2;
    background: transparent;
    padding: 20px 15px 28px;
    bottom: 20px;
    left: 10%;
    right: 10%;
}

#carouselHero .carousel-caption h2 {
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    margin-bottom: 8px;
}

#carouselHero .carousel-caption p {
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    margin-bottom: 0;
}

#carouselHero .carousel-indicators {
    z-index: 3;
    margin-bottom: 18px;
}

#carouselHero .carousel-control-prev,
#carouselHero .carousel-control-next {
    background: rgba(0, 163, 224, 0.7);
    width: 50px;
    height: 50px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    opacity: 1;
    z-index: 3;
}

#carouselHero .carousel-control-prev {
    left: 20px;
}

#carouselHero .carousel-control-next {
    right: 20px;
}

#carouselHero .carousel-control-prev:hover,
#carouselHero .carousel-control-next:hover {
    background: rgba(0, 163, 224, 0.9);
}

/* ===========================
   SECCIÓN DE INVENTARIO
   =========================== */
.vehicles-grid {
    background: #f8f9fa;
    padding: 3rem 0;
}

.sidebar-filters {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 20px;
}

.sidebar-filters h5 {
    color: #0066CC;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #00A3E0;
}

.filter-section {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.filter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.filter-options {
    max-height: 200px;
    overflow-y: auto;
}

.filter-option {
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.filter-option:hover {
    background: #f3f4f6;
}

.filter-option input[type="checkbox"] {
    cursor: pointer;
    accent-color: #00A3E0;
}

.inventory-header {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-count {
    font-size: 1rem;
    color: #666;
}

.view-toggle {
    display: flex;
    gap: 5px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}

.view-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: rgba(0, 163, 224, 0.1);
    color: #00A3E0;
}

.view-btn.active {
    background: white;
    color: #00A3E0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sort-select,
.form-select {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.sort-select:focus,
.form-select:focus {
    border-color: #00A3E0;
    box-shadow: 0 0 0 3px rgba(0, 163, 224, 0.1);
}

/* ===========================
   GRID DE VEHÍCULOS
   =========================== */
#vehiclesContainer {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 25px !important;
    padding: 0 !important;
    margin: 0 !important;
}

#vehiclesContainer > .col-6,
#vehiclesContainer > .col-md-6,
#vehiclesContainer > .col-lg-4,
#vehiclesContainer > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

#vehiclesContainer.is-list {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
}

#vehiclesContainer.is-list .m-card {
    display: flex;
    flex-direction: row;
}

#vehiclesContainer.is-list .m-card-image-box {
    flex: 0 0 300px;
    padding-top: 0;
    height: 200px;
}

#vehiclesContainer.is-list .m-card-body {
    flex: 1;
}

/* ===========================
   FOOTER
   =========================== */
.footer {
    background: #1a1a1a;
    color: white;
    margin-top: 4rem;
}

.footer h5 {
    color: #00A3E0;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-link {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #00A3E0;
}

.footer .social-icon {
    color: white;
    margin-right: 15px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer .social-icon:hover {
    color: #00A3E0;
    transform: scale(1.1);
}

.whatsapp-subscribe-box {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn {
    background: white !important;
    color: #25D366 !important;
    font-weight: 600;
    border: none;
    padding: 12px 30px;
    transition: all 0.3s ease;
}

.whatsapp-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
    color: #25D366 !important;
}

.payment-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.payment-methods img {
    height: 32px;
    width: auto;
    border-radius: 4px;
}

/* ===========================
   WHATSAPP FLOTANTE
   =========================== */
.whatsapp-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-button:hover {
    background-color: #128C7E;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
    color: white;
}

/* ===========================
   RESPONSIVE - TABLET
   =========================== */
@media (max-width: 1024px) {
    #vehiclesContainer {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    .slideshow {
        height: 400px;
        min-height: 400px;
    }
}

/* ===========================
   RESPONSIVE - MÓVIL
   =========================== */
@media (max-width: 768px) {
    #vehiclesContainer {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    .slideshow {
        height: 320px;
        min-height: 320px;
    }

    #carouselHero .carousel-caption {
        bottom: 16px;
        left: 8%;
        right: 8%;
        padding: 15px 10px 22px;
    }

    #carouselHero .carousel-caption h2 {
        font-size: 1.5rem;
    }

    #carouselHero .carousel-caption p {
        font-size: 0.9rem;
    }

    #carouselHero .carousel-control-prev,
    #carouselHero .carousel-control-next {
        width: 40px;
        height: 40px;
    }

    #carouselHero .carousel-control-prev {
        left: 12px;
    }

    #carouselHero .carousel-control-next {
        right: 12px;
    }

    .inventory-header {
        padding: 15px;
    }

    .header-top {
        font-size: 0.75rem;
    }

    .navbar-brand img {
        max-height: 40px;
    }
}

/* ===========================
   RESPONSIVE - MÓVIL PEQUEÑO
   =========================== */
@media (max-width: 480px) {
    #vehiclesContainer {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .slideshow {
        height: 270px;
        min-height: 270px;
    }

    #carouselHero .carousel-caption {
        bottom: 14px;
        padding: 12px 8px 18px;
    }

    #carouselHero .carousel-caption h2 {
        font-size: 1.2rem;
    }

    #carouselHero .carousel-caption p {
        font-size: 0.8rem;
    }
}

/* ===========================
   MODO OSCURO
   =========================== */
[data-bs-theme="dark"] {
    background: #0a0a0a;
}

[data-bs-theme="dark"] .navbar {
    background: #1a1a1a !important;
    border-bottom: 2px solid #00A3E0;
}

[data-bs-theme="dark"] .navbar-nav .nav-link {
    color: #ccc;
}

[data-bs-theme="dark"] .navbar-nav .nav-link:hover,
[data-bs-theme="dark"] .navbar-nav .nav-link.active {
    color: #00A3E0;
}

[data-bs-theme="dark"] .sidebar-filters,
[data-bs-theme="dark"] .inventory-header {
    background: #1a1a1a;
    color: #ccc;
}

[data-bs-theme="dark"] .filter-title,
[data-bs-theme="dark"] .results-count {
    color: #ccc;
}

[data-bs-theme="dark"] .filter-option:hover {
    background: #2a2a2a;
}

[data-bs-theme="dark"] .view-toggle {
    background: #2a2a2a;
}

[data-bs-theme="dark"] .view-btn.active {
    background: #333;
}

[data-bs-theme="dark"] .sort-select,
[data-bs-theme="dark"] .form-select {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #ccc;
}

/* ===========================
   ACCESIBILIDAD
   =========================== */
button:focus,
select:focus,
a:focus,
input:focus {
    outline: 3px solid #00A3E0;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================
   UTILIDADES
   =========================== */
.text-center { text-align: center; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.hidden { display: none !important; }


/* ===========================
   ARREGLO HEADER INVENTARIO
   =========================== */
.inventory-header .d-flex {
    flex-wrap: wrap !important;
    gap: 12px !important;
}

.inventory-header .d-flex.align-items-center.gap-3 {
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 10px !important;
}

.inventory-header .sort-select,
.inventory-header #itemsPerPage {
    min-width: 170px !important;
    max-width: 100% !important;
    height: 42px !important;
    font-size: 0.9rem !important;
}

.inventory-header #sortVehicles {
    min-width: 240px !important;
}

.inventory-header #itemsPerPage {
    min-width: 120px !important;
}

.inventory-header .view-toggle {
    flex-shrink: 0 !important;
}

@media (max-width: 992px) {
    .inventory-header .d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .inventory-header .d-flex.align-items-center.gap-3 {
        justify-content: flex-start !important;
        width: 100% !important;
    }

    .inventory-header .sort-select,
    .inventory-header #itemsPerPage,
    .inventory-header #sortVehicles {
        width: 100% !important;
        min-width: 100% !important;
    }
}
