/* Header/Footer chrome only — scoped to avoid Tailwind collisions */
:root {
  --c-navy: #052C47;
  --c-blue: #007DC5;
  --c-teal: #00C5AB;
  --c-green: #A4CF57;
  --c-white: #FFFFFF;
  --f-fa: 'IRANYekan', Tahoma, sans-serif;
  --f-latin: 'Ubuntu', Arial, sans-serif;
  --gradient-scale: linear-gradient(to left, var(--c-blue), var(--c-teal), var(--c-green));
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --container-max: 1120px;
  --text-caption: 14px;
  --text-body: 16px;
  --text-lead: 18px;
  --border-subtle: color-mix(in srgb, var(--c-navy) 12%, transparent);
}

.site-header,
.site-footer {
  font-family: var(--f-fa);
  box-sizing: border-box;
}
.site-header *,
.site-header *::before,
.site-header *::after,
.site-footer *,
.site-footer *::before,
.site-footer *::after {
  box-sizing: border-box;
}

.site-header .latin,
.site-footer .latin { font-family: var(--f-latin); }

.site-header .container,
.site-footer .container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.site-header a,
.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-header a.outbound::after,
.site-footer a.outbound::after {
  content: '';
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-inline-start: 0.25em;
  background-color: currentColor;
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
}

.site-header .scale-rule {
  height: 3px;
  background: var(--gradient-scale);
  border: none;
  margin: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
  background: var(--c-white);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 76px;
}
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--text-lead);
  color: var(--c-navy);
  flex-shrink: 0;
}
.site-logo img {
  width: auto;
  height: 60px;
  display: block;
  max-width: none;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2) var(--space-4);
  font-weight: 500;
}
.site-header nav a {
  color: color-mix(in srgb, var(--c-navy) 78%, transparent);
  padding-block: var(--space-1);
}
.site-header nav a:hover {
  color: var(--c-blue);
}

.nav-dropdown {
  position: relative;
}
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding-block: var(--space-1);
  color: color-mix(in srgb, var(--c-navy) 78%, transparent);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.nav-dropdown-trigger::-webkit-details-marker {
  display: none;
}
.nav-dropdown-trigger::marker {
  content: '';
}
.nav-dropdown-trigger:hover,
.nav-dropdown[open] .nav-dropdown-trigger {
  color: var(--c-blue);
}
.nav-dropdown-chevron {
  width: 0;
  height: 0;
  border-inline: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.15s ease;
}
.nav-dropdown[open] .nav-dropdown-chevron {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 60;
  min-width: 180px;
  margin: 0;
  padding: var(--space-2);
  list-style: none;
  background: var(--c-white);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 12px 32px color-mix(in srgb, var(--c-navy) 12%, transparent);
  display: grid;
  gap: 2px;
}
.nav-dropdown-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--c-navy);
  white-space: nowrap;
}
.nav-dropdown-menu a:hover {
  background: color-mix(in srgb, var(--c-blue) 8%, transparent);
  color: var(--c-blue);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--c-white);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--c-navy);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.site-header.is-nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-header.is-nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.site-header.is-nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
body.nav-lock {
  overflow: hidden;
}

@media (max-width: 767px) {
  .site-logo img {
    height: 52px;
  }
  .nav-toggle {
    display: inline-flex;
    margin-inline-start: auto;
  }
  .site-header .container {
    flex-wrap: wrap;
    position: relative;
  }
  .site-header nav.site-nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    z-index: 70;
    max-height: min(80vh, 560px);
    overflow: auto;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 4px;
    padding: var(--space-3);
    background: var(--c-white);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 16px 40px color-mix(in srgb, var(--c-navy) 14%, transparent);
  }
  .site-header.is-nav-open nav.site-nav {
    display: flex;
  }
  .site-header nav.site-nav > a,
  .site-header nav.site-nav .nav-dropdown-trigger {
    display: flex;
    width: 100%;
    padding: 12px 10px;
    border-radius: 10px;
  }
  .nav-dropdown-menu {
    position: static;
    inset: auto;
    min-width: 0;
    margin-top: 4px;
    box-shadow: none;
    border-radius: 10px;
  }
}

.site-footer {
  background: var(--c-navy);
  color: var(--c-white);
  padding-block: var(--space-6);
  flex-shrink: 0;
}
.site-footer--compact {
  padding-block: var(--space-3);
}
.footer-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}
.footer-compact-copy {
  margin: 0;
  font-size: var(--text-caption);
  opacity: 0.85;
}
.footer-compact-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-size: var(--text-caption);
  font-weight: 500;
}
.site-footer a { opacity: 0.85; }
.site-footer a:hover { opacity: 1; }
.footer-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.footer-heading {
  margin: 0 0 var(--space-3);
  font-size: var(--text-body);
  font-weight: 700;
}
.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-body);
}
.footer-list--cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--space-5);
  row-gap: var(--space-2);
}
.footer-copy {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid color-mix(in srgb, white 18%, transparent);
  opacity: 0.85;
  font-size: var(--text-caption);
}
.footer-copy p { margin: 0; }

