@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* =========================================================
   HOME PAGE (INDEX)
   STATIC CSS - KHÔNG DÙNG TAILWIND
========================================================= */

/* --- GENERAL & CONTAINERS --- */
.home-page {
    background-color: #f8fafc;
    color: #1f2937;
    overflow-x: clip;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
}

.home-page button,
.home-page input,
.home-page textarea,
.home-page select {
    font-family: 'Inter', Arial, Helvetica, sans-serif;
}

.home-container {
    width: min(1536px, calc(100% - 32px));
    margin: 0 auto;
}

.relative-z { position: relative; z-index: 10; }
.desktop-only { display: inline-flex !important; }
.mobile-only { display: none !important; }
.hidden-mobile { display: flex; }
.hidden-tablet { display: flex; }

/* --- SPINNER --- */
.spinner-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 40px 0;
}
.kn-spinner {
    width: 32px; height: 32px;
    border: 4px solid rgba(255, 94, 0, 0.25);
    border-top-color: #ff5e00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- SKELETONS --- */
.skel-line { background: #e5e7eb; border-radius: 4px; height: 12px; }
.w-2-3 { width: 66.66%; } .w-3-4 { width: 75%; } .w-5-6 { width: 83.33%; } .w-4-6 { width: 66.66%; }
.w-1-3 { width: 33.33%; } .w-full { width: 100%; } .w-64 { width: 256px; } .h-5 { height: 20px; }

/* --- COMMON SECTIONS --- */
.home-section {
    padding: 40px 0;
    position: relative;
    z-index: 10;
    border-bottom: 1px solid #e5e7eb;
}
.section-large { padding: 64px 0; }
.section-gray { background-color: #f8fafc; }
.section-white { background-color: #ffffff; }

.section-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 12px;
}
.section-title {
    font-size: 30px;
    font-weight: 900;
    color: #00479b;
    text-transform: uppercase;
    letter-spacing: -0.025em;
    position: relative;
    margin: 0 0 8px;
}
.section-title-line {
    position: absolute;
    bottom: -14px; left: 0;
    width: 64px; height: 6px;
    background-color: #ff5e00;
    border-radius: 999px;
}
.section-desc {
    margin: 16px 0 0;
    max-width: 768px;
    color: #6b7280;
    font-size: 16px;
    line-height: 1.625;
}

/* --- BUTTONS --- */
.btn-view-all {
    align-items: center;
    font-size: 14px; font-weight: 700;
    background-color: #fff7ed; color: #ff5e00;
    padding: 8px 16px; border-radius: 999px;
    text-decoration: none; text-transform: uppercase;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
.btn-view-all:hover { background-color: #ffedd5; }
.btn-view-all span { margin-left: 4px; font-size: 18px; line-height: 1; }

.btn-mobile {
    display: inline-block;
    background-color: #fff; color: #374151;
    font-weight: 700; font-size: 14px;
    padding: 10px 24px; border-radius: 999px;
    border: 1px solid #e5e7eb; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    text-transform: uppercase; text-decoration: none;
    transition: background-color 0.2s;
}
.btn-mobile:hover { background-color: #f9fafb; }
.section-mobile-action { margin-top: 24px; text-align: center; }

/* --- HERO SECTION --- */
.home-hero {
    background-color: #ffffff;
    position: relative;
    overflow: hidden;
}
.home-hero-bg {
    position: absolute; inset: 0;
    opacity: 0.05; pointer-events: none;
    background-image: radial-gradient(#00479b 1px, transparent 1px);
    background-size: 20px 20px;
}
.home-hero-inner {
    padding: 48px 16px;
    display: flex; align-items: center;
    position: relative; z-index: 10;
}
.home-hero-content { width: 50%; padding-right: 40px; margin-bottom: 0; }
.home-hero-badge {
    display: inline-block;
    background-color: #eff6ff; color: #00479b;
    font-weight: 700; font-size: 12px;
    padding: 4px 12px; border-radius: 4px;
    border: 1px solid #dbeafe;
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 16px;
}
.home-hero-title {
    font-size: 48px; font-weight: 900;
    color: #00479b; line-height: 1.15;
    text-transform: uppercase; margin: 0 0 20px;
}
.home-hero-title .highlight { color: #ff5e00; }
.home-hero-desc {
    font-size: 16px; color: #4b5563; font-weight: 500;
    max-width: 500px; margin: 0 0 32px; line-height: 1.6;
}
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-primary {
    background-color: #ff5e00; color: #fff;
    padding: 14px 24px; border-radius: 4px;
    font-size: 16px; font-weight: 700; text-transform: uppercase;
    text-decoration: none; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
}
.btn-primary:hover { background-color: #ea580c; }
.btn-outline {
    background-color: #fff; color: #00479b;
    border: 2px solid #00479b;
    padding: 12px 24px; border-radius: 4px;
    font-size: 16px; font-weight: 700; text-transform: uppercase;
    text-decoration: none; transition: all 0.2s;
}
.btn-outline:hover { background-color: #00479b; color: #fff; }

.home-hero-visual { width: 50%; }
.home-hero-image-wrapper {
    width: 100%; aspect-ratio: 16 / 10;
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    border: 4px solid #fff;
    position: relative; cursor: pointer;
}
.home-hero-image {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.7s;
}
.home-hero-image-wrapper:hover .home-hero-image { transform: scale(1.05); }

/* --- CATEGORIES GRID --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.category-card {
    background-color: #fff; border-radius: 12px;
    border: 1px solid #f3f4f6; padding: 20px;
    display: flex; flex-direction: column;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.3s; position: relative;
    overflow: hidden; cursor: pointer; min-height: 200px;
}
.category-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transform: translateY(-4px); border-color: #ff5e00;
}
.category-watermark {
    position: absolute; bottom: 0; right: 4px;
    font-size: 72px; font-weight: 900;
    color: #f9fafb; opacity: 0.6;
    transition: all 0.5s; pointer-events: none; user-select: none;
}
.category-card:hover .category-watermark {
    color: #fff7ed; transform: scale(1.05) translateX(-4px);
}
.category-header { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; z-index: 10; text-align: center; width: 100%; }
.category-title {
    font-size: 18px; font-weight: 900; color: #00479b;
    text-transform: uppercase; line-height: 1.375; width: 100%;
    transition: color 0.3s; margin: 0;
}
.category-card:hover .category-title { color: #ff5e00; }
.category-divider {
    width: 40px; border-top: 3px solid #e5e7eb;
    margin: 10px auto 20px; border-radius: 999px;
    transition: border-color 0.3s;
}
.category-card:hover .category-divider { border-color: #ff5e00; }
.category-list { position: relative; z-index: 10; width: 100%; text-align: left; list-style: none; padding: 0; margin: 0; }
.category-item { display: flex; align-items: flex-start; margin-bottom: 12px; }
.category-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background-color: #d1d5db; margin-top: 10px; margin-right: 12px; flex-shrink: 0;
    transition: background-color 0.3s;
}
.category-item:hover .category-dot { background-color: #ff5e00; }
.category-link {
    font-size: 16px; text-transform: uppercase; font-weight: 500;
    color: #374151; text-decoration: none; transition: color 0.3s;
    line-height: 1.375; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.category-link:hover { color: #ff5e00; }
.category-view-all {
    font-size: 14px; text-transform: uppercase; font-weight: 700;
    color: #ff5e00; font-style: italic; text-decoration: none;
    transition: color 0.3s;
}
.category-view-all:hover { color: #c2410c; text-decoration: underline; }
.cat-empty { font-size: 14px; color: #9ca3af; font-style: italic; }
.home-grid-message {
    grid-column: 1 / -1;
    text-align: center;
}
.home-error-message {
    color: #dc2626;
    font-weight: 700;
}
.category-view-all-item {
    margin-top: 16px;
}
.brand-marquee-error {
    color: #fca5a5;
}
.best-seller-tabs-error {
    font-size: 12px;
    color: #dc2626;
}

/* Category Skeleton */
.category-skeleton {
    background: #fff; border-radius: 12px; border: 1px solid #f3f4f6;
    padding: 20px; display: flex; flex-direction: column; min-height: 200px;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.category-skel-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.skel-box { width: 40px; height: 40px; background: #f3f4f6; border-radius: 8px; flex-shrink: 0; }
.category-skel-divider { width: 100%; border-top: 1px solid #f3f4f6; margin-bottom: 16px; }
.category-skel-list { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.skel-item { display: flex; align-items: center; gap: 12px; }
.skel-dot { width: 8px; height: 8px; background: #d1d5db; border-radius: 50%; flex-shrink: 0; }

/* --- BEST SELLERS & TABS --- */
.home-tabs-container {
    display: flex; align-items: center; gap: 24px;
    overflow-x: auto; margin-bottom: 24px; padding-bottom: 8px;
    font-size: 14px; font-weight: 700; color: #9ca3af; min-height: 32px;
}
.home-tabs-container::-webkit-scrollbar { display: none; }
.home-tab-btn {
    padding-bottom: 4px; white-space: nowrap; transition: color 0.2s;
    text-transform: uppercase; border: none; background: transparent; cursor: pointer;
    font-family: inherit; font-size: inherit; font-weight: inherit; color: inherit;
    border-bottom: 2px solid transparent;
}
.home-tab-btn:hover { color: #00479b; }
.home-tab-btn.is-active {
    color: #00479b; border-bottom-color: #00479b; font-weight: 900;
}

.slider-wrapper { position: relative; }
.slider-nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 20;
    width: 40px; height: 40px; border-radius: 50%; background: #fff;
    border: 1px solid #e5e7eb; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center;
    color: #4b5563; cursor: pointer; opacity: 0; transition: all 0.2s;
}
.slider-wrapper:hover .slider-nav-btn { opacity: 1; }
.slider-nav-btn:hover { color: #ff5e00; border-color: #ff5e00; }
.nav-prev { left: -16px; } .nav-next { right: -16px; }
.slider-nav-btn svg { width: 24px; height: 24px; }

.product-slider {
    width: 100%; position: relative; overflow-x: auto;
    display: flex; align-items: stretch; padding: 8px 0;
    cursor: grab; scroll-behavior: smooth;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}
.product-slider::-webkit-scrollbar { display: none; }
.product-slider:active { cursor: grabbing; scroll-behavior: auto; }
.product-slider-track { display: flex; align-items: stretch; min-width: 100%; flex-shrink: 0; padding: 8px 0; }

.product-card {
    width: 288px; flex-shrink: 0; margin: 0 12px; background: #fff;
    border: 1px solid #e5e7eb; padding: 16px; display: flex; flex-direction: column;
    position: relative; overflow: hidden; transition: box-shadow 0.2s;
}
.product-card:hover { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.product-image-link {
    width: 100%; height: 192px; display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px; position: relative; border-bottom: 1px solid #f3f4f6;
    padding: 8px; text-decoration: none;
}
.product-badge-stock {
    position: absolute; top: 8px; right: 8px; background: #22c55e;
    color: #fff; font-size: 11px; font-weight: 700; padding: 4px 8px;
    border-radius: 4px; z-index: 10;
}
.product-img { max-height: 100%; max-width: 100%; object-fit: contain; transition: transform 0.3s; }
.product-image-link:hover .product-img { transform: scale(1.1); }
.product-info { margin-bottom: 16px; flex: 1; display: flex; flex-direction: column; }
.product-brand { font-size: 11px; color: #6b7280; margin-bottom: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.product-name {
    font-size: 15px; font-weight: 700; color: #00479b; line-height: 1.375;
    margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    text-decoration: none; transition: color 0.2s;
}
.product-name:hover { color: #ff5e00; }
.product-meta { margin-top: auto; }
.product-sku, .product-unit {
    font-size: 12px; color: #4b5563; background: #f3f4f6;
    display: inline-block; padding: 4px 8px; border-radius: 4px;
}
.product-sku { font-family: monospace; font-weight: 700; margin-bottom: 4px; }
.product-unit { font-weight: 500; }
.product-btn-add {
    display: block; width: 100%; text-align: center; border: 2px solid #ff5e00;
    color: #ff5e00; font-weight: 700; padding: 8px; transition: all 0.2s;
    font-size: 14px; text-transform: uppercase; text-decoration: none;
    margin-top: auto; background: transparent; cursor: pointer;
}
.product-btn-add:hover { background: #ff5e00; color: #fff; }

/* Product Skeleton */
.product-skeleton { width: 288px; flex-shrink: 0; background: #fff; border: 1px solid #f3f4f6; padding: 16px; height: 340px; display: flex; flex-direction: column; animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; margin: 0 12px;}
.skel-img { width: 100%; height: 192px; background: #e5e7eb; margin-bottom: 16px; }
.skel-btn { height: 40px; background: #e5e7eb; border-radius: 4px; width: 100%; margin-top: 16px; }
.empty-msg { width: 100%; text-align: center; color: #6b7280; padding: 40px 0; font-weight: 500; }

/* --- INDUSTRIES --- */
.industry-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; }
.industry-card {
    background: #fff; padding: 24px; border-radius: 12px; border: 1px solid #f3f4f6;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); text-align: center; display: flex;
    flex-direction: column; justify-content: center; align-items: center; height: 100%; gap: 16px;
    text-decoration: none; transition: all 0.2s;
}
.industry-card:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); border-color: #00479b; }
.industry-icon-wrapper { flex-shrink: 0; }
.industry-icon-img { width: 64px; height: 64px; margin: 0 auto; object-fit: contain; transition: transform 0.3s; }
.industry-card:hover .industry-icon-img { transform: scale(1.1); }
.industry-icon-fallback {
    width: 64px; height: 64px; margin: 0 auto; background: #f9fafb; display: flex;
    align-items: center; justify-content: center; border-radius: 50%; font-size: 36px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); border: 1px solid #f3f4f6; transition: transform 0.3s;
}
.industry-card:hover .industry-icon-fallback { transform: scale(1.1); }
.industry-name {
    font-size: 18px; font-weight: 900; color: #1f2937; margin: 0; line-height: 1.375;
    transition: color 0.2s; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.industry-card:hover .industry-name { color: #00479b; }

/* --- FEATURED BRANDS --- */
.brand-marquee-section { background-color: #00479b; padding: 24px 0; overflow: hidden; position: relative; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); z-index: 20; }
.brand-marquee-inner { display: flex; align-items: center; }
.brand-marquee-label { z-index: 10; flex-shrink: 0; position: relative; background: #00479b; padding-right: 24px; border-right: 1px solid #1e40af; }
.brand-marquee-label h3 { margin: 0; font-size: 14px; font-weight: 900; color: #fff; text-transform: uppercase; letter-spacing: 0.1em; }
.brand-marquee-track {
    width: 100%; position: relative; overflow-x: auto; display: flex; align-items: center;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    cursor: grab; margin-left: 8px; padding: 8px 0;
}
.brand-marquee-track::-webkit-scrollbar { display: none; }
.brand-marquee-track:active { cursor: grabbing; }
.brand-track-group { display: flex; align-items: center; justify-content: space-around; min-width: 100%; flex-shrink: 0; }
.brand-link { font-size: 20px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.1em; text-decoration: none; padding: 0 32px; white-space: nowrap; transition: color 0.2s; }
.brand-link:hover { color: #ff5e00; }
.brand-marquee-loading { width: 100%; color: #93c5fd; font-weight: 700; font-size: 14px; padding-left: 16px; }

/* --- BLOGS --- */
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.blog-card { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; transition: all 0.2s; display: flex; flex-direction: column; background: #fff;}
.blog-card:hover { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.blog-img-link { display: block; height: 192px; background: #e5e7eb; overflow: hidden; position: relative; }
.blog-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.blog-card:hover .blog-img { transform: scale(1.05); }
.blog-content { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.blog-tag { font-size: 12px; color: #ff5e00; font-weight: 700; text-transform: uppercase; margin-bottom: 8px; }
.blog-title {
    font-size: 18px; font-weight: 700; color: #1f2937; margin: 0 0 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    transition: color 0.2s; text-decoration: none;
}
.blog-card:hover .blog-title { color: #00479b; }
.blog-read-more {
    margin-top: auto; display: inline-flex; align-items: center; color: #00479b;
    font-weight: 700; font-size: 14px; text-decoration: none;
}
.blog-read-more span { margin-left: 4px; transition: transform 0.2s; }
.blog-card:hover .blog-read-more span { transform: translateX(4px); }

/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
    .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .industry-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .hidden-tablet { display: none; }
}

@media (max-width: 900px) {
    .home-hero-inner { flex-direction: column; padding: 48px 16px; }
    .home-hero-content { width: 100%; padding-right: 0; margin-bottom: 32px; text-align: center; }
    .home-hero-desc { margin: 0 auto 32px; }
    .home-hero-actions { justify-content: center; }
    .home-hero-visual { width: 100%; }
    
    .section-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .section-title-line { bottom: -12px; }
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
    
    .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .industry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .blog-grid { grid-template-columns: 1fr; }
    
    .hidden-mobile { display: none; }
}

@media (max-width: 600px) {
    .category-grid { grid-template-columns: 1fr; }
    .home-hero-title { font-size: 36px; }
}