/**
 * Main Styles
 * Hướng dẫn: Bạn có thể thay đổi các giá trị ở rễ (:root) này để áp dụng cho toàn bộ Website.
 */
:root {
    /* 1. MÀU SẮC (Colors) */
    --primary-color: #f05a25;      /* Màu cam rực rỡ - Call-to-Action, Hover, Icon */
    --secondary-color: #ff7a4c;    /* Màu phụ trợ (biến thể sáng hơn của primary) */
    --text-color: #1f2937;         /* Màu chữ (xám than đậm) để dễ đọc trên nền sáng */
    --text-muted: #6b7280;         /* Màu chữ nhạt / mô tả */
    
    /* Cấu hình Nền (Backgrounds) */
    --bg-color: #fff8f6;           /* Màu nền phớt cam nhẹ (dùng chung) */
    --bg-white: #ffffff;           /* Màu nền trắng tinh (dùng cho vùng nổi bật) */
    --bg-gradient: linear-gradient(180deg, #fff8f6 0%, #ffffff 100%); /* Nền Gradient theo yêu cầu */
    
    --border-color: #f3e5e1;       /* Màu đường viền / border */

    /* 2. FONT CHỮ (Typography) */
    /* Hãy import font chữ bằng @import ở trên cùng file này hoặc wp_head nếu bạn dùng font custom */
    --font-heading: 'Mona Sans', sans-serif; /* Font dàn cho các thẻ tiêu đề (H1, H2,...) */
    --font-body: 'Inter', sans-serif;    /* Font dàn cho nội dung chữ thường */

    /* 3. VISUALS CƠ BẢN (Spacing, Radius, Shadow) */
    --container-width: 1600px;     /* Độ rộng siêu lớn cho Desktop hiện đại (hiển thị nhiều sản phẩm hơn) */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --transition-speed: 0.3s;
    --box-shadow-lite: 0 4px 6px rgba(0,0,0,0.05);
    --box-shadow-hover: 0 8px 15px rgba(0,0,0,0.1);
}

body {
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--bg-color);
/* KHÓA CUỘN NGANG: Đảm bảo không bị layout shift và tràn viền ngang trên Mobile */
html, body {
    overflow-x: clip !important; /* Dùng clip thay vì hidden để không phá sticky */
    width: 100% !important;
    max-width: 100% !important;
    position: relative;
    box-sizing: border-box;
    overflow-wrap: break-word; /* Ép bẻ từ đối với các đường link, text siêu dài gây tràn ngang */
}}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
}

.container {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 5%; /* Nhấn thêm tỷ lệ % để hiển thị tốt trên mọi khổ màn hình */
}

/* =========================================================================
   HEADER TAILWIND STYLES (New Premium Header)
   ========================================================================= */
/* Mega Menu Animation (Được quản lý hoàn toàn bằng Tailwind CSS trong header.php) */
/* Hiệu ứng Header khi cuộn */
.header-sticky {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease;
}

/* Nút cam có hiệu ứng glow nhẹ */
.btn-brand {
    background-color: var(--primary-color);
    color: white;
    transition: all 0.3s ease;
}
.btn-brand:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 14px 0 rgba(240, 90, 37, 0.39);
}

/* Animation cho Mega Menu Tabs nội bộ */
@keyframes fadeInTab {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}
.animate-fade-in-tab {
    animation: fadeInTab 0.3s ease forwards;
}

/* Thêm CSS cho Slider Sản phẩm (Hiệu ứng mờ & chiều sâu) */
.mega-slide-item {
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.mega-slide-item.is-blurred {
    filter: blur(2.5px) grayscale(20%);
    opacity: 0.6;
    pointer-events: none;
    user-select: none;
    transform: scale(0.92);
    transform-origin: left center;
}

/* Tùy chỉnh thanh cuộn cho Mobile Menu */
.mobile-menu-scroll::-webkit-scrollbar { width: 4px; }
.mobile-menu-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 0; }

/* Animation Search Popup nay được quản lý bằng Tailwind Utility Classes */

/* OLD HEADER CSS REMOVED DUE TO TAILWIND UPGRADE */

.mobile-submenu li.highlight a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Main */
.site-main {
    padding: 40px 0;
}

.site-main h1 {
    text-align: center;
    margin-bottom: 40px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.post-item {
    background: var(--bg-white);
    border-radius: var(--border-radius-md);
    padding: 20px;
    box-shadow: var(--box-shadow-lite);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.post-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.post-item h2 {
    font-size: 20px;
    margin-top: 0;
}

.post-item h2 a {
    color: var(--text-color);
    text-decoration: none;
}

.post-item h2 a:hover {
    color: var(--primary-color);
}

.post-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-md);
    margin-bottom: 15px;
}

/* =========================================================================
   COMPONENTS: PRODUCT CARD & POST CARD
   ========================================================================= */

