/* ============================================
   Thiên Long Shop - Main CSS
   Design System & Global Styles
   Matching thienlong.vn EXACTLY
   ============================================ */

/* CSS Custom Properties */
:root {
    /* Colors - EXACT thienlong.vn palette */
    --tl-primary: #114494;
    --tl-primary-dark: #0d3577;
    --tl-primary-light: #2b6cc4;
    --tl-secondary: #0a2d5e;
    --tl-accent: #FF6B00;
    
    --tl-red: #E53935;
    --tl-red-dark: #C62828;
    --tl-green: #43A047;
    --tl-gold: #FFC107;
    --tl-orange: #FF9800;
    
    --tl-white: #FFFFFF;
    --tl-bg: #F0F4F8;
    --tl-bg-light: #F5F8FC;
    --tl-border: #E0E0E0;
    --tl-border-light: #EEEEEE;
    
    --tl-text: #333333;
    --tl-text-secondary: #666666;
    --tl-text-muted: #999999;
    --tl-text-light: #BBBBBB;
    
    /* Typography */
    --tl-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --tl-font-size-xs: 11px;
    --tl-font-size-sm: 13px;
    --tl-font-size-base: 14px;
    --tl-font-size-md: 16px;
    --tl-font-size-lg: 18px;
    --tl-font-size-xl: 22px;
    --tl-font-size-2xl: 28px;
    --tl-font-size-3xl: 36px;
    
    /* Spacing */
    --tl-space-xs: 4px;
    --tl-space-sm: 8px;
    --tl-space-md: 16px;
    --tl-space-lg: 24px;
    --tl-space-xl: 32px;
    --tl-space-2xl: 48px;
    --tl-space-3xl: 64px;
    
    /* Layout */
    --tl-container: 1440px;
    --tl-container-padding: 20px;
    
    /* Borders */
    --tl-radius-sm: 4px;
    --tl-radius-md: 8px;
    --tl-radius-lg: 12px;
    --tl-radius-xl: 16px;
    --tl-radius-full: 50%;
    
    /* Shadows */
    --tl-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --tl-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --tl-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --tl-shadow-xl: 0 12px 36px rgba(0,0,0,0.15);
    
    /* Transitions */
    --tl-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --tl-transition-fast: all 0.15s ease;
    
    /* Z-index */
    --tl-z-dropdown: 100;
    --tl-z-sticky: 200;
    --tl-z-header: 300;
    --tl-z-overlay: 400;
    --tl-z-modal: 500;
    --tl-z-floating: 600;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--tl-font);
    font-size: var(--tl-font-size-base);
    line-height: 1.6;
    color: var(--tl-text);
    background-color: var(--tl-bg);
    overflow-x: hidden;
}

a {
    color: var(--tl-primary);
    text-decoration: none;
    transition: var(--tl-transition-fast);
}

a:hover {
    color: var(--tl-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

ul, ol {
    list-style: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* Container - wider like thienlong.vn */
.container {
    max-width: var(--tl-container);
    margin: 0 auto;
    padding: 0 var(--tl-container-padding);
}

/* Section Styles */
section {
    padding: var(--tl-space-2xl) 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--tl-space-lg);
    flex-wrap: wrap;
    gap: var(--tl-space-md);
}

.section-title {
    font-size: var(--tl-font-size-xl);
    font-weight: 700;
    color: var(--tl-text);
    display: flex;
    align-items: center;
    gap: var(--tl-space-sm);
}

.section-title i {
    color: var(--tl-primary);
}

.section-view-all {
    font-size: var(--tl-font-size-sm);
    color: var(--tl-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--tl-space-xs);
    transition: var(--tl-transition);
}

.section-view-all:hover {
    color: var(--tl-primary-dark);
    gap: var(--tl-space-sm);
}

/* Tabbed Section Header */
.tabbed-header {
    flex-wrap: wrap;
}

.section-tabs {
    display: flex;
    gap: var(--tl-space-sm);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: var(--tl-font-size-sm);
    font-weight: 500;
    color: var(--tl-text-secondary);
    background: var(--tl-white);
    border: 1px solid var(--tl-border);
    transition: var(--tl-transition);
    cursor: pointer;
}

.tab-btn:hover {
    color: var(--tl-primary);
    border-color: var(--tl-primary);
    background: rgba(17, 68, 148, 0.05);
}

.tab-btn.active {
    color: var(--tl-primary);
    background: var(--tl-white);
    border-color: var(--tl-primary);
    font-weight: 600;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Products Grid - Desktop: CSS Grid, Mobile: Swiper 2x2 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--tl-space-md);
}

/* Products Swiper - Desktop behaves like grid */
@media (min-width: 769px) {
    .products-swiper {
        overflow: visible;
    }
    .products-swiper .swiper-wrapper {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: var(--tl-space-md);
        transform: none !important;
    }
    .products-swiper .swiper-slide {
        width: auto !important;
        margin: 0 !important;
    }
    .products-swiper .products-swiper-pagination {
        display: none;
    }
}

/* Products Swiper - Mobile: 2x2 slider */
@media (max-width: 768px) {
    .products-swiper {
        overflow: hidden;
        padding-bottom: 36px;
    }
    .products-swiper .swiper-wrapper {
        display: flex;
    }
    .products-swiper .swiper-slide {
        height: auto;
    }
    .products-swiper .products-swiper-pagination {
        bottom: 0;
    }
    .products-swiper .products-swiper-pagination .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
    }
    .products-swiper .products-swiper-pagination .swiper-pagination-bullet-active {
        width: 20px;
        border-radius: 10px;
        background: var(--tl-primary);
    }
}

