/* ==========================================================================
   🏺 BOGHCHEH DESIGN SYSTEM - HEADER & NAVBAR COMPONENT
   Modular, Glassmorphic, Modern Desktop & Mobile Header Styles
   ========================================================================== */

/* -------------------------
   🔶 TOP MINI BANNER
-------------------------- */
.top-banner {
  background-color: var(--primary, #8B5E3C);
  color: var(--text-inverse, #ffffff);
  padding: 6px 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  position: relative;
  z-index: 1001;
  box-sizing: border-box;
}

.top-banner p,
.top-banner .p-style-1 {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-inverse, #ffffff);
  text-align: center;
  font-weight: 500;
}

@media (max-width: 640px) {
  .top-banner {
    padding: 5px 10px;
    gap: 8px;
  }
  .top-banner p,
  .top-banner .p-style-1 {
    font-size: 0.75rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}


/* -------------------------
   🔍 MOBILE SEARCH (sticky)
-------------------------- */
.mobile-search-box {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-main, #F7F3EE);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color, rgba(139, 94, 60, 0.12));
}

.mobile-search-box form,
.mobile-search-box .mobile-search-form {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.mobile-search-box input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 44px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, rgba(139, 94, 60, 0.15));
  border-radius: var(--radius-md, 12px);
  font-family: inherit;
  font-size: 16px;
  color: var(--text-primary, #2b1810);
  outline: none;
  box-sizing: border-box;
}

.mobile-search-box input:focus {
  border-color: var(--primary, #8B5E3C);
}

.mobile-search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary, #8B5E3C);
  pointer-events: none;
  font-size: 1rem;
  line-height: 1;
}

@media (min-width: 768px) {
  .mobile-search-box {
    display: none;
  }
}

/* -------------------------
   🧭 DESKTOP NAVBAR
-------------------------- */
.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.main-navbar {
  display: none;
}

@media (min-width: 768px) {
  .main-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 10px 28px;
    background: var(--bg-card, #ffffff);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color, rgba(139, 94, 60, 0.12));
    gap: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  }

  .navbar-right,
  .navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    white-space: nowrap;
  }

  .navbar-center {
    flex: 1;
    max-width: 440px;
    margin: 0 20px;
  }

  .logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
    margin-left: 14px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
  }

  .logo .logo-img {
    height: 38px;
    width: auto;
    max-width: 110px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 1px 3px rgba(139, 94, 60, 0.12));
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .logo:hover .logo-img {
    transform: scale(1.05);
  }

  .nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-primary, #2b1810);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    border-radius: var(--radius-sm, 8px);
    transition: var(--transition-fast, 0.2s ease);
  }

  .nav-item:hover {
    color: var(--primary, #8B5E3C);
    background: var(--bg-muted, rgba(139, 94, 60, 0.06));
  }

  .nav-item.platform-trigger,
  .nav-item.category-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-muted, rgba(139, 94, 60, 0.07));
    border: 1px solid var(--border-color, rgba(139, 94, 60, 0.15));
    border-radius: var(--radius-sm, 8px);
    color: var(--primary, #8B5E3C);
    font-weight: 700;
    font-size: 0.88rem;
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none;
  }

  .nav-item.platform-trigger i,
  .nav-item.category-trigger i {
    font-size: 0.95rem;
    margin-left: 2px;
  }

  .nav-item.platform-trigger:hover,
  .nav-item.category-trigger:hover {
    background: var(--primary, #8B5E3C);
    color: var(--text-inverse, #ffffff);
    border-color: var(--primary, #8B5E3C);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 94, 60, 0.2);
  }

  .search-form {
    position: relative;
    width: 100%;
  }

  .search-form input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-muted, #f4efe9);
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-color, rgba(139, 94, 60, 0.12));
    font-size: 0.88rem;
    color: var(--text-primary, #2b1810);
    font-family: inherit;
    outline: none;
    transition: all 0.25s ease;
  }

  .search-form input:focus {
    border-color: var(--primary, #8B5E3C);
    background: var(--bg-card, #ffffff);
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.12);
  }

  .search-button {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: var(--primary, #8B5E3C);
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px;
  }

  .auth-links {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-left: 1px solid var(--border-color, rgba(139, 94, 60, 0.15));
    border-right: 1px solid var(--border-color, rgba(139, 94, 60, 0.15));
  }

  .auth-links .nav-item i {
    margin-left: 6px;
    font-size: 0.95rem;
  }

  .cta-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--primary, #8B5E3C);
    border-radius: var(--radius-sm, 8px);
    color: var(--primary, #8B5E3C);
    font-weight: 700;
    font-size: 0.88rem;
    transition: all 0.25s ease;
    text-decoration: none;
    background: transparent;
  }

  .cta-button i {
    margin-left: 4px;
  }

  .cta-button:hover {
    background-color: var(--primary, #8B5E3C);
    color: var(--text-inverse, #ffffff);
    box-shadow: 0 4px 12px rgba(139, 94, 60, 0.2);
    transform: translateY(-1px);
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .main-navbar {
    padding: 8px 10px;
    gap: 6px;
    box-sizing: border-box;
    max-width: 100%;
  }

  .navbar-right,
  .navbar-left {
    gap: 5px;
    min-width: 0;
  }

  .logo {
    margin-left: 2px;
  }

  .logo .logo-img {
    height: 30px;
    max-width: 74px;
  }

  .navbar-center {
    margin: 0 4px;
    max-width: 180px;
    min-width: 80px;
    flex: 1 1 110px;
  }

  .navbar-center .search-form input {
    font-size: 0.76rem;
    padding: 7px 10px 7px 30px;
  }

  .nav-item {
    padding: 6px 7px;
    font-size: 0.74rem;
    gap: 4px;
  }

  .nav-item.platform-trigger,
  .nav-item.category-trigger {
    padding: 6px 7px;
    font-size: 0.74rem;
    gap: 4px;
  }

  .cart-wrapper .cart-btn {
    padding: 6px 8px;
    font-size: 0.74rem;
  }

  .cart-wrapper .cart-btn span:not(.cart-badge-count) {
    display: none;
  }

  .cta-button {
    padding: 6px 8px;
    font-size: 0.74rem;
    gap: 4px;
  }

  .navbar-left a.nav-item[href*="events"] {
    display: none;
  }

  .auth-links {
    padding: 0 5px;
  }

  .auth-links .nav-item {
    font-size: 0.74rem;
    padding: 5px 5px;
  }
}

@media (min-width: 1200px) {
  .main-navbar {
    padding: 12px 48px;
    gap: 28px;
  }

  .navbar-right,
  .navbar-left {
    gap: 20px;
  }

  .navbar-center {
    max-width: 480px;
    margin: 0 28px;
  }
}

/* -------------------------
   🌐 PLATFORM SECTIONS MENU
-------------------------- */
.platform-wrapper {
  position: relative;
  white-space: nowrap;
}

.platform-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 94, 60, 0.25) transparent;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-color, rgba(139, 94, 60, 0.18));
  border-radius: var(--radius-lg, 18px);
  box-shadow: 0 20px 45px rgba(43, 24, 16, 0.14), 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              visibility 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: 0.15s;
  z-index: 1200;
}

.platform-menu::-webkit-scrollbar {
  width: 5px;
}

.platform-menu::-webkit-scrollbar-track {
  background: transparent;
}

.platform-menu::-webkit-scrollbar-thumb {
  background: rgba(139, 94, 60, 0.25);
  border-radius: 4px;
}

.platform-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 94, 60, 0.45);
}

/* پل ارتباطی نامرئی برای جلوگیری از بسته شدن هاور هنگام حرکت موس */
.platform-menu::before {
  content: "";
  position: absolute;
  top: -16px;
  right: 0;
  left: 0;
  height: 16px;
  display: block;
}

.platform-wrapper:hover .platform-menu,
.platform-wrapper:focus-within .platform-menu,
.platform-menu:hover,
.platform-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition-delay: 0s;
}

.platform-menu-header {
  padding: 2px 6px 10px;
  border-bottom: 1px dashed var(--border-color, rgba(139, 94, 60, 0.14));
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.platform-menu-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary, #8B5E3C);
}

.platform-menu-title-row i {
  font-size: 0.95rem;
  color: var(--secondary, #c46a2b);
}

.platform-menu-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-primary, #2b1810);
  letter-spacing: -0.2px;
}

.platform-menu-desc {
  font-size: 0.72rem;
  color: var(--text-muted, #8a7a70);
  font-weight: 500;
  padding-right: 22px;
}

.platform-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 4px 0;
}

.platform-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm, 10px);
  text-decoration: none;
  color: var(--text-primary, #2b1810);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: transparent;
  border: 1px solid transparent;
}

