* {
  text-decoration: none;
}

/* ====== Scoped Header Styles ====== */
.site-header {
  --primary: #c2410c;
  --accent: #ea580c;
  --success: var(--success, #7c2d12);
  --ink: var(--ink, #1c1917);
  --muted: var(--muted, #a8a29e);
  --border: var(--border, #e7e5e4);
  --bg: var(--bg, #fef3e7);
  --bg-muted: var(--bg-muted, #f5f5f4);
  --placeholder-bg: #eff2ff;
  --radius: 20px;
  --shadow-1: 0 16px 32px rgba(194, 65, 12, 0.15);
  --shadow-2: 0 32px 64px rgba(194, 65, 12, 0.2);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  max-width: 1200px;
  margin-inline: auto;
  padding: 10px 16px;
}
/* main rows */
.site-header .h-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
.site-header .h-top > * {
  min-width: 0; /* prevent overflow of 1fr column */
}
.site-header .h-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  border-bottom: 0.5px solid #f390b2;
}

/* logo */
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 22px;
  color: var(--ink);
  white-space: nowrap;
}
.site-header .brand > * {
  flex: 0 0 auto;
}
.site-header .brand .mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(45deg, var(--primary), #33d4e7);
  display: inline-block;
}

/* categories trigger */
.site-header .cat-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.site-header .cat-trigger:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(25, 191, 211, 0.15);
}
.site-header .cat-trigger svg {
  opacity: 0.9;
}

/* search */
.site-header .search {
  position: relative;
}
.site-header .search input {
  width: 100%;
  background: #eef2ff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 42px 11px 12px;
  color: var(--ink);
  font-family: "IRANSansWeb(FaNum)", sans-serif;
}
.site-header .search input:placeholder-shown {
  background: var(--placeholder-bg, #eef2ff);
}
.site-header .search input::placeholder {
  color: #696b6f; /* distinct placeholder color */
  opacity: 1; /* ensure visibility (Safari/Firefox) */
}
.site-header .search input::-webkit-input-placeholder {
  color: #696b6f;
  opacity: 1;
}
.site-header .search input::-moz-placeholder {
  color: #696b6f;
  opacity: 1;
}
.site-header .search .icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
}

/* actions */
.site-header .actions,
.site-header .left-acts {
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-header .icon-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  background: #fff;
  color: #2f3640;
  white-space: nowrap;
}
.site-header .login-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: #4b5563;
  font-weight: 600;
  white-space: nowrap;
}
.site-header .cta-seller {
  border-color: var(--accent);
  color: #0c0a09;
  background: linear-gradient(135deg, #fef7ed 0%, #f3f4f6 100%);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 14px;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.12);
}

.site-header .cta-seller:hover {
  border-color: rgba(220, 38, 38, 0.5);
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.2);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #fef7ed 0%, #fef3c7 100%);
}

/* User panel button styling */
.site-header .user-panel-btn {
  background: #fff;
  border-color: var(--border);
  color: #4b5563;
}

.site-header .user-panel-btn:hover {
  border-color: #19bfd3;
  box-shadow: 0 2px 10px rgba(25, 191, 211, 0.25);
  transform: translateY(-1px);
}

.site-header .user-panel-btn .login-icon {
  color: #1e293b !important;
}

.site-header .user-panel-btn:hover .login-icon {
  color: #19bfd3 !important;
}

Login icon colors .site-header .login-icon {
  color: #19bfd3 !important;
  transition: color 0.2s ease;
}
.site-header .login-pill:not(.user-panel-btn):hover .login-icon {
  color: #ff6b6b !important;
}

/* Navigation links styling */
.site-header .link-flex {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  text-decoration: none;
  color: #4b5563;
  font-weight: 500;
  font-size: 14px;
}
.site-header .link-flex:hover {
  background: #fff0f5;
  color: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 240, 245, 0.6);
  filter: blur(0.5px);
  border-bottom: 1px solid #f390b2;
}
.site-header .link-flex svg {
  color: inherit !important;
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
  transition: all 0.3s ease;
}
.site-header .link-flex:hover svg {
  color: inherit !important;
  transform: scale(1.1);
}

/* sub-navigation links row */
.site-header .sub-links {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: #4b5563;
}
.site-header .sub-links {
  flex-wrap: wrap;
}
.site-header .sub-links li {
  flex: 0 1 auto;
}
.site-header .h-subnav {
  flex-wrap: wrap;
}
.site-header .sub-links a {
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}
.site-header .sub-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
}

