﻿/* =========================================
   HERO SLIDER ULTIMATE STYLE
   ========================================= */

/* 1. CORE LAYOUT & IMAGE
   ----------------------------------------- */
.hero-slider {
    position: relative;
    /* Desktop: 700px là chuẩn vàng cho banner hiện đại */
    height: 700px;
    width: 100%;
    overflow: hidden;
    background: #0b1120; /* Nền xanh đen sang trọng khi ảnh chưa load */
    cursor: grab;
}

    .hero-slider:active {
        cursor: grabbing;
    }

.hero-image-wrapper {
    position: relative;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Ken Burns Effect: Zoom chậm rãi */
    transform: scale(1);
    transition: transform 8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform; /* Tối ưu hiệu năng render */
}

.carousel-item.active .hero-img {
    transform: scale(1.12);
}

/* 2. SMART OVERLAY (Lớp phủ thông minh)
   ----------------------------------------- */
.hero-overlay-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Scrim Gradient: Đen ở đáy (nổi chữ), trong suốt ở giữa (rõ ảnh), tối nhẹ ở trên (nổi menu) */
    background: linear-gradient( to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0.1) 60%, rgba(0,0,0,0.8) 100% );
    z-index: 1;
}

/* 3. TYPOGRAPHY & ANIMATION
   ----------------------------------------- */
.carousel-caption {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    padding-bottom: 4rem; /* Đẩy nội dung lên trên một chút */
}

.hero-title {
    /* Fluid Typography: Chữ tự động co giãn mượt mà */
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    line-height: 1.15;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
    margin-bottom: 2.5rem;
    /* Animation State */
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000); /* Ease Out Cubic */
}

.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    /* Animation State */
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

/* Trigger Animation khi Slide Active */
.carousel-item.active .hero-title {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.carousel-item.active .hero-actions {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

/* 4. BUTTONS STYLE
   ----------------------------------------- */
/* Nút chính: Premium Gradient */
.btn-hero-premium {
    background: linear-gradient(90deg, #0060ff 0%, #00c6fb 100%);
    color: #fff;
    padding: 15px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 96, 255, 0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

    .btn-hero-premium:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 40px rgba(0, 96, 255, 0.5);
        color: #fff;
    }

    .btn-hero-premium .moving-icon {
        transition: transform 0.3s ease;
    }

    .btn-hero-premium:hover .moving-icon {
        transform: translateX(5px);
    }

/* Nút phụ: Glassmorphism (Kính mờ) */
.btn-hero-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

    .btn-hero-glass:hover {
        background: #fff;
        color: #0046ba;
        transform: translateY(-4px);
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }

/* 5. NAVIGATION & INDICATORS
   ----------------------------------------- */
/* Mũi tên điều hướng */
.control-box {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 14px;
    backdrop-filter: blur(5px);
    transition: all 0.3s;
}

    .control-box i {
        font-size: 1.2rem;
        color: #fff;
    }

.carousel-control-prev:hover .control-box,
.carousel-control-next:hover .control-box {
    background: var(--primary-color, #0046ba);
    border-color: var(--primary-color, #0046ba);
    transform: scale(1.1);
}

/* Dấu chấm trang (Expanding Pill) */
.carousel-indicators {
    bottom: 30px;
    margin-bottom: 0;
}

    .carousel-indicators [data-bs-target] {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background-color: rgba(255,255,255,0.4);
        border: none;
        margin: 0 6px;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .carousel-indicators .active {
        width: 40px;
        border-radius: 10px;
        background-color: #fff;
    }

/* =========================================
   RESPONSIVE BREAKPOINTS
   ========================================= */

/* A. TABLET & SMALL LAPTOPS (768px -> 1024px) 
   Phân khúc này thường bị bỏ quên, khiến nút bị to quá hoặc layout bị lỡ cỡ.
*/
@media (min-width: 768px) and (max-width: 1024px) {
    .hero-slider {
        height: 500px;
    }
    /* Giảm chiều cao cho cân đối */

    .hero-title {
        font-size: 2.5rem; /* Cố định size chữ để không bị quá to */
        margin-bottom: 1.5rem;
    }

    .btn-hero-premium, .btn-hero-glass {
        padding: 12px 30px; /* Thu nhỏ nút một chút */
        font-size: 1rem;
    }
}

/* B. MOBILE DEVICES (< 768px)
   Phong cách App-like Bottom Sheet
*/
@media (max-width: 767.98px) {

    /* 1. Fullscreen Experience */
    .hero-slider, .hero-image-wrapper {
        height: 100vh; /* Full màn hình thiết bị */
        max-height: 650px; /* Nhưng không quá cao trên điện thoại dài */
        min-height: 500px;
    }

    .hero-img {
        /* Căn chỉnh để thấy trọng tâm ảnh (thường là chiếc xe) */
        object-position: 65% center;
    }

    /* 2. Glassmorphism Bottom Sheet (Thẻ kính ở đáy) */
    .carousel-caption {
        background: rgba(15, 23, 42, 0.85); /* Nền tối sang trọng (Slate-900) */
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
        /* Layout */
        top: auto; /* Bỏ top để dính đáy */
        bottom: 0;
        height: auto;
        padding: 30px 20px 40px 20px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    /* 3. Typography Adjustments */
    .hero-title {
        font-size: 1.6rem;
        line-height: 1.35;
        margin-bottom: 1.2rem;
        text-shadow: none; /* Bỏ bóng chữ vì nền đã tối */
    }

    /* 4. Vertical Stacked Buttons */
    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .btn-hero-premium {
        width: 100%;
        margin: 0;
        font-size: 1rem;
        animation: pulse-mobile 2s infinite; /* Hiệu ứng rung nhẹ */
    }

    .btn-hero-glass {
        width: 100%;
        padding: 12px 0;
        font-size: 0.95rem;
        border-color: rgba(255,255,255,0.2);
        color: rgba(255,255,255,0.8);
    }

    /* Ẩn các thành phần không cần thiết */
    .carousel-indicators {
        display: none;
    }
}

/* Animation rung nút cho Mobile */
@keyframes pulse-mobile {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 96, 255, 0.7);
    }

    70% {
        transform: scale(1.02);
        box-shadow: 0 0 0 8px rgba(0, 96, 255, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 96, 255, 0);
    }
}
