/* فتوحی — سیستم طراحی موبایل‌اول (۳۶۰px پایه → ۷۶۸ → ۱۰۲۴+) */
:root {
  --c-primary: #0F172A;
  --c-primary-soft: #1e293b;
  --c-accent: #C9A227;
  --c-accent-soft: #f5edd4;
  --c-bg: #F7F5F0;
  --c-surface: #ffffff;
  --c-border: #e8e4dc;
  --c-muted: #64748b;
  --c-text: #0f172a;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --shadow-hover: 0 4px 12px rgba(15,23,42,.08), 0 16px 40px rgba(15,23,42,.08);
  --header-h: 66px;
  --tap: 44px;
  --pad: 16px;
  --max: 1280px;
  --font: 'BYekan', Tahoma, 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font) !important;
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  /* overflow-x:hidden breaks position:sticky headers — avoid it */
  overflow-x: visible;
  max-width: 100%;
}
html { width: 100%; }
body { width: 100%; position: relative; overflow-x: visible !important; }
img, video, svg, canvas, iframe { max-width: 100%; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font-family: inherit !important;
  font-size: 16px; /* جلوگیری از زوم iOS */
}
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* Typography — restrained */
.site-title { font-weight: 700; letter-spacing: -0.02em; color: var(--c-primary); }
.muted { color: var(--c-muted); }
.price-fa {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--c-primary);
  direction: rtl;
}

/* Buttons — tap >= 44px */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: var(--tap);
  padding: .75rem 1.25rem;
  border-radius: var(--radius);
  border: 0;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s, transform .1s;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn-primary, .btn-primary:visited {
  background: var(--c-primary) !important;
  color: #fff !important;
}
.btn-primary:hover { background: #000 !important; }
.btn-accent, .btn-accent:visited {
  background: var(--c-accent) !important;
  color: #0f172a !important;
}
.btn-accent:hover { filter: brightness(.95); }
.btn-ghost {
  background: transparent;
  color: var(--c-primary);
  border: 1px solid var(--c-border);
}
.btn-ghost:hover { background: #fff; border-color: var(--c-accent); }
.btn-block { width: 100%; }
.btn-icon {
  width: var(--tap);
  height: var(--tap);
  min-height: var(--tap);
  padding: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--c-primary);
}
.btn-icon:hover { background: rgba(15,23,42,.05); }

/* Forms */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .875rem; font-weight: 600; color: var(--c-muted); }
.field input, .field textarea, .field select,
input[type="text"], input[type="tel"], input[type="email"], input[type="number"],
textarea, select {
  min-height: var(--tap);
  padding: .75rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: #fff;
  width: 100%;
  color: var(--c-text);
}
.field input:focus, .field textarea:focus,
input:focus, textarea:focus, select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
  outline: none;
}

/* Cards */
.product-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow .2s, transform .2s;
}
.product-card:hover { box-shadow: var(--shadow-hover); }
/* اگر اسکریپت قدیمی display:block بگذارد، کارت باز هم ستونی بماند */
.product-card[style*="display: block"], .product-card[style*="display:block"] { display: flex !important; }
.product-card .product-img-wrap {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f1efe8;
  position: relative;
  overflow: hidden;
}
.product-card .product-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .35s ease;
}
.product-card:hover .product-img { transform: scale(1.03); }
.product-card .card-body {
  padding: 1rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .35rem;
}
.product-card .card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}
.product-card .card-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding-top: .5rem;
}
.product-card .card-actions .btn { width: 100%; }

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  z-index: 60;
  background: #fff;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
  box-sizing: border-box;
}
/* spacer so content is not under fixed header */
body.has-fixed-header {
  padding-top: var(--header-h);
}
/* index/products own nav — same fixed treatment */
body > nav.sticky,
nav.sticky.top-0 {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  z-index: 60 !important;
  background: #fff !important;
  box-sizing: border-box;
}
body:has(> nav.sticky),
body:has(> nav.sticky.top-0) {
  padding-top: var(--header-h);
}
.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: .65rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: var(--header-h);
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  flex: 1;
}
.site-header__logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--c-primary);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(201,162,39,.35);
}
.site-header__logo img { width: 100%; height: 100%; object-fit: cover; }
.site-header__name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--c-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header__tag {
  font-size: .7rem;
  color: var(--c-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header__actions {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-shrink: 0;
}
.site-header__phone {
  display: none;
  align-items: center;
  gap: .4rem;
  min-height: var(--tap);
  padding: 0 .9rem;
  border-radius: 12px;
  background: var(--c-accent-soft);
  color: var(--c-primary);
  font-weight: 700;
  font-size: .85rem;
  direction: ltr;
}
.site-nav-desktop { display: none; }
.site-nav-mobile {
  display: none;
  border-top: 1px solid var(--c-border);
  background: #fff;
}
.site-nav-mobile.is-open { display: block; }
.site-nav-mobile a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: .85rem var(--pad);
  font-weight: 600;
  border-bottom: 1px solid #f1f5f9;
}
.site-nav-mobile a.is-active { color: var(--c-accent); background: var(--c-accent-soft); }
.cart-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--c-accent);
  color: #0f172a;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-badge.hidden { display: none !important; }

