/*
Theme Name: Flatsome Child
Theme URI: https://example.com
Description: Child theme for Flatsome
Author: Nguyen Dai Nghia
Template: flatsome
Version: 1.0.0
Text Domain: flatsome-child
*/


/* ==========================================
   SHOPEE HEADER - PERFECT MATCH CSS
   Based on actual Shopee screenshots
   ========================================== */

:root {
    --shopee-primary: #EE4D2D;
    --shopee-hover: #D73502;
    --shopee-white: #ffffff;
    --shopee-text-light: rgba(255,255,255,0.9);
    --shopee-border: #e5e5e5;
    --shopee-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Reset base styles */
* {
    box-sizing: border-box;
}

/* ==========================================
   TOP BAR - THIN HEADER
   ========================================== */

.header-topbar {
    background: var(--shopee-primary);
    font-size: 12px;
    line-height: 1.2;
    min-height: 34px;
    position: relative;
}

.topbar-links {
    display: flex;
    align-items: center;
    height: 34px;
}

.topbar-account {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 34px;
}

.topbar-link {
    color: var(--shopee-text-light);
    text-decoration: none;
    font-size: 12px;
    padding: 8px 4px;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.topbar-link:hover {
    opacity: 0.8;
    color: var(--shopee-text-light);
    text-decoration: none;
}

.separator {
    color: var(--shopee-text-light);
    opacity: 0.7;
    margin: 0 8px;
    font-size: 12px;
}

.connect-text {
    color: var(--shopee-text-light);
    font-size: 12px;
    margin-right: 8px;
    padding: 8px 4px;
}

.social-link {
    color: var(--shopee-text-light);
    padding: 2px 4px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.social-link:hover {
    opacity: 0.8;
    color: var(--shopee-text-light);
}

/* Language Dropdown */
.language-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--shopee-white);
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    padding: 8px 0;
    display: none;
    z-index: 1000;
    min-width: 140px;
    margin-top: 2px;
}

.language-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    font-size: 12px;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f5f5f5;
    color: #333;
}

.dropdown-item.active {
    background: var(--shopee-primary);
    color: var(--shopee-white);
}

/* ==========================================
   MAIN HEADER - LOGO + SEARCH + CART
   ========================================== */

.header-main {
    background: var(--shopee-primary);
    padding: 12px 0;
    box-shadow: var(--shopee-shadow);
    position: relative;
}

/* Logo Section */
.logo-section {
    display: flex;
    align-items: center;
    padding-left: 0;
}

.shopee-logo img {
    width: 162px;
    height: 50px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* Search Section */
.search-section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
    padding: 0 16px;
}

.search-wrapper {
    width: 100%;
    max-width: 840px;
}

.search-form {
    width: 100%;
    margin-bottom: 8px;
}

.search-container {
    display: flex;
    background: var(--shopee-white);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    height: 40px;
}

.search-input {
    flex: 1;
    border: none;
    padding: 0 16px;
    font-size: 14px;
    color: #333;
    background: transparent;
    outline: none;
    font-family: inherit;
    line-height: 40px;
    height: 40px;
}

.search-input::placeholder {
    color: #999;
    font-size: 14px;
}

.search-button {
    background: var(--shopee-primary);
    border: none;
    padding: 0 24px;
    color: var(--shopee-white);
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 60px;
}

.search-button:hover {
    background: var(--shopee-hover);
}

.search-button i {
    font-size: 16px;
}