/* موبایل: لینک‌های فوتر حداقل ~۴۰px ارتفاع لمسی داشته باشند */
@media (max-width: 767px) {
  .footer-list { gap: 0; }
  .footer-list--cols { row-gap: 0; }
  .footer-list a,
  .footer-compact-nav a,
  .footer-copy a {
    display: inline-block;
    padding-block: 0.6rem;
  }
}

/* --------------------------------------------------------------------------
   همه‌ی متن‌ها justify (دسکتاپ و موبایل)
   - هر متنی داخل main و footer از دو طرف تراز می‌شود (پاراگراف، تیتر، لیست، لینک و ...).
   - خط آخرِ بلاک‌های وسط‌چین همچنان وسط می‌ماند (text-align-last روی خودِ بلاک؛
     بچه‌ها ارث می‌برند)، تا تیترها و توضیح‌های تک‌خطیِ وسط‌چین جابه‌جا نشوند.
     خط آخرِ start/end هم همان‌جا می‌ماند.
   - هر المانی با کلاس .no-justify، فرم‌ها (form) و بنرهای صفحه‌ی اصلی (.home-promo-banner)، تیترها (h1-h6)، دکمه‌ها، فیلدهای فرم، هدر جدول و آیکون‌های SVG مستثنی‌اند.
   - اگر جایی با style="text-align:..." مستقیم تنظیم شده باشد، همان اولویت دارد.
   -------------------------------------------------------------------------- */
:where(main, footer) :where(*):not(
button,
button *,
input,
select,
textarea,
option,
th,
h1,
h2,
h3,
h4,
h5,
h6,
:where(h1, h2, h3, h4, h5, h6) *,
svg,
svg *,
[role="button"],
[role="button"] *,
.home-final-cta__stores *,
.home-promo-banner,
.home-promo-banner *,
form,
form *,
.no-justify,
.no-justify *
) {
  text-align: justify;
  text-justify: inter-word;
}
:where(main, footer) :is(
.text-center,
.home-header,
.cta-band,
.contact-stage__aside,
[style*="text-align: center"],
[style*="text-align:center"]
) {
  text-align-last: center;
}
:where(main, footer) :is(
.text-start,
.text-left,
[style*="text-align: start"],
[style*="text-align:start"],
[style*="text-align: left"],
[style*="text-align:left"]
) {
  text-align-last: start;
}
:where(main, footer) :is(
.text-end,
.text-right,
[style*="text-align: end"],
[style*="text-align:end"],
[style*="text-align: right"],
[style*="text-align:right"]
) {
  text-align-last: end;
}
@media (min-width: 640px) {
  :where(main, footer) .sm\:text-center {
    text-align-last: center;
  }
  :where(main, footer) .sm\:text-start {
    text-align-last: start;
  }
}
@media (min-width: 1024px) {
  :where(main, footer) .lg\:text-center {
    text-align-last: center;
  }
}

/* تیترها (h1-h6) justify نمی‌شوند: همان تراز بلاک اطرافشان (وسط‌چین/start/end) را دارند */
:where(main, footer) :where(h1, h2, h3, h4, h5, h6) {
  text-align: start;
}
:where(main, footer) :is(
.text-center,
.home-header,
.cta-band,
.contact-stage__aside,
.home-title,
[style*="text-align: center"],
[style*="text-align:center"]
):where(h1, h2, h3, h4, h5, h6),
:where(main, footer) :is(
.text-center,
.home-header,
.cta-band,
.contact-stage__aside,
[style*="text-align: center"],
[style*="text-align:center"]
) :where(h1, h2, h3, h4, h5, h6) {
  text-align: center;
}
:where(main, footer) :is(.text-start, .text-left):where(h1, h2, h3, h4, h5, h6),
:where(main, footer) :is(.text-start, .text-left) :where(h1, h2, h3, h4, h5, h6) {
  text-align: start;
}
:where(main, footer) :is(.text-end, .text-right):where(h1, h2, h3, h4, h5, h6),
:where(main, footer) :is(.text-end, .text-right) :where(h1, h2, h3, h4, h5, h6) {
  text-align: end;
}
@media (min-width: 640px) {
  :where(main, footer) .sm\:text-center:where(h1, h2, h3, h4, h5, h6),
  :where(main, footer) .sm\:text-center :where(h1, h2, h3, h4, h5, h6) {
    text-align: center;
  }
  :where(main, footer) .sm\:text-start:where(h1, h2, h3, h4, h5, h6),
  :where(main, footer) .sm\:text-start :where(h1, h2, h3, h4, h5, h6) {
    text-align: start;
  }
}
@media (min-width: 1024px) {
  :where(main, footer) .lg\:text-center:where(h1, h2, h3, h4, h5, h6),
  :where(main, footer) .lg\:text-center :where(h1, h2, h3, h4, h5, h6) {
    text-align: center;
  }
}

/* بنرهای صفحه‌ی اصلی justify نمی‌شوند */
:where(main) .home-promo-banner {
  text-align: start;
  text-align-last: auto;
}

/* متن داخل فرم‌ها و .no-justify justify نمی‌شود (کلاس‌های text-center/text-end خودشان همچنان کار می‌کنند) */
:where(main, footer) :is(form, .no-justify) {
  text-align: start;
  text-align-last: auto;
}