.platform-menu-item:hover {
  background: var(--bg-muted, rgba(139, 94, 60, 0.06));
  border-color: rgba(139, 94, 60, 0.12);
  transform: translateX(-3px);
}

.platform-icon-circle {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #fff;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.platform-menu-item:hover .platform-icon-circle {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

/* پالت رنگی هماهنگ با تم اصیل سایت (سفال، چرم، مس و چوب) */
.icon-feed { background: linear-gradient(135deg, var(--secondary, #c46a2b), var(--primary, #8B5E3C)); }
.icon-top-booths { background: linear-gradient(135deg, #D4AF37, #B8860B); }
.icon-market { background: linear-gradient(135deg, #8B5E3C, var(--secondary, #c46a2b)); }
.icon-licenses { background: linear-gradient(135deg, #a04e17, #6f472e); }
.icon-reels { background: linear-gradient(135deg, var(--secondary, #c46a2b), #934316); }
.icon-events { background: linear-gradient(135deg, #c46a2b, var(--primary, #8B5E3C)); }
.icon-messages { background: linear-gradient(135deg, var(--primary, #8B5E3C), #5C3D26); }
.icon-cart { background: linear-gradient(135deg, var(--secondary, #c46a2b), var(--primary, #8B5E3C)); }
.icon-user { background: linear-gradient(135deg, var(--primary, #8B5E3C), #5C3D26); }
.icon-seller { background: linear-gradient(135deg, var(--secondary, #c46a2b), var(--primary, #8B5E3C)); }

.platform-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.platform-item-text .title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.platform-item-text .title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary, #2b1810);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-item-text .desc {
  font-size: 0.71rem;
  color: var(--text-muted, #8a7a70);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* بج‌های هماهنگ با تم سایت */
.platform-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 12px;
  color: #fff;
  white-space: nowrap;
  line-height: 1.4;
}

.platform-badge.hot {
  background: linear-gradient(135deg, var(--secondary, #c46a2b), #a04e17);
  box-shadow: 0 2px 6px rgba(196, 106, 43, 0.35);
}

.platform-badge.gold {
  background: linear-gradient(135deg, #D4AF37, #B8860B);
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.35);
}

.platform-badge.new {
  background: linear-gradient(135deg, var(--primary, #8B5E3C), #5C3D26);
  box-shadow: 0 2px 6px rgba(139, 94, 60, 0.35);
}

.platform-badge.live {
  background: linear-gradient(135deg, var(--secondary, #c46a2b), var(--primary, #8B5E3C));
  box-shadow: 0 2px 6px rgba(196, 106, 43, 0.35);
  animation: pulseBadge 1.5s infinite;
}

@keyframes pulseBadge {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.82; transform: scale(1.06); }
}

/* 📜 بخش راهنما و صفحات عمومی در مگامنوی پلتفرم */
.platform-info-section {
  border-top: 1px dashed var(--border-color, rgba(139, 94, 60, 0.14));
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.platform-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.platform-info-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary, #8B5E3C);
}

.platform-info-title-row i {
  font-size: 0.85rem;
  color: var(--secondary, #c46a2b);
}

.platform-info-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-primary, #2b1810);
  letter-spacing: -0.2px;
}

.platform-info-sub {
  font-size: 0.68rem;
  color: var(--text-muted, #8a7a70);
  font-weight: 500;
}

.platform-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.platform-info-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg-muted, rgba(139, 94, 60, 0.05));
  border: 1px solid rgba(139, 94, 60, 0.1);
  border-radius: var(--radius-sm, 10px);
  color: var(--text-primary, #2b1810);
  text-decoration: none;
  font-size: 0.77rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.platform-info-chip i {
  font-size: 0.88rem;
  color: var(--primary, #8B5E3C);
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.platform-info-chip span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-info-chip:hover {
  background: rgba(196, 106, 43, 0.1);
  border-color: rgba(196, 106, 43, 0.3);
  color: var(--secondary, #c46a2b);
  transform: translateY(-1px);
}

.platform-info-chip:hover i {
  color: var(--secondary, #c46a2b);
  transform: scale(1.15);
}

.platform-info-chip--pwa {
  background: linear-gradient(135deg, rgba(196, 106, 43, 0.08), rgba(139, 94, 60, 0.08));
  border-color: rgba(196, 106, 43, 0.22);
}

.platform-chip-badge {
  margin-right: auto;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--secondary, #c46a2b), var(--primary, #8B5E3C));
  color: #fff;
  line-height: 1.4;
  letter-spacing: 0.2px;
}

/* فوتر منوی پلتفرم */
.platform-menu-footer {
  border-top: 1px dashed var(--border-color, rgba(139, 94, 60, 0.14));
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.platform-footer-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm, 10px);
  text-decoration: none;
  color: var(--text-primary, #2b1810);
  background: var(--bg-muted, rgba(139, 94, 60, 0.04));
  transition: all 0.2s ease;
}

.platform-footer-user:hover {
  background: rgba(139, 94, 60, 0.09);
  transform: translateX(-3px);
}

.platform-footer-user-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.platform-footer-user-text .title {
  font-size: 0.82rem;
  font-weight: 700;
}

.platform-footer-user-text .desc {
  font-size: 0.69rem;
  color: var(--text-muted, #8a7a70);
}

.platform-footer-user .arrow {
  font-size: 0.75rem;
  color: var(--text-muted, #8a7a70);
  transition: transform 0.2s ease;
}

.platform-footer-user:hover .arrow {
  transform: translateX(-3px);
  color: var(--primary, #8B5E3C);
}

/* بنر ویژه ایجاد غرفه در فوتر */
.platform-menu-cta {
  background: linear-gradient(135deg, rgba(196, 106, 43, 0.08), rgba(212, 175, 55, 0.14));
  border: 1px dashed rgba(196, 106, 43, 0.35);
  border-radius: var(--radius-sm, 12px);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  transition: all 0.25s ease;
}

.platform-menu-cta:hover {
  background: linear-gradient(135deg, rgba(196, 106, 43, 0.15), rgba(212, 175, 55, 0.22));
  border-color: var(--secondary, #c46a2b);
  box-shadow: 0 4px 12px rgba(196, 106, 43, 0.12);
  transform: translateY(-2px);
}

.platform-menu-cta .cta-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-menu-cta .cta-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #c46a2b, #8B5E3C);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 3px 8px rgba(196, 106, 43, 0.25);
}

.platform-menu-cta .cta-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.platform-menu-cta .cta-text strong {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary, #8B5E3C);
}

.platform-menu-cta .cta-text small {
  font-size: 0.69rem;
  color: var(--text-muted, #8a7a70);
}

.platform-menu-cta .cta-btn-tag {
  font-size: 0.74rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--secondary, #c46a2b), var(--primary, #8B5E3C));
  padding: 5px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(196, 106, 43, 0.25);
}

/* -------------------------
   🧱 DESKTOP MEGA MENU
-------------------------- */
.category-wrapper {
  position: static;
  white-space: nowrap;
}

.mega-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  left: 16px;
  max-width: 1400px;
  margin: 0 auto;
  white-space: normal;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-color, rgba(139, 94, 60, 0.18));
  border-radius: var(--radius-lg, 18px);
  box-shadow: 0 24px 60px rgba(43, 24, 16, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  direction: rtl;
  text-align: right;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              visibility 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: 0.15s;
  z-index: 1100;
  box-sizing: border-box;
}

/* پل نامرئی بین نوار ناوبری و مگامنو برای عبور روان موس */
.mega-menu::before {
  content: "";
  position: absolute;
  top: -20px;
  right: 0;
  left: 0;
  height: 20px;
  display: block;
}

@media (min-width: 1200px) {
  .mega-menu {
    right: 40px;
    left: 40px;
    padding: 22px 24px;
  }
}

@media (min-width: 1440px) {
  .mega-menu {
    right: 70px;
    left: 70px;
  }
}

.category-wrapper:hover .mega-menu,
.category-wrapper:focus-within .mega-menu,
.mega-menu:hover,
.mega-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition-delay: 0s;
}

.mega-columns-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1199px) {
  .mega-columns-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 960px) {
  .mega-columns-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

.mega-column {
  background: var(--bg-muted, #faf6f0);
  border: 1px solid var(--border-color, rgba(139, 94, 60, 0.12));
  border-radius: var(--radius-md, 12px);
  padding: 10px 12px;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.mega-column:hover {
  background: var(--bg-card, #ffffff);
  border-color: rgba(196, 106, 43, 0.35);
  box-shadow: 0 6px 18px rgba(139, 94, 60, 0.08);
  transform: translateY(-2px);
}

.mega-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color, rgba(139, 94, 60, 0.12));
  min-width: 0;
}

.mega-col-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--radius-sm, 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.col-rug { background: linear-gradient(135deg, var(--secondary, #c46a2b), var(--primary, #8B5E3C)); }
.col-pottery { background: linear-gradient(135deg, var(--primary, #8B5E3C), #6f472e); }
.col-jewelry { background: linear-gradient(135deg, #D4AF37, var(--secondary, #c46a2b)); }
.col-wood { background: linear-gradient(135deg, #a04e17, #5C3D26); }
.col-leather { background: linear-gradient(135deg, var(--primary, #8B5E3C), #5C3D26); }
.col-copper { background: linear-gradient(135deg, var(--secondary, #c46a2b), #934316); }
.col-souvenirs { background: linear-gradient(135deg, #D4AF37, #B8860B); }

.mega-col-header h4 {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--primary, #8B5E3C);
  line-height: 1.3;
  min-width: 0;
  flex: 1;
}

.mega-col-header h4 a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  color: inherit;
  text-decoration: none;
}

.mega-column a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  color: var(--text-primary, #2b1810);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  direction: rtl;
  text-align: right;
  min-width: 0;
}

.mega-column a span {
  flex: 1;
  min-width: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.2s ease, color 0.2s ease;
}

.mega-column a i {
  font-size: 0.65rem;
  color: var(--secondary, #c46a2b);
  opacity: 0;
  transform: translateX(4px);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mega-column a:hover {
  background: rgba(139, 94, 60, 0.08);
  color: var(--secondary, #c46a2b);
}

.mega-column a:hover span {
  transform: translateX(-3px);
  color: var(--secondary, #c46a2b);
}

.mega-column a:hover i {
  opacity: 1;
  transform: translateX(0);
}

/* نوار زیرین فوتر مگامنو */
.mega-menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-color, rgba(139, 94, 60, 0.12));
  flex-wrap: wrap;
  gap: 12px;
}

.mega-popular-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tags-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--secondary, #c46a2b);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tags-label i {
  color: #ef4444;
}

.mega-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #8a7a70);
  background: var(--bg-muted, rgba(139, 94, 60, 0.06));
  padding: 3px 10px;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.mega-tag:hover {
  background: var(--secondary, #c46a2b);
  color: #fff;
  box-shadow: 0 2px 8px rgba(196, 106, 43, 0.25);
  transform: translateY(-1px);
}

.mega-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary, #8B5E3C);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(139, 94, 60, 0.08);
  border: 1px solid rgba(139, 94, 60, 0.15);
  transition: all 0.2s ease;
}

.mega-all-btn i {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.mega-all-btn:hover {
  background: var(--primary, #8B5E3C);
  color: #fff;
  border-color: var(--primary, #8B5E3C);
  box-shadow: 0 3px 10px rgba(139, 94, 60, 0.2);
}

.mega-all-btn:hover i {
  transform: translateX(-4px);
}

/* -------------------------
   🛒 CART DROPDOWN & BADGE
-------------------------- */
.cart-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.cart-wrapper .cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-muted, rgba(139, 94, 60, 0.07));
  border: 1px solid var(--border-color, rgba(139, 94, 60, 0.15));
  border-radius: var(--radius-md, 10px);
  padding: 8px 14px;
  color: var(--text-primary, #2b1810);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  outline: none;
}

.cart-wrapper .cart-btn i {
  font-size: 1rem;
  color: var(--primary, #8B5E3C);
  transition: transform 0.2s ease;
}

.cart-wrapper .cart-btn:hover {
  background: rgba(139, 94, 60, 0.12);
  border-color: var(--primary, #8B5E3C);
  color: var(--primary, #8B5E3C);
}

.cart-badge-count {
  background: linear-gradient(135deg, var(--secondary, #c46a2b), var(--primary, #8B5E3C));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(196, 106, 43, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-hover {
  display: none;
}

@media (min-width: 768px) {
  .cart-hover {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    right: auto;
    width: 370px;
    max-width: calc(100vw - 32px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 94, 60, 0.22);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 16px 40px rgba(43, 24, 16, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.98);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 1200;
    max-height: 490px;
    pointer-events: none;
  }

  .cart-hover::before {
    content: "";
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
  }

  .cart-hover::after {
    content: "";
    position: absolute;
    top: -6px;
    left: 24px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-top: 1px solid rgba(139, 94, 60, 0.22);
    border-left: 1px solid rgba(139, 94, 60, 0.22);
    transform: rotate(45deg);
    z-index: 1;
  }

  .cart-wrapper:hover .cart-hover,
  .cart-hover.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
}

.cart-hover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(139, 94, 60, 0.05), rgba(196, 106, 43, 0.07));
  border-bottom: 1px solid rgba(139, 94, 60, 0.12);
  border-radius: var(--radius-lg, 16px) var(--radius-lg, 16px) 0 0;
  position: relative;
  z-index: 2;
}

.cart-hover-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary, #2b1810);
}

.cart-hover-title i {
  color: var(--secondary, #c46a2b);
}

.cart-items-counter {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--secondary, #c46a2b);
  background: rgba(196, 106, 43, 0.12);
  padding: 3px 10px;
  border-radius: 20px;
}

.cart-hover .cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 270px;
}

.cart-hover .cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-muted, #f4efe9);
  border: 1px solid var(--border-color, rgba(139, 94, 60, 0.12));
  border-radius: var(--radius-md, 10px);
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.cart-hover .cart-item:hover {
  background: #fff;
  border-color: rgba(196, 106, 43, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.cart-hover .cart-item img {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: var(--radius-sm, 8px);
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.cart-hover .item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cart-hover .item-info h4 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary, #2b1810);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-hover .item-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary, #8B5E3C);
}

.cart-hover .qty-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid rgba(139, 94, 60, 0.18);
  border-radius: 6px;
  padding: 2px 4px;
  width: fit-content;
}

.cart-hover .qty-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-primary, #2b1810);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cart-hover .qty-btn:hover {
  background: var(--secondary, #c46a2b);
  color: #fff;
}

.cart-hover .remove {
  background: none;
  border: none;
  color: var(--text-muted, #999);
  cursor: pointer;
  padding: 6px;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.remove:hover {
  color: var(--error, #e63946);
}

.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  text-align: center;
  color: var(--text-muted, #8a7a70);
  gap: 12px;
}

.cart-empty-icon {
  font-size: 2.2rem;
  color: rgba(139, 94, 60, 0.3);
}

.cart-empty-state p {
  margin: 0;
  font-size: 0.88rem;
}

.cart-footer {
  padding: 14px 18px;
  background: #fff;
  border-top: 1px solid var(--border-color, rgba(139, 94, 60, 0.12));
  border-radius: 0 0 var(--radius-lg, 16px) var(--radius-lg, 16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-footer .total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-secondary, #6c757d);
}

.cart-footer .total strong {
  font-size: 1rem;
  color: var(--primary, #8B5E3C);
}

.checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--secondary, #c46a2b), var(--primary, #8B5E3C));
  color: #fff;
  border-radius: var(--radius-md, 10px);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.checkout-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(196, 106, 43, 0.28);
}
