/* CATALOG MEGA-MENU STYLES */
:root {
  --bg: #121212;
  --bg2: #1E1E1E;
  --bg3: #2A2A2A;
  --bg4: #333333;
  --surface: #1A1A1A;
  --border: #333333;
  --border2: #444444;
  --text: #F0F0F0;
  --text2: #BBBBBB;
  --text3: #888888;
  --accent: #FF6600;
  --accent2: #E65C00;
  --accent3: #CC5200;
  --dark: #0A0A0A;
  --sidebar-w: 230px;
  --header-h: 60px;
  --radius: 10px;
  --radius-lg: 14px;
  --font: 'Inter', sans-serif;
  --sb-dark: #0F0F0F;
  --sb-accent: #FF6600;
}

.catalog-wrapper {
  position: relative;
  display: flex;
  height: 100%;
}

.catalog-sidebar {
  width: var(--sidebar-w, 260px);
  background: var(--sb-dark);
  /* White background as requested */
  display: flex;
  flex-direction: column;
  border-right: 1px solid #eaeaea;
  position: relative;
  z-index: 2;
}

/**/
.catalog-sidebar::-webkit-scrollbar {
  width: 4px;
}

.catalog-sidebar::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.catalog-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 20px;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  color: var(--text);
  font-family: var(--font);
  text-align: left;
  font-size: 14.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  z-index: 5;
}

.catalog-item:hover,
.catalog-item.active {
  background-color: var(--bg3);
  color: var(--text);
}

.catalog-item.active {
  border-left-color: var(--accent);
  font-weight: 600;
}

.catalog-item-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text3);
  transition: color 0.2s ease;
}

.catalog-item:hover .catalog-item-icon,
.catalog-item.active .catalog-item-icon {
  color: var(--accent);
}

.catalog-item-arrow {
  margin-left: auto;
  font-size: 14px;
  color: #9ca3af;
  transition: transform .22s ease, color .18s ease;
}

.catalog-item.active .catalog-item-arrow {
  color: var(--accent);
}

/* Mega Menu Panel */
.mega-menu-panel {
  position: fixed;
  top: var(--header-h, 60px);
  left: var(--sidebar-w, 260px);
  margin-left: -5px;
  width: 750px;
  height: calc(100vh - var(--header-h, 60px));
  background: var(--bg3);
  /* Very light gray / white */
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
  border-left: 1px solid var(--accent2);
  z-index: 9999 !important;
  display: none;
  overflow-y: auto;
  padding: 24px 32px;
}

.catalog-wrapper:hover .mega-menu-panel.active,
.mega-menu-panel.active {
  display: block;
  animation: fadeInMegaMenu 0.2s ease-out;
  z-index: 99 !important;
}

@keyframes fadeInMegaMenu {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mega-menu-panel::-webkit-scrollbar {
  width: 6px;
}

.mega-menu-panel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.mega-menu-content {
  column-count: 3;
  column-gap: 32px;
  z-index: 10;
}

.mega-menu-group {
  break-inside: avoid;
  margin-bottom: 24px;
  z-index: 10;
}

.mega-menu-group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
  line-height: 1.3;
}

.mega-menu-group-title a {
  color: inherit;
  text-decoration: none;
}

.mega-menu-group-title a:hover {
  color: var(--sb-accent);
}

.mega-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mega-menu-list li a {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  transition: color 0.15s;
  display: block;
}

.mega-menu-list li a:hover {
  color: var(--accent2);
  text-decoration: underline;
}

.mega-menu-more {
  display: inline-block;
  margin-top: 8px;
  color: #0ea5e9;
  /* Blue more links */
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
}

.mega-menu-more:hover {
  text-decoration: underline;
}

/* Shared fast search dropdown */
.search-bar {
  position: relative;
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: none;
  height: min(640px, calc(100vh - 130px));
  max-height: min(560px, calc(100vh - 130px));
  overflow: hidden;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .48);
  z-index: 1200;
}

.search-results.open {
  display: block;
}

.search-results-layout {
  display: grid;
  grid-template-columns: minmax(170px, .42fr) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.search-category-list {
  overflow-y: auto;
  min-height: 0;
  border-right: 1px solid var(--border2);
  background: rgba(0, 0, 0, .12);
}

.search-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid var(--border2);
  transition: background .16s ease, color .16s ease;
}

.search-category-row:hover,
.search-category-row:focus-visible {
  background: rgba(255, 102, 0, .12);
  color: #fff;
  outline: none;
}

.search-category-row strong {
  color: var(--accent);
}

.search-product-list {
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.search-category-list::-webkit-scrollbar,
.search-product-list::-webkit-scrollbar {
  width: 8px;
}

.search-category-list::-webkit-scrollbar-track,
.search-product-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .04);
}

