/* =========================================================
   TVC STORE - RESPONSIVE CSS
   ========================================================= */


/* =========================================================
   1. CSS VARIABLES
   ========================================================= */

:root {
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;

    --red-500: #ef4444;

    --yellow-300: #fde047;
    --yellow-400: #facc15;

    --white: #ffffff;

    --max-width: 1280px;
}


/* =========================================================
   2. RESET
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-width: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    overflow-x: hidden;
}

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

button,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}


/* =========================================================
   3. CONTAINER
   ========================================================= */

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}


/* =========================================================
   4. TOP BAR & RESPONSIVE LAYOUT
   ========================================================= */

.top-bar {
    width: 100%;
    background-color: var(--blue-900);
    color: var(--white);
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid var(--blue-800);
}

.top-bar-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.top-bar i {
    margin-right: 0.25rem;
}


/* =========================================================
   LANGUAGE DROPDOWN (Modern Light Card Design)
   ========================================================= */

.lang-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.lang-toggle:hover {
    background-color: var(--blue-800);
}

.lang-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 105px;
    background-color: #e5e7eb; /* Light gray card background */
    border-radius: 16px; /* Smooth large rounded corners */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); /* Soft elevated shadow */
    z-index: 5000;
    padding: 6px;
    overflow: hidden;
}

.lang-dropdown-menu.show {
    display: block;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--blue-900); /* Dark text color */
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    border-radius: 10px; /* Rounded options on hover */
    transition: background-color 0.2s ease;
}

.lang-option:hover {
    background-color: rgba(0, 0, 0, 0.08); /* Subtle dark hover effect */
}

.lang-flag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* =========================================================
   RESPONSIVE BREAKPOINTS (TABLETS, IPADS & LAPTOPS >= 577px)
   ========================================================= */

@media screen and (min-width: 577px) {
    .top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1.5rem;
    }

    .top-bar-group {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }

    /* Left: Verified Suppliers */
    .top-bar-suppliers {
        flex: 1;
        justify-content: flex-start;
    }

    /* Middle: Customer Service & Time (Centered on iPad & Laptop) */
    .top-bar-middle.top-bar-service {
        flex: 2;
        justify-content: center;
        gap: 1.5rem;
        font-size: 0.72rem;
    }

    /* Right: Language & Sign-in */
    .top-bar-auth {
        flex: 1;
        justify-content: flex-end;
        gap: 1.25rem;
    }
}


/* =========================================================
   RESPONSIVE BREAKPOINTS (MOBILE PHONES <= 576px)
   ========================================================= */

