/* ==========================================================
   STORLY-STYLE HEADER
   ========================================================== */

/* Top info strip */
.top-info-strip {
    background: #0f172a;
    color: rgba(255,255,255,0.85);
    font-size: 0.8rem;
}
.top-info-strip .top-strip-link {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: color 0.2s;
}
.top-info-strip .top-strip-link:hover { color: #fff; }
.top-info-strip .top-strip-highlight {
    color: #fbbf24;
    font-weight: 600;
}
.top-info-strip .top-strip-highlight i { margin-right: 4px; }

/* Main header */
.site-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.3s ease;
    z-index: 1030;
}
.site-header.is-scrolled { box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08); }

.header-main-row { min-height: 70px; }

/* Brand */
.site-brand { text-decoration: none; }
.brand-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.brand-icon-sm { width: 36px; height: 36px; font-size: 1.1rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.35rem; color: #0f172a; }
.brand-name span { color: #2563eb; }
.brand-tagline { font-size: 0.7rem; color: #64748b; letter-spacing: 0.05em; font-weight: 500; }

/* Search */
.search-wrap {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    transition: all 0.2s;
    width: 100%;
}
.search-wrap:focus-within { border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.search-category-select {
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    border-right: 1px solid #e2e8f0;
    cursor: pointer;
    outline: none;
    max-width: 160px;
}
.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    outline: none;
    min-width: 0;
}
.search-submit {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 0.7rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.search-submit:hover { background: #1d4ed8; }

/* Header actions */
.header-icon-btn {
    width: 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #0f172a;
    text-decoration: none;
    position: relative;
    transition: all 0.2s;
    cursor: pointer;
}
.header-icon-btn:hover { background: #f1f5f9; color: #2563eb; }
.icon-badge {
    position: absolute; top: 2px; right: 2px;
    background: #ef4444; color: #fff;
    font-size: 0.65rem; font-weight: 700;
    min-width: 18px; height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
}

.header-cart-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: #2563eb; color: #fff;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}
.header-cart-btn:hover { background: #1d4ed8; transform: translateY(-1px); color: #fff; }
.cart-badge {
    background: #fff;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 22px;
    text-align: center;
}

/* Desktop nav row */
.header-nav { padding: 0; }
.header-nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    position: relative;
}
.nav-link-item {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.7rem 1rem;
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-link-item:hover, .nav-link-item.active { color: #2563eb; background: #eff6ff; }
.nav-link-item i { font-size: 0.95rem; }

.nav-promo-pill {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: #fef3c7; color: #92400e;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.nav-promo-pill i { color: #f59e0b; }

/* ===== Mega Menu ===== */
.header-nav-list > li { position: relative; }

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15);
    padding: 1.5rem;
    min-width: 700px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    border: 1px solid #f1f5f9;
}
.mega-menu-small { min-width: 280px; }
.header-nav-list > li:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.mega-menu-inner { display: flex; gap: 1.5rem; }
.mega-col { flex: 1; min-width: 0; }
.mega-col-categories { flex: 2; }
.mega-col-promo { flex: 1; }
.mega-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2563eb;
    font-weight: 700;
    margin-bottom: 1rem;
}
.mega-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.mega-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem;
    border-radius: 10px;
    text-decoration: none;
    color: #0f172a;
    transition: background 0.2s;
}
.mega-link:hover { background: #f8fafc; }
.mega-icon {
    width: 40px; height: 40px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.mega-link-text { display: flex; flex-direction: column; line-height: 1.2; }
.mega-link-text strong { font-size: 0.9rem; font-weight: 600; }
.mega-link-text small { font-size: 0.75rem; color: #64748b; margin-top: 2px; }

.mega-list-simple { list-style: none; padding: 0; margin: 0; }
.mega-list-simple li a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #334155;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.mega-list-simple li a:hover { background: #eff6ff; color: #2563eb; padding-left: 1rem; }

.mega-promo-card {
    padding: 1.25rem;
    border-radius: 12px;
    color: #fff;
    height: 100%;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.mega-promo-blue { background: linear-gradient(135deg, #2563eb, #1e40af); }
.mega-promo-amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.promo-tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.mega-promo-card h5 { font-size: 1.1rem; margin: 0.25rem 0; font-weight: 700; }
.mega-promo-card p { font-size: 0.8rem; margin: 0.25rem 0 0.75rem; opacity: 0.9; }
.promo-btn {
    display: inline-block;
    background: #fff;
    color: #0f172a;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
    transition: transform 0.2s;
}
.promo-btn:hover { transform: translateX(3px); color: #2563eb; }

/* ===== MOBILE APP-STYLE ===== */
@media (max-width: 991.98px) {
    .site-header { box-shadow: 0 2px 12px rgba(15,23,42,0.06); }
    .header-main-row { min-height: 60px; padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
}

/* ===== Mobile bottom nav ===== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    z-index: 1040;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    position: relative;
    transition: color 0.2s;
    min-width: 60px;
    flex: 1;
}
.mobile-nav-item i { font-size: 1.35rem; transition: transform 0.2s; }
.mobile-nav-item.active { color: #2563eb; }
.mobile-nav-item.active i { transform: translateY(-2px); }
.mobile-nav-item:active i { transform: scale(0.9); }
.mobile-nav-item span { font-weight: 600; }

.mobile-nav-center {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff !important;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    min-width: 52px;
    padding: 0;
    margin-top: -20px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    justify-content: center;
}
.mobile-nav-center span { display: none; }
.mobile-nav-center i { font-size: 1.4rem; }

.mobile-cart-badge {
    position: absolute;
    top: 0;
    right: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ===== Mobile menu drawer ===== */
.mobile-menu-drawer {
    width: 320px;
    max-width: 85vw;
    border: none;
}
.mobile-menu-header {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    padding: 1.25rem 1rem;
}
.mobile-menu-search { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.mobile-menu-section { padding: 1rem; border-bottom: 1px solid #f1f5f9; }
.mobile-menu-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2563eb;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}
.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 10px;
    transition: all 0.2s;
}
.mobile-menu-link:hover, .mobile-menu-link:active { background: #eff6ff; color: #2563eb; padding-left: 0.75rem; }
.mobile-menu-link i { font-size: 1.1rem; width: 22px; text-align: center; }
.mobile-menu-footer { background: #f8fafc; }