/* ============================================================
   Huapont — Hero Section (Premium 3-Column Layout)
   ------------------------------------------------------------
   Design: Premium, Modern Editorial, Luxury Construction
   Layout: 3 cột full-width, desktop-first
   - Left: 22–25% (Giới thiệu doanh nghiệp)
   - Center: 50–56% (Slider ảnh chính)
   - Right: 22–25% (Năng lực cốt lõi)
   
   Màu sắc: Đen than/navy đậm + vàng gold sang trọng
   Typography: Playfair Display (serif cao cấp)
   ============================================================ */

/* ============================================================
   CHUẨN RESPONSIVE HỆ THỐNG (áp dụng cho hero.css + home.css)
   ------------------------------------------------------------
   Đây là file mốc (reference) cho hệ thống 3-breakpoint dùng
   chung toàn bộ trang chủ. Mọi section mới/sửa lại đều PHẢI
   theo đúng các quy tắc dưới đây để tránh lệch chuẩn.

   1) BREAKPOINT (dùng đúng 3 mốc, không tự thêm mốc lạ):
      - Tablet      : @media (max-width: 1023px)
      - Mobile      : @media (max-width: 767px)
      - Mobile nhỏ  : @media (max-width: 640px)
      → Mỗi component chỉ nên có TỐI ĐA 1 block cho mỗi mốc
        (không để 2 block @media trùng mốc rải rác trong file).

   2) FONT-SIZE tối thiểu trên mobile (767px / 640px):
      - Text nội dung / label chính  : tối thiểu 14px (var(--fs-sm))
      - Label phụ / caption          : tối thiểu 13–14px
      - KHÔNG dùng 12px (var(--fs-xs)) cho text có nghĩa (đọc được
        nội dung) — 12px chỉ dùng cho mã kỹ thuật / eyebrow ngắn
        đã uppercase + letter-spacing rộng.

   3) TOUCH TARGET tối thiểu cho phần tử tương tác (nút, icon-button,
      nav dot/arrow...) trên mobile: tối thiểu 40×40px (khuyến nghị
      44×44px theo WCAG 2.5.8 / Apple HIG / Material Design).

   4) KHUNG ẢNH: dùng `aspect-ratio` thay cho `height` cố định để
      ảnh co giãn đúng tỉ lệ trên mọi kích thước màn hình, kết hợp
      `object-fit: cover` trên <img>/background.

   Tham chiếu thực thi: hero.css (file này) là chuẩn áp dụng đầu
   tiên; home.css áp dụng lại cùng hệ thống này cho các section còn
   lại (Featured Products, Categories, Why Choose Us, Video, 
   Testimonials, Stats, Partners).
   ============================================================ */

/* ============================================================
   Hero Section Wrapper — Center hero trong container-max
   ============================================================ */

.hero-wrapper {
    max-width: var(--container-max);
    margin: 0 auto 48px;
    padding: 0 var(--space-4);
}

/* ============================================================
   Hero Section Container
   ============================================================ */

.hero-premium {
    width: 100%;
    display: grid;
    grid-template-columns: 22fr 50fr 28fr;
    gap: var(--space-4);
    padding: 12px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: visible;
    min-height: 480px;
    box-shadow: var(--shadow-sm);
}

/* Dynamic layout khi các cột optional bị ẩn */
.hero-premium:has(.hero-col-center:only-child) {
    grid-template-columns: 1fr;
}

.hero-premium:has(.hero-col-left):has(.hero-col-center):not(:has(.hero-col-right)) {
    grid-template-columns: 30fr 70fr;
}

.hero-premium:has(.hero-col-center):has(.hero-col-right):not(:has(.hero-col-left)) {
    grid-template-columns: 70fr 30fr;
}

.hero-premium:has(.hero-col-left):has(.hero-col-right):not(:has(.hero-col-center)) {
    grid-template-columns: 1fr 1fr;
}

/* ============================================================
   Column Base Styles
   ============================================================ */

.hero-col {
    padding: 0 16px;
    position: relative;
}

/* ============================================================
   Left Column — 1 ảnh lớn + text overlay (giống cột giữa)
   ============================================================ */

.hero-premium .hero-col-left {
    background: var(--color-ink-900);
    padding: 0 16px;
    position: relative;
    overflow: hidden;
    min-height: 480px;
}

/* ============================================================
   Right Column — 1 ảnh lớn + text overlay (giống cột giữa)
   ============================================================ */

.hero-premium .hero-col-right {
    background: transparent;
    padding: 0;
    position: relative;
    overflow: visible;
}