/* Sticky product action bar — mobile (full viewport width) */
.product-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  z-index: 55;
  background: #fff;
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -8px 24px rgba(15,23,42,.08);
  padding: .65rem max(12px, env(safe-area-inset-left, 0px)) calc(.65rem + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .5rem;
  box-sizing: border-box;
  transform: none;
}
.product-sticky-bar .psb-price {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
}
.product-sticky-bar .psb-price .label {
  font-size: .7rem;
  color: var(--c-muted);
  display: block;
}
.product-sticky-bar .psb-price .val {
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-sticky-bar .psb-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: 0 0 auto;
}
.product-sticky-bar .btn-call {
  width: var(--tap);
  min-width: var(--tap);
  height: var(--tap);
  padding: 0;
  background: var(--c-accent-soft);
  color: var(--c-primary);
  border-radius: 12px;
}
.product-sticky-bar .psb-main {
  flex-shrink: 0;
  min-height: var(--tap);
  padding-left: 1rem;
  padding-right: 1rem;
  white-space: nowrap;
  font-size: .9rem;
}
.product-inquiry-secondary {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  padding: .5rem;
  min-height: 40px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--c-muted);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.product-inquiry-secondary:hover { color: var(--c-primary); }
body.has-sticky-bar { padding-bottom: 88px; }

/* Trust row */
.trust-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}
.trust-item {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.trust-item i {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--c-accent-soft);
  color: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.trust-item strong { display: block; font-size: .95rem; margin-bottom: .15rem; }
.trust-item span { font-size: .8rem; color: var(--c-muted); line-height: 1.5; }

/* Steps (cart/checkout) */
.checkout-steps {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.checkout-steps span {
  flex: 1;
  min-width: 90px;
  text-align: center;
  padding: .55rem .4rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--c-border);
  color: var(--c-muted);
}
.checkout-steps span.is-active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.checkout-steps span.is-done {
  background: var(--c-accent-soft);
  border-color: var(--c-accent);
  color: var(--c-primary);
}

/* Summary box */
.order-summary {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.cart-qty-btn {
  width: var(--tap);
  height: var(--tap);
  border-radius: 12px;
  background: #f1f5f9;
  border: 0;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--c-primary);
}

/* Footer */
.site-footer {
  background: var(--c-primary);
  color: rgba(255,255,255,.78);
  padding: 2.5rem var(--pad) 1.5rem;
  margin-top: auto;
}
.site-footer a:hover { color: #fff; }
.site-footer__grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 1.75rem;
}
.site-footer__bottom {
  max-width: var(--max);
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .75rem;
  color: rgba(255,255,255,.45);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* Customers logos */
.customers-strip {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: .5rem 0;
  -webkit-overflow-scrolling: touch;
}
.customers-strip img {
  height: 56px;
  width: auto;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: .5rem .75rem;
  flex-shrink: 0;
}

/* Utility helpers used without Tailwind */
.container-site {
  width: 100%;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
.section-pad { padding-top: 2rem; padding-bottom: 2rem; }
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Soften old shimmer / gaudy bits on home when present */
.shimmer, .shimmer-brand {
  background: none !important;
  -webkit-text-fill-color: var(--c-primary) !important;
  color: var(--c-primary) !important;
  animation: none !important;
}

/* ========== Tablet ≥768px ========== */
@media (min-width: 768px) {
  :root { --pad: 24px; --header-h: 72px; }
  body { font-size: 16px; }
  .site-header__phone { display: inline-flex; }
  .site-header__name { font-size: 1.25rem; }
  .trust-row { grid-template-columns: repeat(3, 1fr); }
  .product-card .card-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .product-card .card-actions .btn { width: auto; flex: 1; }
  .site-footer__grid { grid-template-columns: 5fr 3fr 4fr; }
  .site-footer__bottom { flex-direction: row; justify-content: space-between; }
  .customers-strip { justify-content: center; flex-wrap: wrap; overflow: visible; }
}

/* ========== Desktop ≥1024px ========== */
@media (min-width: 1024px) {
  :root { --pad: 32px; }
  .site-nav-desktop {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    font-size: .9rem;
    font-weight: 600;
  }
  .site-nav-desktop a { color: #334155; transition: color .15s; }
  .site-nav-desktop a:hover,
  .site-nav-desktop a.is-active { color: var(--c-accent); }
  #mobileMenuBtn { display: none !important; }
  .site-nav-mobile { display: none !important; }
  .product-sticky-bar { display: none !important; }
  body.has-sticky-bar { padding-bottom: 0; }
  .product-card:hover { transform: translateY(-2px); }
}

/* Prevent horizontal scroll at 360 */
@media (max-width: 400px) {
  .site-header__tag { display: none; }
  .container-site, .site-header__inner { padding-left: 12px; padding-right: 12px; }
}

/* ===== Step UI: unified header sizing (all public pages) ===== */
.site-header__inner { min-height: 0; height: var(--header-h); padding-top: 0; padding-bottom: 0; }
.site-header__brand > .min-w-0 { min-width: 0; overflow: hidden; }
.site-header__name { line-height: 1.3; max-width: 100%; }
.site-header__tag { line-height: 1.3; }
@media (max-width: 400px) { .site-header__name { font-size: 1rem; } }

/* ===== Floating contact dock ===== */
.floating-dock {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity .2s ease, transform .2s ease;
}
.floating-dock.is-hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }
.floating-dock__btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  color: #fff; font-size: 1.25rem;
  box-shadow: 0 6px 16px rgba(15,23,42,.22);
  transition: transform .15s ease;
}
.floating-dock__btn:active { transform: scale(.94); }
.floating-dock__btn--ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.floating-dock__btn--wa { background: #10b981; }
.floating-dock__btn--tel { background: var(--c-primary, #0F172A); font-size: 1.05rem; }
/* never collide with product sticky buy bar */
body.has-sticky-bar .floating-dock { bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) {
  .floating-dock { left: 20px; bottom: 20px; gap: 10px; }
  .floating-dock__btn { width: 48px; height: 48px; font-size: 1.35rem; }
  .floating-dock__btn:hover { transform: translateY(-2px); }
}
@media (min-width: 1024px) { body.has-sticky-bar .floating-dock { bottom: 20px; } }
