/* ==========================================================================
   PHONE STORE - LAYOUT: HEADER & MEGA MENU
   Modern Glassmorphism & Cyber Tech Luxury Aesthetics (Cyber Blue Theme)
   ========================================================================== */

/* Base Body Offset for Fixed Header */
body {
    margin: 0 !important;
    padding-top: 154px !important;
}

@media(max-width:1199px) {
    body {
        margin: 0 !important;
        padding-top: 76px !important;
    }
}

@media(max-width: 767px) {
    body {
        margin: 0 !important;
        padding-top: 60px !important;
        padding-bottom: calc(var(--mobile-bottom-nav-h, 56px) + var(--sab, 0px) + 14px) !important;
    }
}

/* ==========================================================================
   HEADER MAIN WRAPPER
   ========================================================================== */
.site-header-v2 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--hdr-glass-bg, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--hdr-border, rgba(226, 232, 240, 0.85));
    box-shadow: var(--hdr-shadow, 0 10px 30px rgba(10, 17, 24, 0.06));
    transition: all 0.3s ease;
}

/* Top Announcement / Ticker Bar (Cyber Tech Deep Navy/Blue) */
.hdr-top-bar {
    background: linear-gradient(90deg, #06152b 0%, #003a8c 50%, #06152b 100%);
    color: #e0f2fe;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hdr-top-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hdr-top-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.2px;
}

.hdr-top-msg .badge-hot {
    background: #ff4757;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    text-transform: uppercase;
    animation: pulseGlow 2s infinite;
}

.hdr-top-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.hdr-top-link {
    color: #bae6fd;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.hdr-top-link:hover {
    color: #ffffff;
}

@media(max-width:1199px) {
    .hdr-top-bar {
        display: none;
    }
}

/* ==========================================================================
   MAIN NAVIGATION ROW
   ========================================================================== */
.hdr-main {
    background: transparent;
}

.hdr-main-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* Brand Logo */
.hdr-brand-box {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.hdr-brand-logo-img {
    height: 48px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    transition: transform 0.2s;
}

.hdr-brand-box:hover .hdr-brand-logo-img {
    transform: scale(1.02);
}

.hdr-brand-badge {
    background: var(--hdr-primary, #0062ff);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: none;
}

@media (min-width: 1200px) {
    .hdr-brand-badge {
        display: inline-block;
    }
}

/* Modern Smart Search Bar */
.hdr-search-pill {
    flex: 1;
    max-width: 480px;
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 2px 2px 2px 14px;
    transition: all 0.2s ease;
}

.hdr-search-pill:focus-within {
    background: #ffffff;
    border-color: var(--hdr-primary, #0062ff);
    box-shadow: 0 0 0 3px rgba(0, 98, 255, 0.12);
}

.hdr-search-pill input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--hdr-text, #1a2332);
    outline: none;
    padding: 7px 0;
}

.hdr-search-pill input::placeholder {
    color: #94a3b8;
}

.hdr-search-pill button[type="submit"] {
    background: var(--hdr-primary, #0062ff);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.hdr-search-pill button[type="submit"]:hover {
    background: var(--hdr-primary-hover, #004ecc);
}

.hdr-search-pill button[type="submit"] i,
.hdr-search-pill button[type="submit"] svg {
    font-size: 14px;
    color: #ffffff;
}

@media(max-width: 1199px) and (min-width: 768px) {
    .hdr-search-pill {
        max-width: 280px;
    }
}

@media(max-width: 767px) {
    .hdr-main-inner {
        height: 56px;
        gap: 8px;
        width: calc(100% - 20px);
    }
    .hdr-brand-logo-img {
        height: 30px;
        max-width: 105px;
    }
    .hdr-search-pill {
        display: flex;
        flex: 1;
        max-width: none;
        height: 36px;
        padding: 2px 4px 2px 10px;
        background: #f1f5f9;
        border-radius: 8px;
    }
    .hdr-search-pill input {
        font-size: 12px;
        padding: 4px 0;
    }
    .hdr-search-pill input::placeholder {
        font-size: 11.5px;
    }
    .hdr-search-pill button[type="submit"] {
        width: 28px;
        height: 28px;
    }
    .hdr-search-pill button[type="submit"] svg {
        width: 13px;
        height: 13px;
    }
    .hdr-actions {
        gap: 6px;
    }
    .hdr-cart-btn {
        padding: 0 !important;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .hdr-cart-btn small {
        display: none !important;
    }
    .hdr-mobile-btn {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        font-size: 16px;
    }
}

/* Header Action Buttons Cluster */
.hdr-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Hotline Pill */
.hdr-hotline-item {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: #1e293b;
    padding: 2px 6px;
    transition: opacity 0.15s ease;
}

.hdr-hotline-item:hover {
    opacity: 0.85;
}

.hdr-hotline-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eff6ff;
    color: #0062ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.hdr-hotline-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.hotline-title {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.hotline-phone {
    font-size: 14px;
    font-weight: 800;
    color: #0062ff;
    letter-spacing: -0.2px;
}

.hotline-hours {
    font-size: 10px;
    color: #94a3b8;
}

/* Action Cards: Tra cứu đơn hàng & Giỏ hàng */
.hdr-action-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.hdr-action-card:hover {
    border-color: #0062ff;
    color: #0062ff;
}

.hdr-action-card i {
    font-size: 15px;
    color: #475569;
    transition: color 0.15s ease;
}

.hdr-action-card:hover i {
    color: #0062ff;
}

.hdr-cart-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.hdr-cart-card .hdr-cart-badge {
    position: absolute;
    top: -7px;
    right: -9px;
    background: #0062ff;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1.5px solid #ffffff;
}

/* Mobile Menu Toggle Button */
.hdr-mobile-btn {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: var(--hdr-text, #1a2332);
    font-size: 20px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.hdr-mobile-btn:hover {
    background: var(--hdr-primary-light, #edf5ff);
    color: var(--hdr-primary, #0062ff);
}

@media(max-width:1199px) {
    .hdr-mobile-btn {
        display: flex;
    }
    .hdr-hotline-item,
    .hdr-action-card:not(.hdr-cart-card) {
        display: none;
    }
}

/* ===================================================
   NAVIGATION BAR & CATEGORY DROPDOWN
   =================================================== */
.hdr-nav-bar {
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.hdr-nav-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    position: relative;
}

/* Category Dropdown (3-bar button) */
.hdr-cat-dropdown {
    position: relative;
}

.hdr-cat-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 16px 0 0;
    background: transparent;
    border: none;
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s ease;
}

.hdr-cat-toggle-btn:hover,
.hdr-cat-dropdown.active .hdr-cat-toggle-btn {
    color: #0062ff;
}

.hdr-cat-icon {
    font-size: 15px;
    color: #1e293b;
}

.hdr-cat-toggle-btn:hover .hdr-cat-icon,
.hdr-cat-dropdown.active .hdr-cat-icon {
    color: #0062ff;
}

.hdr-cat-text {
    font-weight: 700;
}

.hdr-cat-caret {
    font-size: 10px;
    color: #64748b;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.hdr-cat-dropdown:hover .hdr-cat-caret,
.hdr-cat-dropdown.active .hdr-cat-caret {
    transform: rotate(180deg);
}

/* Category Dropdown Menu */
.hdr-cat-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 240px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    padding: 6px 0;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.hdr-cat-dropdown:hover .hdr-cat-dropdown-menu,
.hdr-cat-dropdown.active .hdr-cat-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.hdr-cat-menu-row {
    position: relative;
}

.hdr-cat-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.hdr-cat-menu-link:hover {
    background: #f8fafc;
    color: #0062ff;
}

.cat-link-icon {
    width: 18px;
    color: #0062ff;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-link-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-link-arrow {
    font-size: 9px;
    color: #94a3b8;
}

/* Subcategory Flyout Panel */
.hdr-cat-flyout-panel {
    position: absolute;
    top: 0;
    left: 100%;
    width: 250px;
    min-height: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    padding: 12px 16px;
    display: none;
    z-index: 1201;
}

.hdr-cat-menu-row:hover .hdr-cat-flyout-panel {
    display: block;
}

.flyout-header {
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.flyout-heading-link {
    font-size: 13px;
    font-weight: 700;
    color: #0062ff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.flyout-links-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.flyout-item-link {
    font-size: 12.5px;
    color: #475569;
    text-decoration: none;
    padding: 3px 0;
    transition: color 0.15s ease;
}

.flyout-item-link:hover {
    color: #0062ff;
}

/* Vertical Separator */
.hdr-nav-v-sep {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    margin: 0 16px;
    flex-shrink: 0;
}

/* Horizontal Nav Links */
.hdr-nav-list {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hdr-nav-item {
    position: relative;
}

.hdr-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    position: relative;
    transition: color 0.15s ease;
}

.hdr-nav-link i {
    font-size: 13px;
    color: #64748b;
    transition: color 0.15s ease;
}

.hdr-nav-item:hover .hdr-nav-link,
.hdr-nav-item.active .hdr-nav-link {
    color: #0062ff;
}

.hdr-nav-item:hover .hdr-nav-link i,
.hdr-nav-item.active .hdr-nav-link i {
    color: #0062ff;
}

.hdr-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 14px;
    right: 14px;
    height: 2.5px;
    background: #0062ff;
    border-radius: 2px 2px 0 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hdr-nav-item.active .hdr-nav-link::after {
    opacity: 1;
}

@media(max-width:1199px) {
    .hdr-nav-bar {
        display: none;
    }
}

/* ==========================================================================
   MOBILE OFFCANVAS DRAWER MENU
   ========================================================================== */
.hdr-mobile-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(340px, 86vw);
    height: 100vh;
    background: #ffffff;
    z-index: 2000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.hdr-drawer-open .hdr-mobile-drawer {
    right: 0;
}

.hdr-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 17, 24, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1990;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.hdr-drawer-open .hdr-drawer-backdrop {
    opacity: 1;
    visibility: visible;
}

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

.hdr-drawer-close {
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
}

.hdr-drawer-search {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.hdr-drawer-search .hdr-search-pill {
    display: flex !important;
    max-width: 100%;
}

.hdr-drawer-body {
    padding: 16px 20px;
    flex: 1;
}

.hdr-drawer-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hdr-drawer-nav li {
    border-bottom: 1px solid #f1f5f9;
}

.hdr-drawer-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 0;
    color: var(--hdr-text, #1a2332);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.hdr-drawer-nav a:hover {
    color: var(--hdr-primary, #0062ff);
}

.hdr-drawer-footer {
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Header Animations */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.6); }
    50% { box-shadow: 0 0 0 6px rgba(255, 71, 87, 0); }
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR (App-like Retail Experience)
   ========================================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
    padding-bottom: var(--sab, 0px);
}

@media (max-width: 767px) {
    .mobile-bottom-nav {
        display: block;
    }
}

.bottom-nav-inner {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: var(--mobile-bottom-nav-h, 56px);
    align-items: center;
    max-width: 540px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: none;
    border: none;
    padding: 6px 2px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.nav-icon-box {
    position: relative;
    font-size: 17px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    transition: color 0.15s ease;
    letter-spacing: -0.2px;
}

.bottom-nav-item:active .nav-icon-box {
    transform: scale(0.9);
}

.bottom-nav-item.active {
    color: #0062ff;
}

.bottom-nav-item.active .nav-icon-box {
    color: #0062ff;
    transform: translateY(-1px);
}

.bottom-nav-item.active .nav-label {
    color: #0062ff;
    font-weight: 800;
}

.bottom-nav-badge {
    position: absolute;
    top: -4px;
    right: -9px;
    background: #d70018;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #ffffff;
    box-shadow: 0 1px 4px rgba(215, 0, 24, 0.4);
}