@media screen and (max-width: 576px) {
    .top-bar {
        padding: 6px 8px;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start; /* Packs items tightly to the left */
        align-items: center;
        font-size: 0.52rem; 
        gap: 6px; /* Controls how close Verified Supplier and Customer Service are */
    }

    /* 1. Verified Suppliers -> Top Line (Left) */
    .top-bar-suppliers {
        order: 1;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* 2. Customer Service & Time Group -> Top Line (Tucked right next to Verified Suppliers) */
    .top-bar-middle.top-bar-service {
        order: 2;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
        font-size: 0.52rem;
    }

    /* 3. Language & Sign-in Section -> Second Line (Forced to new row, pushed to the right) */
    .top-bar-auth {
        order: 3;
        flex: 0 0 100%; 
        width: 100%;
        display: flex;
        justify-content: flex-end; 
        align-items: center;
        border-top: 1px solid var(--blue-800);
        padding-top: 5px;
        margin-top: 2px;
        font-size: 0.6rem;
        gap: 12px;
    }
}
/* =========================================================
   DEFAULT DESKTOP & IPAD VIEW (Single Row)
   ========================================================= */

.main-header {
    width: 100%;
    background-color: var(--white);
    padding: 1rem 2rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.header-container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.logo-image-link {
    display: flex;
    align-items: center;
}

.header-logo-img {
    width: 45px;
    height: auto;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-tvc {
    font-size: 2rem; /* Make TVC bigger */
    font-weight: 800;
    color: var(--blue-900);
}

.logo-store {
    font-size: 0.75rem; /* Make STORE smaller */
    font-weight: 600;
    color: var(--blue-900);
    letter-spacing: 0.5px;
    text-align: center;
}

.logo-tagline {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-left: 1rem;
    border-left: 1px solid var(--gray-300);
    padding-left: 1rem;
}

/* Search Bar */
.search-container {
    flex: 1;
    max-width: 42rem;
    min-width: 150px;
    margin: 0 1rem;
}

.search-box {
    width: 100%;
    display: flex;
    border: 2px solid var(--blue-600);
    border-radius: 9999px;
    overflow: hidden;
    background-color: var(--white);
}

.search-input {
    width: 100%;
    min-width: 0;
    padding: 0.5rem 1rem;
    border: none;
    outline: none;
    font-size: 0.875rem;
}

.search-btn {
    flex-shrink: 0;
    background-color: var(--blue-600);
    color: var(--white);
    padding: 0.5rem 1.5rem;
    border: none;
}

.search-btn:hover {
    background-color: var(--blue-700);
}

/* Header Icons */
.header-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--blue-900);
    flex-shrink: 0;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
}

.icon-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.icon-item:hover {
    color: var(--blue-600);
}


/* =========================================================
   MOBILE VIEW (Phones under 768px) - Two-Row Layout
   ========================================================= */

@media screen and (max-width: 768px) {
    .top-bar {
        padding: 6px 8px;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start; /* Packs items tightly to the left */
        align-items: center;
        font-size: 0.52rem; 
        gap: 6px; /* Controls how close Verified Supplier and Customer Service are */
    }

    /* 1. Verified Suppliers -> Top Line (Left) */
    .top-bar-suppliers {
        order: 1;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* 2. Customer Service & Time Group -> Top Line (Tucked right next to Verified Suppliers) */
    .top-bar-middle.top-bar-service {
        order: 2;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
        font-size: 0.52rem;
    }

    /* 3. Language & Sign-in Section -> Second Line (Forced to new row, pushed to the right) */
    .top-bar-auth {
        order: 3;
        flex: 0 0 100%; 
        width: 100%;
        display: flex;
        justify-content: flex-end; 
        align-items: center;
        border-top: 1px solid var(--blue-800);
        padding-top: 5px;
        margin-top: 2px;
        font-size: 0.6rem;
        gap: 12px;
    }
    .main-header {
        padding: 0.6rem 0.75rem;
    }

    .header-container {
        display: grid;
        grid-template-columns: 1fr auto;
        row-gap: 0.6rem;
        column-gap: 0.5rem;
        align-items: center;
    }

    /* 1. Logo & TVC Store Centered on Top Row spanning full width */
    .logo-section {
        grid-column: 1 / -1;
        justify-content: center;
        text-align: left;
        gap: 0.4rem;
    }

    .header-logo-img {
        width: 38px;
    }

    .logo-text {
        font-size: 0.9rem;
        font-weight: 800;
        line-height: 1.1;
        white-space: nowrap;
    }

    /* Hide extra desktop text on mobile */
    .logo-tagline, 
    .verified-badge {
        display: none !important;
    }

    /* 2. Search Bar on Bottom Left */
    .search-container {
        grid-column: 1 / 2;
        margin: 0;
        min-width: 0;
    }

    .search-input {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    .search-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }

    /* 3. Order, Wishlist, Cart on Bottom Right in One Line (No Wrap) */
    .header-icons {
        grid-column: 2 / 3;
        display: flex;
        flex-direction: row;
        gap: 0.6rem;
        flex-wrap: nowrap;
    }

    .icon-item {
        font-size: 0.65rem;
    }

    .icon-item i {
        font-size: 1rem;
        margin-bottom: 0.1rem;
    }
}


/* =========================================================
   10. NAVIGATION
   ========================================================= */

.main-nav {
    width: 100%;
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.03);
}

.nav-container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--blue-900);
    padding: 0.75rem 2rem;
    flex-wrap: wrap;
}

.nav-container a {
    position: relative;
    padding: 0.25rem 0;
    font-weight: normal;
    white-space: nowrap;
    transition:
        color 0.2s ease-in-out;
}

.nav-container a:hover {
    color: var(--blue-600);
}

.nav-container a.nav-active,
.nav-container a.active {
    font-weight: bold;

    color: var(--blue-600);
}


/* =========================================================
   11. CATEGORY DROPDOWN (Pill / Bubble Style with Pointer)
   ========================================================= */

.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background-color: #e5e7eb; /* Light gray background */
    min-width: 240px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    border-radius: 1.5rem; /* Rounded pill style corners */
    border: none;
    padding: 1rem 0;
    z-index: 4000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

/* Little triangle pointer at the top of the dropdown box */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 45px; /* Adjusts where the arrow points horizontally */
    width: 12px;
    height: 12px;
    background-color: #e5e7eb;
    transform: rotate(45deg);
    border-top-left-radius: 3px;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.6rem 1.5rem;
    font-size: 0.875rem;
    color: var(--gray-800);
    font-weight: normal;
    text-align: center; /* Centers the text inside the box */
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05); /* Soft dark hover tint for gray theme */
    color: var(--blue-600);
}