/* Product Card */
.product-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--box-shadow-lite);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(240, 90, 37, 0.15); /* bóng đổ theo primary */
}
.product-card-img {
    position: relative;
    display: block;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #fdfdfd;
}
.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Do sản phẩm thiết bị cần hiển thị rõ tỷ lệ */
    mix-blend-mode: multiply; /* Nền trắng của thiết bị mix tốt hơn */
    transition: transform 0.5s;
    padding: 15px;
    box-sizing: border-box;
}
.product-card:hover .product-card-img img {
    transform: scale(1.05);
}
.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-color);
    color: #fff;
    padding: 4px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 700;
}
.product-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.product-card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.4;
}
.product-card-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}
.product-card-title a:hover {
    color: var(--primary-color);
}
.product-card-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 20px 0;
    line-height: 1.6;
    flex-grow: 1;
}
.product-card-actions {
    margin-top: auto;
}
.btn-outline-primary {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}
.btn-outline-primary:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Post Card */
.post-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--box-shadow-lite);
    transition: transform var(--transition-speed);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}
.post-card-img {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
}
.post-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s;
}
.post-card:hover .post-card-img img {
    transform: scale(1.08);
}
.post-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.post-card-meta {
    margin-bottom: 10px;
}
.post-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}
.post-card-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 10px 0;
    line-height: 1.4;
}
.post-card-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}
.post-card-title a:hover {
    color: var(--primary-color);
}
.post-card-excerpt {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0 0 20px 0;
    line-height: 1.6;
    flex-grow: 1;
}
.post-read-more {
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.2s;
    margin-top: auto;
}
.post-read-more:hover {
    gap: 10px;
}

/* Footer */
/* Global border radius override removed to allow Tailwind UI to work correctly */

/* Background Gradient chuẩn TavaLLS */
.bg-tavalls-gradient {
    background: linear-gradient(135deg, rgb(28, 40, 87) 0%, rgb(42, 58, 107) 50%, rgb(28, 40, 87) 100%) !important;
}

/* Ép màu cho các tiêu đề trong Footer (tránh bị rules h1-h6 đè) */
#colophon h3, #colophon h4 {
    color: #ffffff !important;
}
#colophon .text-gray-400 {
    color: #94a3b8 !important; /* slate-400 */
}
#colophon a {
    color: #cbd5e1; /* slate-300 */
}
#colophon a:hover {
    color: #f05a25 !important; /* brand-orange */
}

/* Hiệu ứng viền công nghệ (Tech Border) cho map và box */
.tech-border { position: relative; }
.tech-border::before, .tech-border::after { 
    content: ''; position: absolute; width: 15px; height: 15px; 
    border: 2px solid #f05a25; transition: all 0.4s ease; pointer-events: none; z-index: 10;
}
.tech-border::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.tech-border::after { bottom: 0; right: 0; border-left: none; border-top: none; }
.tech-border:hover::before, .tech-border:hover::after { width: 100%; height: 100%; opacity: 0.1; }

/* =====================================================
   MEGA MENU — GIẢI PHÁP TRỌN GÓI — Premium Card Grid
   ===================================================== */
.sol-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 4px 0; /* breathing room so box-shadows aren't clipped */
}

/* --- Card base --- */
.sol-card {
    display: block;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(29,40,87,0.08);
    transition: transform 0.38s cubic-bezier(.22,.68,0,1.2),
                box-shadow 0.38s ease;
    background: #111827;
}

.sol-card:hover {
    transform: translateY(-6px) scale(1.013);
    box-shadow: 0 18px 48px rgba(29,40,87,0.18), 0 0 0 2px rgba(240,90,37,0.3);
    text-decoration: none;
}

/* --- Image wrapper (fixed aspect ratio) --- */
.sol-card__img-wrap {
    position: relative;
    width: 100%;
    padding-top: 62.5%; /* ~16:10 */
    overflow: hidden;
}

.sol-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(.25,.46,.45,.94), filter 0.4s ease;
    filter: brightness(0.78) saturate(1.1);
}

.sol-card:hover .sol-card__img {
    transform: scale(1.08);
    filter: brightness(0.6) saturate(1.2);
}

/* --- Gradient overlay (always visible, deepens on hover) --- */
.sol-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(17,24,39,0.92) 0%,
        rgba(17,24,39,0.38) 55%,
        rgba(17,24,39,0.0) 100%
    );
    transition: background 0.4s ease;
    z-index: 2;
}

.sol-card:hover .sol-card__overlay {
    background: linear-gradient(
        to top,
        rgba(17,24,39,0.96) 0%,
        rgba(17,24,39,0.62) 65%,
        rgba(17,24,39,0.12) 100%
    );
}

/* --- Floating text block (bottom of image) --- */
.sol-card__body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 16px 16px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sol-card__title {
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-align: center;
    line-height: 1.35;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
    margin: 0;
    transition: color 0.25s;
}

