/* ══════════════════ HEADER + NAV + MOBILE DRAWER ══════════════════ */

/* ── Top Bar ── */
.top-bar { background: #f2f4f4; color: #444; font-size: 12px; font-weight: 600; padding: 6px 0; border-bottom: 1px solid #e0e0e0; }

/* ── Main Header ── */
#mainHeader { background: #fff; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 600; }
.main-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 20px; }
.logo img { max-height: 45px; }

/* ── Search ── */
.search-wrapper { flex: 1; max-width: 580px; position: relative; }
.search-container { display: flex; border: 2px solid var(--primary); border-radius: 4px; overflow: hidden; }
.search-container input { flex: 1; border: none; outline: none; padding: 9px 16px; font-size: 14px; font-family: inherit; color: var(--dark); }
.search-container input::placeholder { color: #aaa; }
.search-btn { background: var(--primary); color: #fff; border: none; padding: 9px 22px; font-size: 15px; cursor: pointer; transition: var(--transition); }
.search-btn:hover { background: var(--primary-dark); }

/* ── Header Actions ── */
.header-actions { display: flex; align-items: center; gap: 25px; flex-shrink: 0; }
.trigger-callback { display: flex; align-items: center; gap: 8px; background: #f0f7f0; color: var(--primary); padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 700; transition: var(--transition); white-space: nowrap; }
.trigger-callback:hover { background: #dff0df; color: var(--primary); }
.trigger-callback i { font-size: 16px; }

.action-item { position: relative; cursor: pointer; padding: 5px; }
.action-link { display: flex; align-items: center; gap: 5px; color: var(--dark); font-size: 20px; transition: var(--transition); }
.action-link:hover { color: var(--primary); }
.action-link i { font-size: 24px; }

.cart-count { position: absolute; top: -5px; right: -8px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 800; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }

/* ── Dropdowns ── */
.action-dropdown { position: absolute; top: calc(100% + 15px); right: -10px; width: 280px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.15); border-radius: 8px; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.25s ease; z-index: 1000; border: 1px solid #eee; overflow: hidden; }
.action-item:hover .action-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

/* User Dropdown */
.user-dropdown-header { background: var(--primary); padding: 20px; color: #fff; display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 40px; height: 40px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; border: 2px solid #fff; }
.user-info-text { flex: 1; }
.user-info-text .hi { font-size: 14px; opacity: 0.9; }
.user-info-text .name { font-size: 16px; font-weight: 700; display: block; }
.dropdown-list { padding: 10px 0; }
.dropdown-link { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: #444; font-size: 14px; font-weight: 600; transition: var(--transition); }
.dropdown-link:hover { background: #f8f8f8; color: var(--primary); }
.dropdown-link i { font-size: 16px; width: 20px; text-align: center; color: #888; }
.dropdown-link:hover i { color: var(--primary); }
.dropdown-divider { height: 1px; background: #eee; margin: 5px 0; }
.hk-cash { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.cash-value { color: var(--primary); font-weight: 800; }

/* Cart Dropdown */
.cart-dropdown { width: 320px; }
.cart-items-preview { max-height: 300px; overflow-y: auto; padding: 10px; }
.cart-preview-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f5f5f5; }
.cart-preview-item:last-child { border-bottom: none; }
.cart-item-img { width: 60px; height: 60px; flex-shrink: 0; border: 1px solid #eee; border-radius: 4px; padding: 5px; }
.cart-item-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-item-info { flex: 1; }
.cart-item-title { font-size: 13px; font-weight: 700; color: #333; line-height: 1.3; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-item-meta { font-size: 12px; color: #777; display: flex; justify-content: space-between; }
.cart-item-price { font-weight: 700; color: var(--dark); }
.cart-dropdown-footer { padding: 15px; background: #fafafa; border-top: 1px solid #eee; }
.btn-view-cart { display: block; width: 100%; background: var(--primary); color: #fff; text-align: center; padding: 12px; border-radius: 6px; font-weight: 700; font-size: 14px; transition: var(--transition); }
.btn-view-cart:hover { background: var(--primary-dark); color: #fff; }

/* ── Nav Bar ── */
.nav-bar { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: var(--main-header-h, 80px); z-index: 500; transition: box-shadow 0.2s ease; }
.nav-bar.is-stuck { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.nav-list { display: flex; align-items: center; padding: 0; gap: 0; }
.nav-item { position: static; }
.nav-link-item { display: block; padding: 12px 18px; font-size: 14px; font-weight: 600; color: var(--dark); transition: color 0.2s; white-space: nowrap; }
.nav-link-item:hover, .nav-link-item.active { color: var(--primary); }

/* ── Shop By Category Button ── */
.mega-menu-trigger { position: relative; }
.shop-category-btn { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #fff; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--primary); transition: all 0.25s; margin: 8px 10px 8px 0; white-space: nowrap; }
.shop-category-btn i { font-size: 15px; }
.mega-menu-trigger:hover .shop-category-btn { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Mega Menu ── */
.mega-menu { position: absolute; top: calc(100% + 0px); left: 0; width: 1000px; background: #fff; box-shadow: 0 15px 35px rgba(0,0,0,0.12); display: flex; opacity: 0; visibility: hidden; transform: translateY(8px); transition: all 0.25s ease; z-index: 2000; border: 1px solid #eee; border-top: 2px solid var(--primary); border-radius: 0 0 8px 8px; min-height: 460px; }
.mega-menu-trigger:hover .mega-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.mega-menu-sidebar { width: 240px; min-width: 240px; background: #f7f9f9; padding: 12px 0; border-right: 1px solid #eee; flex-shrink: 0; overflow-y: auto; max-height: 480px; }
.mega-menu-sidebar::-webkit-scrollbar { width: 3px; }
.mega-menu-sidebar::-webkit-scrollbar-thumb { background: #ddd; }

.mega-sidebar-item { display: flex; align-items: center; justify-content: space-between; padding: 11px 20px; font-size: 13.5px; font-weight: 600; color: #444; cursor: pointer; transition: all 0.18s; }
.mega-sidebar-item i { font-size: 10px; color: #ccc; }
.mega-sidebar-item:hover { background: #fff; color: var(--primary); }
.mega-sidebar-item:hover i { color: var(--primary); }
.mega-sidebar-item.active { background: #fff; color: var(--primary); border-left: 3px solid var(--primary); }
.mega-sidebar-item.active i { color: var(--primary); }

.mega-menu-content { flex: 1; padding: 24px 28px; overflow-y: auto; max-height: 480px; }
.mega-content-pane { display: none; }
.mega-content-pane.active { display: block; animation: mmFadeIn 0.22s ease; }
@keyframes mmFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.mega-pane-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.mega-pane-header .mega-pane-heading { margin: 0; font-weight: 700; font-size: 14px; color: var(--primary); }
.mega-pane-header a { font-size: 12px; font-weight: 600; color: #888; }
.mega-pane-header a:hover { color: var(--primary); }

.mega-products-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mega-product-item { text-align: center; cursor: pointer; transition: transform 0.2s; }
.mega-product-item:hover { transform: translateY(-2px); }
.mega-product-item .img-box { width: 100%; aspect-ratio: 1; border-radius: 8px; background: #fdfdfd; border: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: center; padding: 8px; margin-bottom: 8px; overflow: hidden; }
.mega-product-item .img-box img { width: 100%; height: 100%; object-fit: contain; }
.mega-product-item .pname { font-size: 11.5px; font-weight: 600; color: #333; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mega-product-item:hover .pname { color: var(--primary); }

/* ══════════════════ MOBILE TOP BAR + DRAWER ══════════════════ */

.mob-topbar { display: none; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid #eee; padding: 10px 14px; position: sticky; top: 0; z-index: 600; box-shadow: 0 1px 6px rgba(0,0,0,0.07); }
.mob-ham { background: none; border: none; font-size: 22px; color: var(--dark); cursor: pointer; padding: 4px 8px 4px 0; line-height: 1; flex-shrink: 0; }
.mob-brand img { max-height: 34px; display: block; }
.mob-icons { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.mob-ic { background: none; border: none; font-size: 19px; color: var(--dark); cursor: pointer; padding: 6px 8px; line-height: 1; position: relative; text-decoration: none; display: flex; align-items: center; }
.mob-ic:hover { color: var(--primary); }
.mob-cart-dot { position: absolute; top: 0; right: 2px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 800; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 3px; display: flex; align-items: center; justify-content: center; }
.mob-cart-ic { color: var(--primary); }
.mob-cart-ic:hover { color: var(--primary-dark, var(--primary)); }

/* ── Mobile Search Slide ── */
.mob-search-slide { display: none; background: #fff; padding: 10px 14px; border-bottom: 1px solid #eee; position: sticky; top: 55px; z-index: 599; }
.mob-search-slide.show { display: block; }
.mob-search-f { display: flex; border: 2px solid var(--primary); border-radius: 4px; overflow: hidden; }
.mob-search-f input { flex: 1; border: none; outline: none; padding: 9px 12px; font-size: 14px; font-family: inherit; color: var(--dark); }
.mob-search-f input::placeholder { color: #aaa; }
.mob-search-close { background: #f5f5f5; border: none; padding: 9px 14px; font-size: 15px; cursor: pointer; color: #666; transition: color 0.2s; }
.mob-search-close:hover { color: var(--primary); }

/* ── Overlay ── */
.mob-ov { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 3000; }
.mob-ov.show { display: block; }
body.mob-no-scroll { overflow: hidden; }

/* ── Main Drawer ── */
.mob-drw { position: fixed; top: 0; left: 0; width: 290px; max-width: 87vw; height: 100%; background: #fff; z-index: 3001; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; overflow: hidden; box-shadow: 4px 0 20px rgba(0,0,0,0.15); }
.mob-drw.open { transform: translateX(0); }
.mob-drw-head { background: var(--primary); padding: 18px 16px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.mob-drw-cls { background: none; border: none; color: rgba(255,255,255,0.85); font-size: 18px; cursor: pointer; padding: 2px 10px 2px 0; line-height: 1; flex-shrink: 0; transition: color 0.2s; }
.mob-drw-cls:hover { color: #fff; }
.mob-drw-user { display: flex; align-items: center; gap: 10px; flex: 1; }
.mob-drw-av { width: 40px; height: 40px; background: rgba(255,255,255,0.22); border: 2px solid rgba(255,255,255,0.65); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; color: #fff; flex-shrink: 0; }
.mob-drw-user > span { color: #fff; font-size: 16px; font-weight: 700; }
.mob-un-chip { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.18); border-radius: 20px; padding: 5px 10px 5px 6px; flex-shrink: 0; }
.mob-un-logo { background: var(--accent); color: #fff; font-size: 9px; font-weight: 900; padding: 2px 6px; border-radius: 10px; letter-spacing: 0.5px; }
.mob-un-num { color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
.mob-drw-body { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.mob-drw-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: none; border-bottom: 1px solid #f2f2f2; background: none; color: #333; font-size: 14px; font-weight: 600; font-family: inherit; text-decoration: none; width: 100%; cursor: pointer; text-align: left; transition: background 0.15s; }
.mob-drw-item:hover, .mob-drw-item:focus, .mob-drw-item.active { background: #f5faf3; color: var(--primary); outline: none; }
.mob-drw-item:hover .mob-drw-ic, .mob-drw-item:focus .mob-drw-ic, .mob-drw-item.active .mob-drw-ic { color: var(--primary); }
.mob-drw-ic { width: 26px; text-align: center; font-size: 15px; color: #777; flex-shrink: 0; transition: color 0.15s; }
.mob-drw-txt { flex: 1; }
.mob-drw-arr { font-size: 10px; color: #ccc; flex-shrink: 0; }
.mob-drw-sep { height: 8px; background: #f5f5f5; border-top: 1px solid #eaeaea; border-bottom: 1px solid #eaeaea; }
.mob-drw-logout .mob-drw-ic { color: #d44; }
.mob-drw-logout:hover { color: #d44; background: #fff5f5; }

/* ── Categories Slide Panel ── */
.mob-cat { position: fixed; top: 0; left: 0; width: 290px; max-width: 87vw; height: 100%; background: #fff; z-index: 3002; transform: translateX(110vw); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; overflow: hidden; box-shadow: 4px 0 20px rgba(0,0,0,0.15); }
.mob-cat.open { transform: translateX(0); }
.mob-cat-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid #eee; background: #fff; flex-shrink: 0; }
.mob-cat-back { background: none; border: none; font-size: 16px; color: var(--dark); cursor: pointer; padding: 4px 8px 4px 0; line-height: 1; flex-shrink: 0; transition: color 0.2s; }
.mob-cat-back:hover { color: var(--primary); }
.mob-cat-head > span { font-size: 16px; font-weight: 700; color: var(--dark); }
.mob-cat-wrap { display: flex; flex: 1; overflow: hidden; }
.mob-cat-side { width: 108px; min-width: 108px; background: #f5f5f5; overflow-y: auto; border-right: 1px solid #e8e8e8; -webkit-overflow-scrolling: touch; }
.mob-cat-si { padding: 13px 10px; font-size: 11.5px; font-weight: 600; color: #555; cursor: pointer; border-bottom: 1px solid #eee; line-height: 1.35; transition: all 0.15s; border-left: 3px solid transparent; }
.mob-cat-si:hover { background: #ebebeb; color: var(--primary); }
.mob-cat-si.active { background: #fff; color: var(--primary); border-left-color: var(--primary); padding-left: 7px; }
.mob-cat-main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 12px; }
.mob-cat-pane { display: none; }
.mob-cat-pane.active { display: block; animation: mcpFade 0.2s ease; }
@keyframes mcpFade { from { opacity: 0; } to { opacity: 1; } }
.mob-cat-phead { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #eee; line-height: 1.4; }
.mob-subg { margin-bottom: 10px; }
.mob-subg-toggle { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px; font-size: 12.5px; font-weight: 700; color: #333; cursor: pointer; border-bottom: 1px solid #f0f0f0; user-select: none; }
.mob-subg-toggle i { font-size: 10px; color: #888; }
.mob-subg-links { padding: 4px 0; }
.mob-subg-links.hidden { display: none; }
.mob-subg-links a { display: block; padding: 7px 4px; font-size: 12.5px; color: #555; text-decoration: none; border-bottom: 1px solid #f8f8f8; transition: color 0.15s, padding-left 0.15s; }
.mob-subg-links a:hover { color: var(--primary); padding-left: 8px; }
.mob-subg-links a:last-child { border-bottom: none; }
.mob-view-all { color: var(--primary) !important; font-weight: 700 !important; font-size: 12px !important; margin-top: 2px; }

/* ── Mobile Cart Bottom Sheet ── */
.mob-cart-sheet { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; z-index: 3003; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 30px rgba(0,0,0,0.18); transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; max-height: 85vh; }
.mob-cart-sheet.open { transform: translateY(0); }
.mob-cart-handle { width: 40px; height: 4px; background: #ddd; border-radius: 2px; margin: 10px auto 0; flex-shrink: 0; }
.mob-cart-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 12px; border-bottom: 1px solid #eee; flex-shrink: 0; }
.mob-cart-sheet-head span { font-size: 16px; font-weight: 700; color: var(--dark); }
.mob-cart-sheet-count { font-size: 13px; font-weight: 600; color: #888; }
.mob-cart-sheet-cls { background: none; border: none; font-size: 17px; color: #888; cursor: pointer; padding: 4px; line-height: 1; transition: color 0.2s; }
.mob-cart-sheet-cls:hover { color: var(--dark); }
.mob-cart-sheet-items { overflow-y: auto; flex: 1; padding: 10px 16px; -webkit-overflow-scrolling: touch; }
.mob-cart-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f5f5f5; }
.mob-cart-row:last-child { border-bottom: none; }
.mob-cart-row-img { width: 64px; height: 64px; flex-shrink: 0; border: 1px solid #eee; border-radius: 6px; padding: 5px; background: #fafafa; }
.mob-cart-row-img img { width: 100%; height: 100%; object-fit: contain; }
.mob-cart-row-info { flex: 1; }
.mob-cart-row-name { font-size: 13px; font-weight: 600; color: #333; line-height: 1.35; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mob-cart-row-meta { display: flex; justify-content: space-between; font-size: 12px; color: #888; }
.mob-cart-row-price { font-weight: 700; color: var(--dark); font-size: 13px; }
.mob-cart-sheet-footer { padding: 14px 18px 20px; border-top: 1px solid #eee; flex-shrink: 0; background: #fafafa; }
.mob-cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: #555; }
.mob-cart-total-val { font-size: 18px; font-weight: 800; color: var(--dark); }
.mob-cart-proceed { display: block; background: var(--primary); color: #fff; text-align: center; padding: 13px; border-radius: 8px; font-size: 15px; font-weight: 700; text-decoration: none; transition: background 0.2s; }
.mob-cart-proceed:hover { background: var(--primary-dark); color: #fff; }

/* ── Responsive ── */
@media (max-width: 1100px) {
    .mega-menu { width: 820px; }
}
@media (max-width: 900px) {
    .mega-products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .mega-menu { width: calc(100vw - 20px); }
    .mega-products-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .main-header { flex-direction: column; gap: 12px; }
    .search-wrapper { max-width: 100%; width: 100%; order: 3; }
    .logo img { max-height: 35px; }
    .nav-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .nav-list { width: max-content; }
}
@media (max-width: 991px) {
    .mob-topbar { display: flex; }
    #mainHeader { display: none; }
    .nav-bar { display: none; }
}
@media (min-width: 992px) {
    .mob-topbar { display: none !important; }
    .mob-search-slide,
    .mob-ov,
    .mob-drw,
    .mob-cat,
    .mob-cart-sheet { display: none !important; }
}
