/* ==========================================================================
   HEADER RENEW STYLES (PURE CUSTOM DOUBLE-ROW HEADER WITH DROPDOWN)
   ========================================================================== */

/* Variables */
:root {
    --header-text-dark: #1f2937;
    --header-text-light: #ffffff;
    --header-transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    --color-primary: #0175be;
    /* Crimson red */
    --color-blue: #02b0f3;
    /* Phone blue */
}

/* Header Base Styling */
.site-header {
    position: relative;
    width: 100%;
    z-index: 1000;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: var(--header-transition);
}

/* Sticky Header State */
.site-header.sticky {
    position: fixed !important;
    top: 0;
    left: 0;
    background: #ffffff !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    animation: slideDownHeader 0.35s ease-out !important;
}

.site-header.sticky .header-top-row {
    display: none;
}

@keyframes slideDownHeader {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* ============================================================
   DESKTOP HEADER LAYOUT
   ============================================================ */
.header-desktop-layout {
    display: block;
}

/* 1. Top Row: Logo, Search, Hotlines + Cart */
.header-top-row {
    background-color: #ffffff;
    padding: 15px 0;
    border-bottom: 1px solid #f3f4f6;
}

.header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 65px;
    width: auto;
    object-fit: contain;
    transition: var(--header-transition);
}

.logo-text {
    font-size: 24px;
    font-weight: 900;
    color: var(--color-primary);
    letter-spacing: 0.5px;
}

/* Search Box */
.header-search-box {
    flex: 1;
    max-width: 440px;
}

.search-form-header {
    position: relative;
    width: 100%;
}

.search-input-header {
    width: 100%;
    height: 38px;
    border-radius: 30px;
    border: 1px solid #d1d5db;
    padding: 0 45px 0 20px;
    font-size: 14.5px;
    color: #111827;
    background-color: #f9fafb;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
}

/* 
.search-input-header:focus {
    border-color: var(--color-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(218, 37, 29, 0.1);
} */

.search-btn-header {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #4b5563;
    display: flex;
    align-items: center;
    padding: 6px;
    transition: color 0.2s ease;
}

.search-btn-header:hover {
    color: var(--color-primary);
}

.search-btn-header span {
    font-size: 20px;
}

/* Top Right Actions: Hotlines + Cart */
.header-top-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.hotline-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hotline-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #da251d;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hotline-icon span {
    font-size: 18px;
}

.hotline-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.hotline-number {
    font-size: 19px;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    line-height: 1.2;
    transition: color 0.2s ease;
}

.hotline-number:hover {
    color: var(--color-primary);
}

.hotline-label {
    font-size: 14px;
    color: #4b5563;
    font-weight: 400;
}

.header-cart-icon {
    text-decoration: none;
    color: #4b5563;
    transition: color 0.2s ease;
}

.header-cart-icon:hover {
    color: #da251d;
}

.cart-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* padding: 4px; */
}