/* ============================================================
   Hero Feature Card — dùng cho cột trái & phải
   ------------------------------------------------------------
   Pattern giống .hero-slider-item:
   - Position absolute, inset 0
   - Ảnh phủ kín (object-fit: cover)
   - Overlay đen gradient từ dưới lên
   - Text overlay (eyebrow + title + desc + CTA) absolute bên trên
   ============================================================ */
.hero-feature-slider {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: var(--color-ink-900);
}

.hero-feature-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 700ms var(--ease-out);
    z-index: 0;
}

.hero-feature-slide.active {
    opacity: 1;
    z-index: 1;
}

.hero-feature-copy {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.hero-feature-copy .hero-feature-cta {
    pointer-events: auto;
}

.hero-feature-dots {
    position: absolute;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-2);
    z-index: 4;
}

.hero-feature-dots .hero-dot {
    width: 8px;
    height: 8px;
}

.hero-feature-dots .hero-dot.active {
    width: 8px;
    background: var(--color-gold-500);
}

.hero-feature-slider .hero-feature-card--empty {
    position: absolute;
    inset: 0;
}

.hero-feature-slider .hero-feature-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-feature-slider .hero-feature-placeholder svg {
    width: 64px;
    height: 64px;
    color: var(--color-gold-500);
    opacity: 0.35;
}


.hero-feature-card:hover {
    transform: scale(1.01);
}

.hero-feature-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
    transition: transform 600ms var(--ease-out);
}

.hero-feature-card:hover .hero-feature-bg {
    transform: scale(1.05);
}

.hero-feature-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(to top, rgba(11, 11, 11, 0.92) 0%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-feature-eyebrow {
    position: absolute;
    top: 28px;
    left: 28px;
    z-index: 3;
    display: inline-block;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-gold-300);
    padding: 6px 12px;
    background: rgba(11, 11, 11, 0.45);
    border: 1px solid rgba(201, 169, 97, 0.4);
    border-radius: var(--radius-xs);
    backdrop-filter: blur(8px);
}

.hero-feature-title {
    position: absolute;
    bottom: 96px;
    left: 28px;
    right: 28px;
    z-index: 3;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-white);
    margin: 0;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.hero-feature-desc {
    position: absolute;
    bottom: 64px;
    left: 28px;
    right: 28px;
    z-index: 3;
    font-family: var(--font-display);
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-gold-300);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-feature-cta {
    position: absolute;
    bottom: 28px;
    left: 28px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-gold-300);
    text-decoration: none;
    transition: gap var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
}

.hero-feature-card:hover .hero-feature-cta {
    gap: 10px;
    color: var(--color-gold-500);
}

/* Placeholder khi chưa có ảnh — gradient + icon mờ */
.hero-feature-card--empty {
    background: linear-gradient(135deg, var(--color-ink-800) 0%, var(--color-ink-900) 100%);
}

.hero-feature-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
}

.hero-feature-placeholder svg {
    width: 64px;
    height: 64px;
    color: var(--color-gold-500);
    opacity: 0.35;
}

/* ============================================================
   Center Column — Slider hình ảnh chính
   ============================================================ */

.hero-col-center {
    background: #0B0B0B;
    padding: 0;
    position: relative;
    min-height: 480px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.hero-slider {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: var(--color-bg-soft);
}

.hero-slider-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 900ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slider-item:first-child {
    opacity: 1;
}

.hero-slider-item.active {
    opacity: 1;
    z-index: 1;
}

/* Slide không có title — ảnh full không overlay */
.hero-slider-item--no-title .hero-slider-overlay {
    display: none;
}

.hero-slider-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slider-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(to top, rgba(11, 11, 11, 0.92) 0%, transparent 100%);
    z-index: 2;
}

.hero-slider-content {
    position: absolute;
    bottom: 64px;
    left: 40px;
    right: 40px;
    z-index: 3;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
}

.hero-slider-eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-gold-300);
    padding: 6px 12px;
    background: rgba(11, 11, 11, 0.45);
    border: 1px solid rgba(201, 169, 97, 0.4);
    border-radius: var(--radius-xs);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hero-slider-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-white);
    margin: 0;
    max-width: 520px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-slider-desc {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    max-width: 480px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-slider-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    padding: 10px 22px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-ink-900);
    background: var(--color-gold-500);
    border: 1px solid var(--color-gold-500);
    border-radius: var(--radius-sm);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: gap var(--duration-fast) var(--ease-out),
                background var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.hero-slider-cta:hover {
    gap: var(--space-3);
    background: var(--color-gold-400);
    color: var(--color-ink-900);
    box-shadow: var(--shadow-gold);
}

.hero-slider-cta span[aria-hidden] {
    transition: transform var(--duration-fast) var(--ease-out);
}

.hero-slider-cta:hover span[aria-hidden] {
    transform: translateX(2px);
}

