:root {
  --primary: #D4AF37;
  --primary-dark: #B89026;
  --accent: #D4AF37;

  --text: #1a1a1a;
  --muted: #6b6b6b;

  --bg: #B5B5B5;
  --card-bg: #ffffff;
  --border: #d0d0d0;
}

/* Basic reset useful for header/nav */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  overflow-x: hidden;
}

/* Links & icons */
a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ========= TOP BAR ========= */

.abc {
  background: #B89026;
  color: #fff;
  position: relative;
  z-index: 2200;
  /* Higher than header (2000) */
}

.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.top-left span {
  margin-right: 20px;
  cursor: pointer;
}

.top-left i {
  margin-left: 4px;
  font-size: 10px;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* center socials */
.top-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.social a {
  margin: 0 5px;
  font-size: 13px;
}

/* ========= USER PROFILE DROPDOWN ========= */

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  position: relative;
}

.user-circle {
  width: 32px;
  height: 32px;
  background: #222;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.user-name {
  font-size: 13px;
}

.logout-link {
  font-size: 12px;
  color: #fff;
  opacity: 0.8;
}

.logout-link:hover {
  opacity: 1;
}

.user-dropdown {
  position: relative;
  cursor: pointer;
}

.user-caret {
  font-size: 11px;
  opacity: 0.9;
}

/* dropdown panel */
.user-menu {
  position: absolute;
  right: 0;
  top: 120%;
  min-width: 150px;
  background: #ffffff;
  color: #333;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  padding: 6px 0;
  display: none;
  z-index: 2300;
  /* Higher than header and top bar */
}

.user-menu a {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

.user-menu a:hover {
  background: #f5f5f5;
}

.user-dropdown.open .user-menu {
  display: block;
}

/* ========= MAIN HEADER ========= */

.header {
  background: var(--primary);
  padding: 18px 0;
  color: #fff;
  position: relative;
  z-index: 2000;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .16em;
}

.logo span {
  display: block;
  font-size: 11px;
  letter-spacing: .26em;
  font-weight: 400;
  margin-top: 2px;
}

.logo img {
  max-height: 100px;
  width: auto;
  display: block;
}

/* SEARCH BOX */

.search-box {
  flex: 1;
  max-width: 600px;
  display: flex;
  background: #fff;
  border-radius: 999px;
  overflow: visible;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}

.search-category {
  position: relative;
  padding: 12px 18px;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}

.search-input {
  flex: 1;
  border: none;
  padding: 0 14px;
  font-size: 13px;
  outline: none;
}

.search-button {
  width: 52px;
  border: none;
  background: var(--primary);
  cursor: pointer;
  font-size: 16px;
  color: #fff;
  transition: .2s ease;
}

.search-button:hover {
  background: var(--primary-dark);
}

/* category dropdown */

.search-category-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
  list-style: none;
  margin: 6px 0 0;
  padding: 4px 0;
  max-height: 260px;
  overflow-y: auto;
  z-index: 99;
  display: none;
}

.search-category-dropdown li {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.search-category-dropdown li:hover {
  background: #f5f5f5;
}

/* when open */
.search-category.open .search-category-dropdown {
  display: block;
}

/* HEADER ICONS */

.header-icons {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.header-icons .icon-btn {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  position: relative;
}

.header-icons .icon-btn i {
  font-size: 18px;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -10px;
  background: #000;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========= NAVBAR ========= */

.nav {
  background: var(--primary);
  border-top: 1px solid rgba(255, 255, 255, .15);
  position: relative;
  z-index: 40;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  position: relative;
}

/* Desktop: Normal readable size (matching index.php) */
.nav ul {
  display: flex;
  flex-wrap: nowrap;
  gap: 32px;
  align-items: center;
  font-size: 13px;
  color: #fff;
}

/* Medium screens (tablets 769-1080px): Slightly smaller but still readable */
@media (max-width: 1080px) and (min-width: 769px) {
  .nav ul {
    gap: 18px;
    font-size: 11px;
    /* Increased from 9px for better readability */
  }

  .nav li {
    padding: 10px 0;
  }
}

.nav li {
  padding: 14px 0;
  position: relative;
  cursor: pointer;
}

.nav li a {
  color: #fff;
}

.nav li.active {
  font-weight: 600;
}

.nav li.active::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: #fff;
}

/* MEGA MENU */

.nav li.has-mega {
  position: static;
  /* Full width dropdown */
}

.mega-menu {
  position: absolute;
  left: 0;
  /* right: 0; Removed to prevent full width */
  width: max-content;
  /* Shrink fit to content */
  max-width: 90vw;
  /* Prevent overflow on small screens */
  top: 100%;
  margin-top: 0;
  background: #ffffff;
  border-top: 1px solid var(--border);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
  padding: 10px 20px 12px;
  /* Added horizontal padding */
  display: none;
  z-index: 60;
  border-radius: 0 0 8px 8px;
  /* Optional: rounded corners at bottom */
}

.nav li.has-mega:hover .mega-menu {
  display: block;
}

.mega-menu-inner {
  display: flex !important;
  /* Force flex */
  flex-wrap: wrap;
  gap: 40px;
  /* Fixed gap between content-sized columns */
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  justify-content: flex-start;
  /* Align items to the left */
}

/* Force layout for mega menu columns to fix Tailwind conflict */
.mega-menu-inner>div {
  flex: 0 0 auto !important;
  width: auto !important;
  display: block !important;
  min-width: 150px;
  margin-right: 0 !important;
}

.mega-column-title {
  font-size: 10.5px;
  text-transform: uppercase;
  margin-bottom: 5px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--text);
  padding-bottom: 3px;
  border-bottom: 1px solid #f0f0f0;
}

.mega-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: block !important;
  /* Force vertical block layout */
}