/* Products Empty State */
.products-empty,
.blog-empty,
.flash-sale-empty {
    text-align: center;
    padding: var(--tl-space-3xl) var(--tl-space-lg);
    background: var(--tl-white);
    border-radius: var(--tl-radius-lg);
    color: var(--tl-text-muted);
}

.products-empty i,
.blog-empty i {
    font-size: 48px;
    margin-bottom: var(--tl-space-md);
    display: block;
    opacity: 0.3;
}

/* Page Wrapper */
.page-wrapper {
    padding: var(--tl-space-2xl) 0;
    background: var(--tl-white);
    min-height: 60vh;
}

.page-header {
    margin-bottom: var(--tl-space-xl);
    padding-bottom: var(--tl-space-lg);
    border-bottom: 2px solid var(--tl-bg);
}

.page-title {
    font-size: var(--tl-font-size-2xl);
    font-weight: 700;
    color: var(--tl-text);
}

.page-subtitle {
    font-size: var(--tl-font-size-md);
    color: var(--tl-text-secondary);
    margin-top: 8px;
}

/* Page Banner Hero */
.page-banner {
    background-size: cover;
    background-position: center;
    padding: var(--tl-space-3xl) 0;
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
}

.page-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(17,68,148,0.7) 0%, rgba(17,68,148,0.4) 100%);
}

.page-banner .container {
    position: relative;
    z-index: 2;
}

.page-banner-title {
    font-size: var(--tl-font-size-3xl);
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.page-banner-subtitle {
    font-size: var(--tl-font-size-lg);
    color: rgba(255,255,255,0.9);
    margin-top: 8px;
}

.entry-content {
    font-size: var(--tl-font-size-md);
    line-height: 1.8;
}

.entry-content h2 { font-size: var(--tl-font-size-xl); margin: 24px 0 12px; }
.entry-content h3 { font-size: var(--tl-font-size-lg); margin: 20px 0 10px; }
.entry-content p { margin-bottom: 16px; }
.entry-content ul, .entry-content ol { margin: 16px 0; padding-left: 24px; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 8px; }
.entry-content img { border-radius: var(--tl-radius-md); margin: 16px 0; }

/* Breadcrumb - thienlong.vn style */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    font-size: var(--tl-font-size-sm);
    color: var(--tl-text-muted);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--tl-text-secondary);
}

.breadcrumb a:hover {
    color: var(--tl-primary);
}

.breadcrumb .separator {
    color: var(--tl-text-light);
    font-size: 10px;
}

/* Swiper Customizations */
.swiper-button-prev,
.swiper-button-next {
    width: 40px;
    height: 40px;
    background: var(--tl-white);
    border-radius: var(--tl-radius-full);
    box-shadow: var(--tl-shadow-md);
    transition: var(--tl-transition);
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 14px;
    font-weight: 700;
    color: var(--tl-text);
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: var(--tl-primary);
    box-shadow: var(--tl-shadow-lg);
}

.swiper-button-prev:hover::after,
.swiper-button-next:hover::after {
    color: var(--tl-white);
}

.swiper-pagination-bullet {
    background: var(--tl-text-light);
    opacity: 1;
}

.swiper-pagination-bullet-active {
    background: var(--tl-primary);
    width: 24px;
    border-radius: 12px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-primary { color: var(--tl-primary); }
.text-red { color: var(--tl-red); }
.text-muted { color: var(--tl-text-muted); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--tl-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--tl-text-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tl-text-muted);
}

/* Selection */
::selection {
    background: var(--tl-primary);
    color: var(--tl-white);
}