/* Slide không có text — overlay/dots giữ nguyên vị trí, chỉ ảnh hiện full-bleed */
.hero-slider-item--no-title .hero-slider-overlay {
    height: 35%;
}

/* Dot Indicator — tối giản, không có nút trái/phải */
.hero-slider-dots {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 4;
}

.hero-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    border: none;
    padding: 0;
}

.hero-dot:hover {
    background: rgba(201, 169, 97, 0.65);
    transform: scale(1.15);
}

.hero-dot.active {
    background: var(--color-gold-500);
    width: 9px;
}

/* Right column dùng .hero-feature-card (xem ở trên) */

/* ============================================================
   Responsive — Tablet (768px - 1024px)
   ============================================================ */

@media (max-width: 1024px) {
    .hero-wrapper {
        padding: 0 var(--space-4);
        margin-bottom: 40px;
    }

    .hero-premium {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 0;
        gap: 0;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow-sm);
        overflow: visible;
    }
    
    /* Ẩn cột trái CHỈ Ở TABLET */
    .hero-col-left {
        display: none !important;
    }
    
    /* Center column lên đầu, có border + bo tròn */
    .hero-col-center {
        order: -1;
        min-height: 480px;
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        margin-bottom: var(--space-4);
    }
    
    /* Right column */
    .hero-col-right {
        order: 2;
        padding: 16px;
        border-top: none;
    }
    
    /* Slider content tablet */
    .hero-slider-content {
        bottom: 48px;
        left: 32px;
        right: 32px;
        max-width: 560px;
        gap: var(--space-2);
    }

    .hero-slider-title {
        font-size: 32px;
        max-width: 100%;
    }

    .hero-slider-desc {
        font-size: 15px;
        max-width: 100%;
    }

    .hero-slider-cta {
        padding: 10px 20px;
        font-size: 14px;
        margin-top: var(--space-1);
    }

    .hero-slider-dots {
        bottom: 28px;
    }

    /* Stats column trong cột phải — TABLET: hiển thị cùng lúc 3 cards ngang */
    .hero-stats-column {
        flex-direction: row;
        gap: 12px;
    }
    
    .hero-stat-card {
        flex: 1;
        min-height: 140px;
        min-width: 0;
    }
    
    .hero-stat-number {
        font-size: var(--text-3xl);
    }
    
    .hero-stat-label {
        font-size: var(--text-base);
    }
}

/* ============================================================
   Responsive — Mobile (≤767px) — Stats slider từng card
   ============================================================ */

@media (max-width: 767px) {
    .hero-wrapper {
        padding: 12px 16px;
        margin-bottom: 24px;
    }

    .hero-premium {
        min-height: auto;
        padding: 0;
        gap: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }
    
    /* Ẩn cột trái CHỈ Ở MOBILE */
    .hero-col-left {
        display: none !important;
    }
    
    /* Center slider - có border + bo tròn */
    .hero-col-center {
        order: -1;
        min-height: 300px;
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        margin-bottom: 12px;
    }
    
    /* Right column */
    .hero-col-right {
        order: 2;
        padding: 0;
        border-top: none;
    }
    .hero-slider-content {
        bottom: 36px;
        left: 16px;
        right: 16px;
        max-width: 100%;
        gap: 8px;
    }

    .hero-slider-eyebrow {
        font-size: 11px;
        padding: 4px 10px;
    }

    .hero-slider-title {
        font-size: 22px;
        max-width: 100%;
    }

    .hero-slider-desc {
        font-size: 13px;
        max-width: 100%;
        -webkit-line-clamp: 2;
    }

    .hero-slider-cta {
        padding: 8px 16px;
        font-size: 13px;
        margin-top: 2px;
    }

    .hero-slider-dots {
        bottom: 14px;
        gap: 8px;
    }
    
    .hero-dot {
        width: 8px;
        height: 8px;
    }
    
    .hero-dot.active {
        width: 8px;
    }

    /* Stats column trong right column — chuyển thành slider ngang trên mobile */
    .hero-stats-column {
        display: flex;
        flex-direction: row;
        gap: 0;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
        width: 100%;
    }
    
    .hero-stats-column::-webkit-scrollbar {
        display: none;
    }
    
    .hero-stat-card {
        flex: 0 0 100%;
        width: 100%;
        min-height: 120px;
        scroll-snap-align: start;
        position: relative;
    }
    
    .hero-stat-number {
        font-size: var(--text-2xl);
    }
    
    .hero-stat-label {
        font-size: var(--text-sm);
        padding: 0 6px;
    }

    .hero-stat-placeholder {
        width: 36px;
        height: 36px;
    }
}