.mega-list li {
  margin-bottom: 0;
  display: block !important;
  /* Force list items to stack vertically */
  width: 100%;
  /* Ensure full width */
  padding: 4px 0;
}

.mega-item-link {
  display: block;
  padding: 3px 0;
  font-size: 13px;
  color: #333;
  transition: all .2s ease;
}

.mega-item-link:hover {
  color: var(--primary-dark);
  transform: translateX(3px);
}

.mega-demo {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
}

.mega-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-top: 2px;
}

.mega-label-e {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #f0f0f0;
  color: #444;
  margin-left: 6px;
}

/* ===== DROPDOWN MENU STYLES ===== */
.nav li.has-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-top: 3px solid #D4AF37;
  display: none !important;
  z-index: 100;
  border-radius: 0 0 4px 4px;
  padding: 0;
  margin: 0;
}

.nav li.has-dropdown:hover .dropdown-menu {
  display: block !important;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

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

.dropdown-menu li {
  padding: 0;
  display: block;
  width: 100%;
}

.dropdown-menu li a {
  display: block;
  padding: 6px 15px;
  color: #333 !important;
  font-size: 13px;
  line-height: 1.4;
  border-bottom: 1px solid #f9f9f9;
  transition: all 0.2s;
  text-transform: none;
  font-weight: 400;
}

.dropdown-menu li a:hover {
  background: #f9f9f9;
  color: var(--primary-dark) !important;
  padding-left: 22px;
}

.dropdown-menu li:last-child a {
  border-bottom: none;
}

.fa-angle-down {
  font-size: 11px;
  margin-left: 4px;
  transition: transform 0.3s;
}

.nav li.has-dropdown:hover .fa-angle-down {
  transform: rotate(180deg);
}

/* Multi-column layout for large category lists */
.dropdown-menu.multi-column {
  column-count: 2;
  column-gap: 20px;
  column-fill: auto;
  max-height: 330px;
  width: 400px;
  padding-right: 15px;
}

.dropdown-menu.multi-column li {
  page-break-inside: avoid;
  break-inside: avoid;
}

.nav li.has-dropdown:hover .dropdown-menu.multi-column {
  display: block !important;
}

/* ========= MOBILE HEADER ========= */

.mobile-header {
  display: none;
  height: 60px;
  /* Slightly taller for better touch */
  background: #D4AF37 !important;
  /* Force Gold Background */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 12px;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
}

.mobile-header-logo {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.mobile-header-logo img {
  height: 40px;
  width: auto;
  display: block;
  /* Ensure logo looks good on gold bg (if transparency issue exist, we can't fix here but usually png is fine) */
}

.mobile-menu-toggle {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #ffffff;
  /* White to match desktop */
  cursor: pointer;
}

.mobile-header-login-btn {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #ffffff;
  /* White to match desktop */
  cursor: pointer;
  text-decoration: none;
}

.mobile-header-user-dropdown {
  position: relative;
}

.mobile-header-user-btn {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-header-user-circle {
  width: 32px;
  height: 32px;
  background: #ffffff;
  /* White circle */
  color: var(--primary);
  /* Gold text */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.mobile-header-user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 140px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  padding: 6px 0;
  display: none;
  z-index: 200;
  margin-top: 8px;
}

.mobile-header-user-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 12px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #ffffff;
}

.mobile-header-user-menu a {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

.mobile-header-user-menu a:hover {
  background: #f5f5f5;
}

.mobile-header-user-dropdown.open .mobile-header-user-menu {
  display: block;
}

/* ========= MOBILE OFF-CANVAS MENU ========= */

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  z-index: 3000;
  /* Higher than global .nav (999) */
}

.mobile-menu-overlay.open {
  display: block;
}

.mobile-menu-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 80%;
  max-width: 320px;
  height: 100%;
  background: #ffffff;
  box-shadow: 2px 0 18px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  z-index: 3001;
  /* Above overlay */
}

.mobile-menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #4a4a4a;
  color: #fff;
  text-transform: uppercase;
  font-size: 14px;
}