/* location chip */
.site-header .location-chip {
  position: absolute;
  left: 16px;
  bottom: -18px;
  background: #fff7f0;
  color: #f97316;
  border: 1px solid #fed7aa;
  border-radius: 9999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

/* ===== Responsive header layout ===== */
@media (max-width: 1200px) {
  .site-header .container {
    padding: 8px 12px;
  }
  .login-pill {
    padding: 8px 12px;
    font-size: 14px;
  }
}
@media (max-width: 960px) {
  .site-header .h-top {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .site-header .left-acts {
    justify-content: space-between;
  }
  .site-header .brand {
    gap: 10px;
  }
  .site-header .brand img {
    height: 44px;
    width: auto;
  }
  .site-header .search input {
    padding: 10px 40px 10px 10px;
  }
  .site-header .location-chip {
    display: none;
  }
}
@media (max-width: 720px) {
  .site-header .icon-btn,
  .site-header .login-pill,
  .site-header .cta-seller {
    padding: 8px 10px;
  }
  .site-header .icon-btn svg,
  .site-header .login-pill svg,
  .site-header .cta-seller svg {
    width: 16px;
    height: 16px;
  }
}
@media (max-width: 480px) {
  .site-header .brand img {
    height: 36px;
  }
  .site-header .login-pill span,
  .site-header .cta-seller span,
  .site-header .user-panel-btn span {
    font-size: 13px;
  }
}

/* ===== Mega Menu (scoped) ===== */
:root {
  --primary: #19bfd3;
  --accent: #ff5333;
  --success: #66b766;
  --ink: #0c0f14;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #fff;
  --shadow-1: 0 8px 24px rgba(2, 6, 23, 0.06);
}

/* ظرف کلی منو */
.mega {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  display: none;
  z-index: 90;
}
.mega.is-open {
  display: block;
}
.mega[hidden] {
  display: none !important;
}
.mega .wrap {
  max-width: 1200px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 240px 1fr;
}

/* ریل چپ (سطح اول) */
.lvl1 {
  background: #fafbfc;
  border-inline-end: 1px solid var(--border);
  max-height: 64vh;
  overflow: auto;
}
.lv1-item {
  border-bottom: 1px solid var(--border);
}
.lvl1 button {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-direction: row-reverse;
  gap: 12px;
  transition: background-color 0.3s ease, border-inline-start 0.3s ease;
}
.lvl1 button:hover {
  background-color: #eef2ff;
  border-inline-start: 3px solid #f390b2;
}
.lvl1 button span {
  text-align: right;
  direction: rtl;
  width: 100%;
  padding-right: 8px;
}
.lvl1 button svg {
  transition: transform 0.3s ease;
}
.lvl1 button:hover svg {
  transform: scale(1.6);
}
.lvl1 .is-active {
  background: #fff;
  font-weight: 800;
  border-inline-start: 3px solid var(--primary);
}

/* پنل‌ها (سطح 2 و 3) - scoped to mega menu */
.mega .panel-area {
  max-height: 64vh;
  overflow: auto;
}
.mega .panel {
  display: none;
  padding: 14px 18px 18px;
}
.mega .panel.is-active {
  display: block;
}
.mega .panel .grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.mega .col h4 {
  margin: 0 0 8px;
  font-size: 14px;
}
.mega .col h4 a {
  color: #111;
  text-decoration: none;
}
.mega .col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.mega .col a {
  color: #4b5563;
  text-decoration: none;
}
.mega .col a:hover {
  color: #111;
  text-decoration: underline;
}

/* موبایل: تمام‌صفحه */
@media (max-width: 960px) {
  .mega {
    position: fixed;
    inset: 0;
    background: #fff;
  }
  .mega .wrap {
    grid-template-columns: 1fr;
    height: 100%;
  }
  .drawer-top {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
  }
  .lvl1 {
    border: 0;
    max-height: none;
  }
  .lv1-item {
    border-bottom: 1px solid var(--border);
  }
  .mega .panel {
    padding-top: 0;
  }
  .mega .panel .grid {
    grid-template-columns: 1fr;
  }
  /* header top row stacks and actions wrap */
  .h-top {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .left-acts {
    flex-wrap: wrap;
    column-gap: 10px;
    row-gap: 8px;
    justify-content: space-between;
  }
  .brand {
    justify-content: center;
  }
  .left-acts > a {
    max-width: 100%;
  }
  .search input {
    width: 100%;
    height: 44px;
    font-size: 15px;
  }
  .h-subnav {
    gap: 10px;
  }
  .sub-links {
    gap: 10px;
  }
}
/* Extra robust mobile handling for sub-nav to avoid overflow */
@media (max-width: 600px) {
  .site-header .h-subnav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 8px; /* room for hidden scrollbar */
  }
  .site-header .cat-trigger {
    flex: 0 0 auto; /* don't shrink trigger */
  }
  .site-header .sub-links {
    flex-wrap: nowrap; /* single row */
    gap: 10px;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox hide */
    scroll-snap-type: x mandatory; /* smooth chip snapping */
  }
  .site-header .sub-links::-webkit-scrollbar {
    display: none; /* WebKit hide */
  }
  .site-header .sub-links > li {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
  .site-header .sub-links li,
  .site-header .sub-links .sub-sep {
    flex: 0 0 auto;
  }
  /* chip look for links */
  .site-header .sub-links a {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 13px;
  }
  .site-header .sub-sep {
    display: none;
  }
}
@media (max-width: 480px) {
  .site-header .sub-sep {
    display: none; /* save space on tiny screens */
  }
}
@media (max-width: 360px) {
  .site-header .cat-trigger span,
  .site-header .login-pill span,
  .site-header .cta-seller span,
  .site-header .user-panel-btn span {
    display: none; /* icon-only on ultra small */
  }
  .site-header .search input {
    padding-right: 36px;
  }
}

/* Inline style classes extracted from HTML */
.container-relative {
  position: relative;
}

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

.brand-logo-main {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand-logo-wordmark {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
}

.link-flex {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-flex-shrink {
  flex-shrink: 0;
}

.drawer-close-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
}

.lvl1-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