.cart-icon-wrapper .material-symbols-outlined {
    font-size: 28px;
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background-color: #da251d;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

/* 2. Bottom Row: Navigation Menu */
.header-bottom-row {
    background-color: var(--color-primary);
    /* border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #e5e7eb; */
}

.header-bottom-inner {
    display: flex;
    justify-content: center;
    height: 48px;
}

.header-nav-desktop {
    height: 100%;
}

.menu-list-desktop {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    gap: 30px;
}

.menu-item-desktop {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.menu-link-desktop {
    display: inline-flex;
    align-items: center;
    color: #fff !important;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    transition: var(--header-transition);
    padding: 0 4px;
    height: 100%;
    box-sizing: border-box;
    border-bottom: 3px solid transparent;
    gap: 3px;
}

.menu-link-desktop .dropdown-arrow-icon {
    font-size: 15px;
    transition: transform 0.25s ease;
}

.menu-item-desktop:hover .menu-link-desktop .dropdown-arrow-icon {
    transform: rotate(180deg);
}

/* Hover & Active states */
.menu-link-desktop:hover,
.menu-item-desktop.active .menu-link-desktop {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Desktop Dropdown Levels */
.submenu-desktop {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    width: max-content;
    /* min-width: 200px; */
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.25s ease, visibility 0.25s ease;
    z-index: 100;
    border: 1px solid #f3f4f6;
}

.menu-item-desktop:hover>.submenu-desktop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu-item-desktop {
    position: relative;
}

.submenu-link-desktop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: var(--header-transition);
    gap: 10px;
}

.submenu-link-desktop:hover,
.submenu-item-desktop.active>.submenu-link-desktop {
    background-color: #f9fafb;
    color: var(--color-primary);
}

/* Level 3 Desktop Dropdown */
.submenu-desktop.level-3 {
    top: 0;
    left: 100%;
    margin-left: 2px;
}

.submenu-item-desktop:hover>.submenu-desktop.level-3 {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu-arrow-right-icon {
    font-size: 16px;
}

/* ============================================================
   MOBILE HEADER LAYOUT
   ============================================================ */
.header-mobile-layout {
    display: none;
}

.header-mobile-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.header-mobile-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-mobile-right button,
.header-mobile-right a {
    background: transparent;
    border: none;
    color: #1f2937;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    /* padding: 6px; */
}

.header-mobile-right span.material-symbols-outlined {
    font-size: 24px;
}

/* Hamburger toggle menu */
.header-hamburger-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.header-hamburger-toggle .toggle-line {
    width: 100%;
    height: 2px;
    background-color: #1f2937;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.header-hamburger-toggle.active .toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header-hamburger-toggle.active .toggle-line:nth-child(2) {
    opacity: 0;
}

.header-hamburger-toggle.active .toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   MOBILE DRAWER NAVIGATION
   ============================================================ */
.header-mobile-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 1008;
    display: flex;
    flex-direction: column;
    transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.header-mobile-drawer.active {
    left: 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #f3f4f6;
}

.drawer-logo .logo-img {
    height: 38px;
}

.drawer-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #4b5563;
    padding: 6px;
    display: flex;
    align-items: center;
}

.drawer-close-btn span {
    font-size: 24px;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.menu-list-mobile {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item-mobile {
    border-bottom: 1px solid #f9fafb;
}

.menu-link-wrapper-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}

.menu-link-wrapper-mobile .submenu-link-mobile {
    padding: 0;
}

.menu-link-mobile {
    color: #1f2937;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    flex: 1;
}

.mobile-submenu-arrow-toggle {
    /* padding: 6px 12px; */
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.open>.menu-link-wrapper-mobile .mobile-submenu-arrow-toggle {
    transform: rotate(180deg);
}

/* Submenus inside Mobile Drawer */
.submenu-mobile {
    margin: 0;
    background-color: #f9fafb;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.submenu-mobile.level-2 {
    list-style-type: disc;
    padding-left: 35px;
}

.submenu-mobile.level-3 {
    list-style-type: circle;
    padding-left: 20px;
}

.submenu-link-mobile {
    display: block;
    padding: 10px 20px 10px 0px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.submenu-mobile.level-3 .submenu-link-mobile {
    padding-left: 0px;
}

.submenu-item-mobile>.menu-link-wrapper-mobile {
    padding: 10px 20px 10px 00px;
}

.drawer-footer-actions {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid #f3f4f6;
}

.drawer-lang-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.drawer-lang-selector a {
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.drawer-lang-selector a.active {
    color: var(--color-primary);
}

.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1006;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   SEARCH MODAL OVERLAY
   ============================================================ */
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.search-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-modal-container {
    width: 90%;
    max-width: 600px;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.search-modal-overlay.active .search-modal-container {
    transform: scale(1);
}

.search-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 6px;
    display: flex;
    align-items: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.search-modal-close:hover {
    color: var(--color-primary);
    transform: rotate(90deg);
}

.search-modal-close span {
    font-size: 26px;
}

.search-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: 0.5px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 6px;
    transition: border-color 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--color-primary);
}

.search-modal-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    color: #111;
    padding: 10px 40px 10px 5px;
    background: transparent;
}

.search-modal-submit {
    position: absolute;
    right: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.search-modal-submit:hover {
    color: var(--color-primary);
}

.search-modal-submit span {
    font-size: 24px;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 1200px) {
    .menu-list-desktop {
        gap: 15px;
    }
}

@media (max-width: 1024px) {
    .header-desktop-layout {
        display: none;
    }

    .header-mobile-layout {
        display: block;
    }

    .site-header {
        /* position: fixed !important; */
        top: 0;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        border-bottom: 1px solid #f3f4f6;
    }

    .header-hamburger-toggle {
        display: flex;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 45px;
    }
}