.sol-card:hover .sol-card__title {
    color: #f05a25;
}

/* --- Accent line (reveals on hover) --- */
.sol-card__line {
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: #f05a25;
    transition: width 0.35s cubic-bezier(.22,.68,0,1.2);
}

.sol-card:hover .sol-card__line {
    width: 32px;
}

/* --- HOT badge --- */
.sol-card__hot {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 4;
    background: #f05a25;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(240,90,37,0.5);
}

/* =====================================================
   MOBILE DRAWER — Navigation Styles
   ===================================================== */
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 1px solid #f9fafb;
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}
.mobile-nav-link:hover {
    color: #f05a25;
    background-color: #fff8f6;
    text-decoration: none;
}

.mobile-nav-accordion {
    border-bottom: 1px solid #f9fafb;
}
.mobile-nav-accordion-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s;
}
.mobile-nav-accordion-btn:hover { color: #f05a25; }

.mobile-accordion-body {
    padding-left: 16px;
    padding-right: 16px;
}

.mobile-subnav-group {
    border-bottom: 1px solid #f9fafb;
    padding: 6px 0;
}
.mobile-subnav-group:last-child { border-bottom: none; }

.mobile-subnav-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
}
.mobile-subnav-title:hover { color: #f05a25; }

.mobile-subnav-list {
    list-style: none;
    padding: 0 0 0 12px;
    margin: 0;
    border-left: 2px solid #fed7aa;
}
.mobile-subnav-list li a {
    display: block;
    padding: 6px 0;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}
.mobile-subnav-list li a:hover { color: #f05a25; }

.mobile-subnav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 14px;
    color: #4b5563;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}
.mobile-subnav-link:hover {
    color: #f05a25;
    background: #fff8f6;
    text-decoration: none;
}
/* =========================================================================
   HEADING COMPONENT (.tava-heading)
   Unified component replacing .sec-head and .subcat-header
   ========================================================================= */
.tava-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding-bottom: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    gap: 16px;
}
.tava-heading::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3.5px;
    background: linear-gradient(to bottom, #f05a25, #1d2857);
}
.tava-heading--light {
    border-color: rgba(255,255,255,0.1);
}
.tava-heading--light::before {
    background: linear-gradient(to bottom, #f05a25, #ffffff);
}
.tava-heading__left {
    padding-left: 20px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.tava-heading__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #f05a25;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tava-heading__eyebrow::before {
    content: '';
    display: inline-block;
    width: 25px;
    height: 1.5px;
    background: #f05a25;
}
.tava-heading__title {
    font-family: var(--font-heading), sans-serif !important;
    font-weight: 900 !important;
    color: #1d2857;
    line-height: 1.1;
    letter-spacing: -0.01em;
    font-size: clamp(1.6rem, 2.5vw, 2.8rem);
    margin: 0;
    text-transform: uppercase; /* Ensure consistency */
}
.tava-heading--light .tava-heading__title {
    color: #ffffff;
}
.tava-heading__title em {
    color: #f05a25;
    font-style: normal;
    font-family: var(--font-heading) !important;
    text-transform: uppercase;
}
.tava-heading__ghost {
    position: absolute;
    left: -4px;
    bottom: 18px;
    font-family: var(--font-heading);
    font-size: 8.5rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    color: #f05a25;
    opacity: 0.055;
    pointer-events: none;
    user-select: none;
    letter-spacing: -0.03em;
    white-space: nowrap;
}
.tava-heading--light .tava-heading__ghost {
    color: #ffffff;
    opacity: 0.03;
}
/* Link Style with Circle Icon */
.tava-heading__link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    text-decoration: none;
    color: #1d2857;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.3s;
    padding-bottom: 4px;
    z-index: 1;
}
.tava-heading--light .tava-heading__link {
    color: rgba(255,255,255,0.8);
}
.tava-heading__link:hover {
    color: #f05a25;
}
.tava-heading__link-text {
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    padding-bottom: 2px;
}
.tava-heading__link:hover .tava-heading__link-text {
    border-color: #f05a25;
}
.tava-heading__link-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 16px;
    color: #1d2857;
}
.tava-heading--light .tava-heading__link-icon {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: #fff;
}
.tava-heading__link:hover .tava-heading__link-icon {
    background: #f05a25;
    border-color: #f05a25;
    color: #fff;
    transform: translateX(5px);
}

/* Mobile Adjustments */
@media (max-width: 639px) {
    .tava-heading {
        padding-bottom: 12px;
        margin-bottom: 20px;
    }
    .tava-heading__title {
        font-size: 1.6rem;
    }
    .tava-heading__eyebrow {
        font-size: 10px;
        margin-bottom: 5px;
    }
    .tava-heading__link-text {
        display: none;
    }
    .tava-heading__link-icon {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    .tava-heading__ghost {
        font-size: 70px;
        top: -15px;
        left: -10px;
    }
}
