/* =========================================
   1. VARIABLES & RESET
========================================= */
:root {
    --primary-color: #D32F2F; 
    --primary-dark: #B71C1C;
    --accent-color: #FF9800; 
    --text-light: #FFFFFF;
    --text-dark: #111111;
    --background-dark: #111111; 
    --background-light: #FFFFFF;
    --font-main: 'Roboto', sans-serif;
    --font-heading: 'Oswald', sans-serif;
    --transition-smooth: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: #f4f4f4;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* =========================================
   2. GLOBAL CLASSES
========================================= */
.container { padding: 60px 5%; background: #fff; }
.container-inner { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.text-center { text-align: center; }

/* =========================================
   3. HEADER & NAVIGATION
========================================= */
.main-header {
    background-color: var(--background-light);
    position: sticky; 
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.top-bar {
    background: var(--background-dark);
    color: var(--text-light);
    text-align: center;
    padding: 8px;
    font-size: 13px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    max-width: 1300px;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: bold;
    color: var(--text-dark);
    text-transform: uppercase;
}

.logo span { color: var(--primary-color); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links > li {
    position: relative;
    padding: 10px 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    position: relative;
    padding: 5px 0;
    transition: var(--transition-smooth);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover, .nav-links a.sale-link { color: var(--primary-color); }
.nav-links a:hover::after, .nav-links a.sale-link::after { width: 100%; }

.arrow {
    font-size: 12px;
    margin-left: 4px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.dropdown:hover .arrow { transform: rotate(180deg); }

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--background-light);
    min-width: 220px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    padding: 10px 0;
    border: 1px solid #eee;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li { width: 100%; }

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    text-transform: none;
    color: var(--text-dark);
    transition: 0.2s ease;
}

.dropdown-menu a::after { display: none; }

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
    padding-left: 25px;
}

/* Nav Icons & Cart Count */
.nav-icons {
    display: flex;
    gap: 20px;
    color: var(--text-dark);
    font-size: 20px;
    align-items: center;
}

.icon-cart { position: relative; cursor: pointer; }

.cart-count {
    position: absolute;
    top: -8px; right: -12px;
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 50%;
}

/* =========================================
   4. HERO SLIDER
========================================= */
.hero-slider-section {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.hero-slider {
    display: flex;
    transition: transform 0.6s ease-in-out;
}

.slide { min-width: 100%; }
.slide img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    display: block;
}

.slider-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.3); color: white;
    border: none; font-size: 24px; padding: 15px 20px;
    cursor: pointer; transition: 0.3s; z-index: 10;
}
.slider-btn:hover { background: var(--primary-color); }
.prev-btn { left: 20px; } 
.next-btn { right: 20px; }

.slider-dots {
    position: absolute; bottom: 20px; width: 100%;
    text-align: center; z-index: 10;
}

.dot {
    cursor: pointer; height: 12px; width: 12px; margin: 0 5px;
    background: rgba(255,255,255,0.5); border-radius: 50%;
    display: inline-block; transition: 0.3s;
}

.dot.active, .dot:hover {
    background: var(--primary-color); width: 25px; border-radius: 10px;
}

/* =========================================
   5. CATEGORY SHOWCASE
========================================= */
.category-showcase {
    display: grid;
    grid-template-columns: 2fr 1fr; gap: 30px;
}

.cat-card {
    position: relative; border-radius: 8px; overflow: hidden;
    color: var(--text-light); transition: var(--transition-smooth);
}

.cat-card img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.cat-card::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.cat-main { grid-row: 1 / 3; height: 500px; }
.cat-content { position: absolute; bottom: 30px; left: 30px; z-index: 10; }
.cat-main h2 { font-family: var(--font-heading); font-size: 36px; text-transform: uppercase; }
.cat-side h3 { font-family: var(--font-heading); font-size: 24px; text-transform: uppercase; }
.cat-link { color: var(--accent-color); font-weight: bold; margin-top: 10px; display: inline-block; text-decoration: none;}
.cat-card:hover img { transform: scale(1.05); }

/* Placeholder Cards */
.cat-card.text-placeholder-card {
    background-color: var(--background-dark);
    display: flex; justify-content: center; align-items: center;
    border: 1px solid #333;
}
.cat-card.text-placeholder-card::after {
    background: linear-gradient(135deg, rgba(211,47,47,0.8), rgba(255,152,0,0.4));
    z-index: 1;
}

.visual-placeholder {
    font-family: var(--font-heading);
    font-size: 150px; font-weight: bold; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.1); 
    line-height: 1; z-index: 2; user-select: none; position: absolute;
}
.visual-placeholder span { display: none; }
.cat-card.text-placeholder-card .cat-content { z-index: 10; }

/* =========================================
   6. BEST SELLER SECTION
========================================= */
.best-seller-section { background-color: #f8f9fa; padding: 60px 0; }
.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; border-bottom: 2px solid #eaeaea; padding-bottom: 10px;
}
.section-header .section-title { color: var(--primary-dark); font-family: var(--font-heading); font-size: 28px;}
.view-all-btn { color: var(--primary-color); font-weight: bold; text-decoration: none;}

.bs-grid, .product-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 20px; 
}