.search-category-list::-webkit-scrollbar-thumb,
.search-product-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
}

.search-result-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border2);
  transition: background .16s ease;
}

.search-result-item:hover {
  background: rgba(255, 102, 0, .1);
}

.search-result-thumb {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
}

.search-result-info {
  min-width: 0;
}

.search-result-name {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 850;
  line-height: 1.28;
}

.search-result-meta {
  margin-top: 5px;
  color: var(--text3);
  font-size: 12px;
  line-height: 1.35;
}

.search-empty {
  padding: 16px;
  color: var(--text2);
  font-size: 13px;
}

/* Mobile Accordion Styles */
.mobile-accordion-content {
  max-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, .035);
  transition: max-height .28s ease;
}

.mobile-accordion-content.open {
  border-left: 3px solid var(--accent);
}

.mobile-node-all,
.mobile-node-link,
.mobile-node-toggle {
  display: block;
  width: 100%;
  color: var(--text2);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
  border: 0;
  background: transparent;
  text-align: left;
}

.mobile-node-all {
  padding: 12px 18px 10px 52px;
  color: var(--accent);
  font-weight: 700;
}

.mobile-node-link {
  padding: 10px 16px 10px 52px;
}

.mobile-node-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px 11px 52px;
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
}

.mobile-node-link:hover,
.mobile-node-toggle:hover,
.mobile-node-all:hover {
  background: rgba(255, 102, 0, .08);
  color: #fff;
}

.mobile-node-chevron {
  color: var(--text3);
  font-size: 16px;
  transition: transform .22s ease, color .18s ease;
}

.mobile-node.open > .mobile-node-toggle .mobile-node-chevron {
  transform: rotate(90deg);
  color: var(--accent);
}

.mobile-node-content {
  max-height: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, .16);
  transition: max-height .26s ease;
}

.mobile-node-content.open {
  border-left: 1px solid rgba(255, 102, 0, .26);
}

.mobile-node-list-level-2 .mobile-node-link,
.mobile-node-list-level-2 .mobile-node-toggle,
.mobile-node-content .mobile-node-all {
  padding-left: 66px;
  font-size: 12.5px;
}

.mobile-node-list-level-3 .mobile-node-link,
.mobile-node-list-level-3 .mobile-node-toggle {
  padding-left: 80px;
}

.mobile-node-link-empty {
  padding: 14px 18px 14px 52px;
}

@media (max-width: 900px) {
  .hdr-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .hdr-logo-slot {
    order: 1;
  }

  .hdr-icons {
    order: 2;
    margin-left: auto;
  }

  .search-bar {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    margin-top: 6px;
  }

  .catalog-wrapper {
    flex-direction: column;
  }

  body .sidebar {
    top: var(--mobile-header-offset, 0px) !important;
    height: calc(100vh - var(--mobile-header-offset, 0px)) !important;
    z-index: 220 !important;
  }

  .catalog-sidebar {
    width: 100%;
    border-right: none;
    background: var(--sb-dark);
  }

  .mega-menu-panel {
    display: none !important;
  }

  .search-results {
    position: fixed;
    top: var(--mobile-header-offset, 116px);
    left: 12px;
    right: 12px;
    height: calc(100vh - var(--mobile-header-offset, 116px) - 16px);
    max-height: calc(100vh - var(--mobile-header-offset, 116px) - 16px);
  }

  .search-results-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .search-category-list {
    max-height: 180px;
    border-right: 0;
    border-bottom: 1px solid var(--border2);
  }

  .catalog-item {
    min-height: 52px;
    border-bottom: 1px solid rgba(255, 255, 255, .055);
  }

  .catalog-item[aria-expanded="true"] .catalog-item-arrow {
    transform: rotate(90deg);
  }
}

/* CART STYLES (Shared across all pages) */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 32, 36, .75);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 350px;
  max-width: 100vw;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  z-index: 301;
  padding: 18px;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.cart-hd h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.close-x {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 7px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--text2);
  transition: all .13s;
}

.close-x:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cart-item {
  display: flex;
  gap: 9px;
  background: var(--bg3);
  border-radius: 9px;
  padding: 9px;
  align-items: center;
}

.cart-item-emoji {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.cart-item-price {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--accent);
}

.cart-item-rm {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--text3);
  padding: 3px;
  transition: color .13s;
}

.cart-item-rm:hover {
  color: var(--accent);
}

.cart-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text3);
}

.cart-empty-icon {
  font-size: 44px;
  margin-bottom: 10px;
}