/* ============================================================
   Responsive — Small Mobile (≤640px)
   ============================================================ */

@media (max-width: 640px) {
    .hero-wrapper {
        padding: 10px 14px;
        margin-bottom: 20px;
    }

    .hero-col-center {
        min-height: 260px;
        margin-bottom: 12px;
    }

    /* Ẩn cột trái */
    .hero-col-left {
        display: none !important;
    }

    .hero-col-right {
        padding: 0;
    }

    .hero-slider-content {
        bottom: 32px;
        left: 14px;
        right: 14px;
        gap: 6px;
    }

    .hero-slider-title {
        font-size: 18px;
    }

    .hero-slider-desc {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .hero-slider-cta {
        padding: 8px 16px;
        font-size: 12px;
    }

    .hero-slider-dots {
        bottom: 12px;
    }

    /* Stats column slider - giữ nguyên horizontal scroll */
    .hero-stats-column {
        display: flex;
        flex-direction: row;
        gap: 0;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
        width: 100%;
    }
    
    .hero-stats-column::-webkit-scrollbar {
        display: none;
    }

    .hero-stat-card {
        flex: 0 0 100%;
        width: 100%;
        min-height: 100px;
        scroll-snap-align: start;
        position: relative;
    }

    .hero-stat-number {
        font-size: var(--text-xl);
    }

    .hero-stat-label {
        font-size: 13px;
    }
}

/* ============================================================
   Hero Right Column — Stats Cards (3 khung nằm dọc)
   ============================================================ */

.hero-stats-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.hero-stat-card {
    position: relative;
    flex: 1;
    min-height: 110px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.hero-stat-card--empty {
    background: var(--color-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-stat-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    inset: 0;
}

.hero-stat-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(11, 11, 11, 0.85) 0%,
        rgba(11, 11, 11, 0.6) 100%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
    z-index: 1;
}

.hero-stat-number {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--color-gold-500);
    font-family: var(--font-display);
    line-height: 1;
}

.hero-stat-label {
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--color-white);
    font-family: var(--font-display);
    text-align: center;
    line-height: 1.3;
}

.hero-stat-placeholder {
    width: 48px;
    height: 48px;
    color: var(--color-text-muted);
    opacity: 0.3;
}

.hero-stat-placeholder svg {
    width: 100%;
    height: 100%;
}

/* Responsive for stats column — được xử lý trong media query chính ở trên */

/* ============================================================
   Dark Theme Overrides
   ============================================================ */

:root[data-theme="dark"] .hero-premium {
    background: var(--color-ink-900);
}

:root[data-theme="dark"] .hero-col-left,
:root[data-theme="dark"] .hero-col-right {
    background: var(--color-ink-800);
}

:root[data-theme="dark"] .hero-intro-title,
:root[data-theme="dark"] .hero-capabilities-title,
:root[data-theme="dark"] .hero-capabilities-subtitle {
    color: var(--color-ink-100);
}

:root[data-theme="dark"] .hero-intro-desc,
:root[data-theme="dark"] .hero-stat-label {
    color: var(--color-ink-300);
}

:root[data-theme="dark"] .hero-intro-image {
    background: var(--color-ink-700);
}

:root[data-theme="dark"] .hero-stat-divider {
    background: var(--color-ink-700);
}

:root[data-theme="dark"] .hero-slider-overlay {
    background: linear-gradient(to top, rgba(26, 26, 26, 0.92) 0%, transparent 100%);
}

:root[data-theme="dark"] .hero-slider-eyebrow {
    background: rgba(26, 26, 26, 0.55);
    border-color: rgba(201, 169, 97, 0.45);
}

:root[data-theme="dark"] .hero-slider-cta {
    color: var(--color-ink-900);
    background: var(--color-gold-500);
}

:root[data-theme="dark"] .hero-slider-cta:hover {
    background: var(--color-gold-400);
}

:root[data-theme="dark"] .hero-stat-overlay {
    background: linear-gradient(
        135deg,
        rgba(11, 11, 11, 0.9) 0%,
        rgba(11, 11, 11, 0.75) 100%
    );
}

:root[data-theme="dark"] .hero-stat-card--empty {
    background: var(--color-ink-800);
}

:root[data-theme="dark"] .hero-stat-placeholder {
    color: var(--color-ink-600);
}

/* Mobile override must remain after the base card rules. */
@media (max-width: 767px) {
    .hero-stats-column {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .hero-stats-column::-webkit-scrollbar {
        display: none;
    }

    .hero-stats-column .hero-stat-card {
        flex: 0 0 100%;
        width: 100%;
        min-width: 100%;
        min-height: 120px;
        scroll-snap-align: start;
    }
}