.bs-card, .product-card {
    background: #fff; border-radius: 8px; position: relative;
    transition: 0.3s;
}

.bs-card { padding: 15px; border: 1px solid #eee; }
.bs-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }

.bs-badge, .product-badge {
    position: absolute; color: white; font-weight: bold; z-index: 2;
}
.bs-badge { font-size: 12px; padding: 4px 8px; border-radius: 4px; }
.hot-badge { top: 15px; left: 15px; background: #FF0000; }
.discount-badge { top: 15px; right: 15px; background: #FF9800; }

.bs-img { height: 220px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 15px;}
.bs-img img, .product-img-wrapper img { width: 100%; height: 100%; object-fit: contain; transition: 0.3s; }
.bs-card:hover .bs-img img, .product-card:hover .product-img-wrapper img { transform: scale(1.05); }

.bs-name { font-size: 15px; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bs-rating { font-size: 12px; margin-bottom: 10px; }
.bs-sold { color: #888; font-weight: 400; }
.bs-price-wrap { display: flex; gap: 10px; margin-bottom: 15px; align-items: center;}
.bs-price-new { color: var(--primary-color); font-size: 18px; font-weight: bold; }
.bs-price-old { color: #aaa; font-size: 14px; text-decoration: line-through; }

.bs-add-btn { 
    width: 100%; padding: 10px; background: var(--primary-color); color: white; 
    border: none; border-radius: 4px; font-weight: bold; cursor: pointer; transition: 0.3s;
}
.bs-add-btn:hover { background: var(--primary-dark); }

/* =========================================
   7. TECH GRID SECTION (NEW ARRIVALS)
========================================= */
.tech-grid-section { background-color: var(--background-dark); padding: 80px 0; }
.tech-grid-section .section-title { color: var(--text-light); font-family: var(--font-heading); font-size: 36px; margin-bottom: 40px;}

.product-grid { gap: 25px; }
.product-card {
    background: #1A1A1A; overflow: hidden;
    border: 1px solid #333;
}
.product-card:hover { transform: translateY(-8px); border-color: var(--primary-color); }

.product-badge { top: 15px; left: 15px; background: var(--primary-color); padding: 4px 12px; font-size: 12px; border-radius: 20px; z-index: 10; }
.product-img-wrapper { height: 280px; overflow: hidden; }
.product-img-wrapper img { object-fit: cover; }
.product-hero .product-img-wrapper { height: 380px; }

.product-info { padding: 20px; color: var(--text-light); text-align: left;}
.product-name { font-size: 16px; margin-bottom: 8px; font-weight: 500;}
.product-card .price { color: var(--accent-color); font-size: 18px; font-weight: bold; margin-bottom: 15px; font-family: var(--font-heading);}

.add-to-cart { 
    width: 100%; padding: 10px; border: 2px solid var(--primary-color); 
    background: transparent; color: var(--primary-color); font-weight: bold; 
    cursor: pointer; border-radius: 4px; transition: 0.3s; 
}
.add-to-cart:hover { background: var(--primary-color); color: white; }

/* =========================================
   8. CART SIDEBAR & OVERLAY
========================================= */
.cart-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); z-index: 1001;
    display: none; opacity: 0; transition: opacity 0.3s ease;
}
.cart-overlay.active { display: block; opacity: 1; }

.cart-sidebar {
    position: fixed; top: 0; right: -450px; 
    width: 400px; max-width: 100%; height: 100vh;
    background: #fff; z-index: 1002;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    display: flex; flex-direction: column;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.cart-sidebar.active { right: 0; }

.cart-header {
    padding: 20px; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
.cart-header h2 { font-family: var(--font-heading); font-size: 24px; color: var(--primary-dark); }
.close-cart { font-size: 32px; background: none; border: none; cursor: pointer; color: #666; transition: 0.3s; line-height: 1;}
.close-cart:hover { color: var(--primary-color); transform: scale(1.1); }

.cart-items { flex: 1; overflow-y: auto; padding: 20px; }
.cart-item { display: flex; gap: 15px; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid #eee; }

.cart-item-info { flex: 1; }
.cart-item-title { font-size: 14px; font-weight: 500; margin-bottom: 5px; line-height: 1.4; }
.cart-item-price { color: var(--primary-color); font-weight: bold; margin-bottom: 10px; }
.cart-item-quantity { display: flex; align-items: center; gap: 15px; }

.qty-btn { background: #f4f4f4; border: none; width: 28px; height: 28px; cursor: pointer; font-weight: bold; border-radius: 4px; transition: 0.2s; }
.qty-btn:hover { background: #ddd; }
.remove-item { color: #888; font-size: 13px; cursor: pointer; text-decoration: underline; transition: 0.2s; }
.remove-item:hover { color: var(--primary-color); }

.cart-footer { padding: 20px; border-top: 1px solid #eee; background: #fafafa; }
.cart-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: bold; margin-bottom: 15px; color: var(--text-dark); }
.checkout-btn { width: 100%; padding: 15px; background: var(--primary-color); color: white; border: none; border-radius: 4px; font-family: var(--font-heading); font-size: 18px; cursor: pointer; transition: 0.3s; }
.checkout-btn:hover { background: var(--primary-dark); }

/* =========================================
   9. FOOTER
========================================= */
.simple-footer {
    background-color: var(--background-dark);
    color: var(--text-light);
    padding: 25px 0;
    margin-top: 50px;
    border-top: 3px solid var(--primary-color);
}
.simple-footer .footer-hotline {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-light);
    margin-bottom: 10px;
}
.simple-footer .footer-copyright { font-size: 14px; color: #888; }

/* =========================================
   10. MEDIA QUERIES (RESPONSIVE)
========================================= */
@media screen and (max-width: 992px) {
    .category-showcase { grid-template-columns: 1fr; }
    .cat-main { grid-row: auto; height: 400px; }
    .slide img { height: 450px; }
}

@media screen and (max-width: 768px) {
    .container { padding: 40px 5%; }
    .navbar { flex-wrap: wrap; padding: 15px 5%; }
    .logo { font-size: 24px; }
    
    .nav-links {
        order: 3;
        width: 100%;
        margin-top: 15px;
        gap: 15px;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        justify-content: flex-start;
    }
    .nav-links::-webkit-scrollbar { display: none; }
    
    .slide img { height: 250px; }
    .slider-btn { padding: 10px 15px; font-size: 18px; }

    .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .section-header .section-title, .tech-grid-section .section-title { font-size: 22px; }
    .cat-main h2 { font-size: 28px; }

    .cart-sidebar { width: 100%; right: -100%; }
    
    .bs-grid, .product-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 15px; }
    .bs-img { height: 160px; }
    .product-img-wrapper { height: 200px; }
    .product-hero .product-img-wrapper { height: 250px; }
    .bs-name { font-size: 14px; }
    .bs-price-new, .product-card .price { font-size: 16px; }
}

@media screen and (max-width: 480px) {
    .bs-grid, .product-grid { grid-template-columns: 1fr; }
    .slide img { height: 200px; }
}