.cart-foot {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 10px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cart-total-label {
  font-weight: 600;
  color: var(--text);
}

.cart-total-price {
  font-size: 20px;
  font-weight: 900;
  color: var(--accent);
}

.checkout-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 13px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s;
}

.checkout-btn:hover {
  background: var(--accent2);
}

/* TOAST STYLES */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 900;
  background: var(--dark);
  border: 1px solid rgba(253, 0, 84, .25);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(43, 32, 36, .4);
  transform: translateY(80px);
  opacity: 0;
  transition: all .28s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* MOBILE APP SHELL */
.mobile-bottom-nav {
  display: none;
}

.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
  z-index: 1500;
}

.sb-overlay.open {
  display: block;
  opacity: 1;
  pointer-events: all;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  height: 44px;
}

.sidebar-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: none;
  border: none;
  height: 100%;
  color: rgba(255, 255, 255, .3);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s;
}

.sidebar-toggle-btn.sb-active {
  color: #fff;
}

.sidebar-toggle-btn.sb-inactive {
  color: rgba(255, 255, 255, .3);
}

.sidebar-toggle-sep {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, .12);
  flex-shrink: 0;
}

.mobile-menu-close {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.sb-panel {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

@media(max-width:820px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1200 !important;
    height: auto !important;
    min-height: auto;
    align-items: stretch;
    background: var(--bg2, #16191D);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08);
  }

  body .hdr-inner {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px 12px !important;
  }

  body .hdr-logo-slot {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    width: auto !important;
    height: auto !important;
    min-width: 0;
    border-right: 0 !important;
    padding: 0 !important;
  }

  body .logo-text {
    display: none;
  }

  body .search-bar {
    grid-column: 2;
    grid-row: 1;
    order: initial !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  body .search-bar input {
    min-height: 46px;
    border-radius: 12px;
    padding-left: 16px;
    font-size: 15px;
  }

  body .hdr-icons,
  body .phone-chip,
  body .topnav {
    display: none !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1300;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
    background: rgba(16, 16, 18, .98);
    border-top: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .38);
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 56px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, .78);
    font-family: var(--font, Inter, sans-serif);
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
  }

  .mobile-bottom-nav i {
    font-size: 21px;
    line-height: 1;
  }

  .mobile-bottom-nav a.mobile-nav-active,
  .mobile-bottom-nav button.mobile-nav-active {
    color: #fff;
    background: rgba(255, 102, 0, .14);
  }

  .mobile-nav-badge {
    position: absolute;
    top: 5px;
    right: 22%;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent, #FF6600);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 900;
    border: 2px solid rgba(16, 16, 18, .98);
  }

  .cart-overlay.open {
    z-index: 1400;
  }

  .cart-drawer {
    z-index: 1401;
  }

  .toast {
    bottom: calc(86px + env(safe-area-inset-bottom));
  }

  body .coming-soon-sidebar,
  .coming-soon-sidebar,
  .mobile-catalog-sidebar {
    position: fixed !important;
    inset: 0 auto auto 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    display: flex;
    flex-direction: column;
    background: var(--sb-dark, #0F0F0F);
    border-right: 0;
    transform: translateX(-100%);
    transition: transform .28s ease;
    z-index: 5000 !important;
    box-shadow: none;
  }

  body .coming-soon-sidebar.open,
  .coming-soon-sidebar.open,
  .mobile-catalog-sidebar.open {
    transform: translateX(0);
  }

  .coming-soon-sidebar .mobile-menu-close {
    display: flex;
  }

  .mobile-catalog-top {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: var(--text, #fff);
    font-size: 14px;
    font-weight: 800;
  }

  .mobile-catalog-close {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, .75);
    font-size: 18px;
    cursor: pointer;
  }

  .mobile-catalog-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }
}

@media (hover: none), (pointer: coarse), (max-width: 820px) {
  .pcard,
  .pcard-img img,
  .pcard-price,
  .pcard-btn {
    transition-duration: .14s !important;
  }

  .pcard:hover {
    border-color: var(--border) !important;
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18) !important;
  }

  .pcard:hover .pcard-img img {
    transform: none !important;
  }

  .pcard:hover .pcard-price {
    color: var(--text) !important;
  }

  .pcard:active {
    border-color: rgba(255, 102, 0, .42) !important;
    transform: scale(.985) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .28) !important;
  }

  .pcard:active .pcard-price {
    color: var(--accent) !important;
  }

  .pcard-btn:hover {
    background: var(--bg4) !important;
    color: var(--text) !important;
    border-color: var(--border2) !important;
  }

  .pcard-btn:active {
    background: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
    transform: scale(.98);
  }

  .pcard.out-of-stock:active {
    border-color: var(--border) !important;
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15) !important;
  }
}