.mobile-menu-title {
  font-weight: 600;
}

.mobile-menu-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.mobile-menu-search {
  display: flex;
  padding: 8px 10px;
  border-bottom: 1px solid #e3e3e3;
}

.mobile-menu-search input {
  flex: 1;
  border: 1px solid #ddd;
  padding: 6px 8px;
  font-size: 12px;
}

.mobile-menu-search button {
  width: 36px;
  border: none;
  background: #4a4a4a;
  color: #fff;
  font-size: 14px;
}

.mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
}

.mobile-menu-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-list li.active {
  background: #3B502C;
  color: #fff;
}

.mobile-menu-list li a {
  flex: 1;
}

.mobile-menu-list .plus {
  font-weight: 700;
  font-size: 16px;
  color: #777;
}

.mobile-menu-colors {
  padding: 12px 14px 14px;
  display: flex;
  gap: 8px;
}

.color-box {
  width: 26px;
  height: 26px;
  display: inline-block;
}

.color-box.c1 {
  background: #29458b;
}

.color-box.c2 {
  background: #2d8ec5;
}

.color-box.c3 {
  background: #d54235;
}

.color-box.c4 {
  background: #b6328f;
}

/* Mobile submenu styles */
.mobile-menu-list li.has-submenu {
  display: block;
  padding: 0;
}

.mobile-menu-list li.has-submenu .menu-item-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.mobile-menu-list li.has-submenu .menu-item-wrapper a {
  flex: 1;
}

.mobile-menu-list li.has-submenu .plus {
  transition: transform 0.3s ease;
}

.mobile-menu-list li.has-submenu.open .plus {
  transform: rotate(45deg);
}

.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  background: #f9f9f9;
  transition: max-height 0.3s ease;
  list-style: none;
}

.mobile-menu-list li.has-submenu.open .mobile-submenu {
  max-height: 500px;
}

.mobile-submenu li {
  padding: 10px 14px 10px 30px !important;
  border-bottom: 1px solid #e8e8e8;
  font-size: 12px;
}

.mobile-submenu li:last-child {
  border-bottom: none;
}

.mobile-submenu li a {
  color: #555;
}

/* Desktop: never show mobile overlay */
@media (min-width: 769px) {
  .mobile-menu-overlay {
    display: none !important;
  }
}

/* ========= MOBILE BOTTOM NAV ========= */

.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: #ffffff;
  border-top: 1px solid #e3e3e3;
  display: none;
  align-items: center;
  justify-content: space-around;
  font-size: 11px;
  z-index: 99;
}

.mobile-bottom-nav a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: #3B502C;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.mobile-bottom-nav a i {
  font-size: 18px;
}

/* Mobile user dropdown in bottom nav */
.mobile-user-dropdown {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-user-trigger {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: #3B502C;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.mobile-user-circle {
  width: 28px;
  height: 28px;
  background: #3B502C;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.mobile-user-menu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 140px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.2);
  padding: 6px 0;
  display: none;
  z-index: 200;
  margin-bottom: 10px;
}

.mobile-user-menu::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #ffffff;
}

.mobile-user-menu a {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

.mobile-user-menu a:hover {
  background: #f5f5f5;
}

.mobile-user-dropdown.open .mobile-user-menu {
  display: block;
}

/* ========= RESPONSIVE ========= */

@media (max-width:768px) {
  .mobile-header {
    display: flex !important;
  }

  /* Hide top bar completely on mobile */
  .abc {
    display: none !important;
  }

  /* Hide social icons on mobile */
  .top-center {
    display: none !important;
  }

  .abc,
  .header,
  .nav {
    display: none !important;
  }

  .main {
    margin-top: 50px;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .header-icons {
    display: none;
  }

  .nav ul {
    display: none;
  }

  body {
    padding-bottom: 70px;
  }

  .mobile-bottom-nav {
    display: flex;
  }
}

/* Boost Nav Z-Index global - Only for desktop/larger screens */
@media (min-width: 769px) {
  .nav {
    z-index: 999;
  }
}

@media (max-width:768px) {
  .nav ul {
    /* Ensure desktop menu is hidden on mobile */
    display: none !important;
    /* Remove overflow which might cause clipping if it were visible */
    overflow: visible !important;
  }
}