/* Popular Searches */
.popular-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.search-tag {
    color: var(--shopee-text-light);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.search-tag:hover {
    color: var(--shopee-white);
    text-decoration: none;
}

/* Cart Section */
.cart-section {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 0;
}

.header-cart {
    position: relative;
}

.cart-icon {
    position: relative;
    display: block;
    text-decoration: none;
    padding: 8px;
    transition: opacity 0.2s ease;
}

.cart-icon:hover {
    opacity: 0.8;
}

.cart-icon svg {
    width: 26px;
    height: 26px;
    display: block;
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--shopee-white);
    color: var(--shopee-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid var(--shopee-primary);
}

/* ==========================================
   NAVIGATION MENU
   ========================================== */

.header-navigation {
    background: var(--shopee-white);
    border-top: 1px solid var(--shopee-border);
    box-shadow: var(--shopee-shadow);
}

.main-nav {
    height: 40px;
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    width: 100%;
    height: 40px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-list::-webkit-scrollbar {
    display: none;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    padding: 12px 16px;
    white-space: nowrap;
    transition: color 0.2s ease;
    border-bottom: 2px solid transparent;
    height: 40px;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    color: var(--shopee-primary);
    text-decoration: none;
    border-bottom-color: var(--shopee-primary);
}

.nav-link.active,
.nav-link.current-menu-item {
    color: var(--shopee-primary);
    border-bottom-color: var(--shopee-primary);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Large screens (1200px+) */
@media (min-width: 1200px) {
    .search-wrapper {
        max-width: 920px;
    }
    
    .nav-link {
        padding: 12px 20px;
    }
}

/* Medium screens (768px - 1199px) */
@media (max-width: 1199px) {
    .search-wrapper {
        max-width: 600px;
    }
    
    .popular-searches .search-tag:nth-child(n+5) {
        display: none;
    }
    
    .nav-link {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* Small screens (481px - 767px) */
@media (max-width: 767px) {
    .header-topbar {
        padding: 2px 0;
    }
    
    .topbar-links,
    .topbar-account {
        font-size: 11px;
        flex-wrap: wrap;
        height: auto;
        min-height: 30px;
        align-items: center;
    }
    
    .topbar-account {
        justify-content: flex-start;
        margin-top: 2px;
    }
    
    /* Hide some topbar elements */
    .topbar-links .separator:nth-of-type(n+2),
    .topbar-links .topbar-link:nth-child(n+4) {
        display: none;
    }
    
    .header-main {
        padding: 8px 0;
    }
    
    .logo-section {
        order: 1;
        margin-bottom: 8px;
    }
    
    .search-section {
        order: 2;
        padding: 0 8px;
        margin-bottom: 8px;
    }
    
    .cart-section {
        order: 3;
    }
    
    .shopee-logo img {
        width: 120px;
        height: 37px;
    }
    
    .search-container {
        height: 36px;
    }
    
    .search-input {
        font-size: 13px;
        padding: 0 12px;
        line-height: 36px;
        height: 36px;
    }
    
    .search-button {
        padding: 0 16px;
        height: 36px;
        min-width: 50px;
    }
    
    .popular-searches {
        display: none;
    }
    
    .cart-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .nav-link {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Extra small screens (< 480px) */
@media (max-width: 480px) {
    .topbar-account .separator:nth-of-type(n+2),
    .topbar-account .topbar-link:nth-child(n+5) {
        display: none;
    }
    
    .search-input {
        font-size: 12px;
        padding: 0 10px;
    }
    
    .search-button {
        padding: 0 12px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.header-sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

.cart-count {
    transition: transform 0.2s ease;
}

.cart-count.updated {
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

.search-button:focus,
.topbar-link:focus,
.nav-link:focus {
    outline: 2px solid rgba(255,255,255,0.8);
    outline-offset: 2px;
}

.cart-icon:focus {
    outline: 2px solid rgba(255,255,255,0.8);
    outline-offset: 2px;
}

/* ==========================================
   PERFORMANCE
   ========================================== */

.header-topbar,
.header-main,
.header-navigation {
    contain: layout style paint;
}

.search-input,
.nav-link,
.cart-icon {
    will-change: auto;
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    .header-topbar,
    .header-navigation {
        display: none !important;
    }
    
    .header-main {
        background: var(--shopee-white) !important;
        color: #000 !important;
        box-shadow: none;
        padding: 20px 0;
    }
    
    .shopee-logo img {
        filter: none;
    }
    
    .search-section,
    .cart-section {
        display: none !important;
    }
}