/* ============================================================
   Shadino24 — نسخه اول (Static Prototype)
   CSS3 خام — mobile-first، RTL، بدون وابستگی خارجی
   پالت محدود: Primary (سبز-آبی) + Accent (کهربایی) + خنثی
   ============================================================ */

/* --- D1/T002: متغیرها، ریست، فونت سیستمی فارسی (research.md D2) --- */
:root {
  --primary: #0f766e;        /* Primary — سبزآبی مطمئن */
  --primary-dark: #0b5d56;
  --accent: #f59e0b;         /* Accent — کهربایی برای CTA ثانویه */
  --surface: #ffffff;
  --bg: #f6f8f7;
  --text: #1f2a2e;
  --text-muted: #5b6b70;
  --border: #e2e8e7;
  --error: #dc2626;
  --success: #16a34a;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
  --container: 1080px;
  --header-h: 64px;
  --font: "Vazirmatn", "Tahoma", "IRANSansWeb", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl; /* T002 / FR-015 */
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  /* T021: جلوگیری از اسکرول افقی */
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

/* T025: فوکوس مشخص برای دسترس‌پذیری */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.section {
  padding-block: 48px;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.section-sub {
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* آنکرهای داخلی با ارتفاع هدر (offset برای smooth-scroll — T013) */
section[id],
nav[id],
footer {
  scroll-margin-top: calc(var(--header-h) + 8px);
}

/* --- Header (T007/T013) --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary-dark);
}

.logo .logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.9rem;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.main-nav ul {
  display: flex;
  gap: 4px;
}

.main-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.main-nav a:hover,
.main-nav a:focus-visible {
  background: var(--bg);
  color: var(--primary-dark);
}

/* منوی موبایل: مخفی تا باز شود */
.main-nav {
  position: absolute;
  inset-inline: 0;
  top: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: none;
}

.site-header.nav-open .main-nav {
  display: block;
}

.main-nav ul {
  flex-direction: column;
  padding: 8px 16px 16px;
}

/* --- Hero (T011) --- */
.hero {
  background:
    radial-gradient(1000px 400px at 90% -10%, rgba(245, 158, 11, 0.18), transparent 60%),
    linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding-block: 64px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.5rem, 4.5vw, 2.4rem);
  line-height: 1.5;
  margin-bottom: 12px;
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  opacity: 0.92;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: 28px;
}

.hero-highlight {
  color: var(--accent);
  font-weight: 700;
}

/* --- دکمه‌ها / CTA --- */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 26px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-cta {
  background: var(--accent);
  color: #3b2600;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.btn-cta:hover {
  background: #d97706;
  color: #fff;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}

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

.btn-ghost {
  background: transparent;
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
  padding: 9px 18px;
  font-size: 0.92rem;
  border-radius: 999px;
}

.btn-ghost:hover {
  background: var(--primary);
  color: #fff;
}

/* --- کارت‌ها: خدمات و محصولات (T019) --- */
.cards-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.card-icon {
  width: 56px;
  height: 56px;
}

.card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg);
}

.card h3 {
  font-size: 1.1rem;
}

.card .desc {
  color: var(--text-muted);
  font-size: 0.93rem;
  flex-grow: 1;
}

.card .price {
  font-weight: 800;
  color: var(--primary-dark);
  font-size: 1.05rem;
}

.card .badge {
  align-self: flex-start;
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary-dark);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
}

/* --- T028/T033: اتمام موجودی و «تماس بگیرید» --- */
.card-unavailable .card-img,
.card-unavailable .card-icon {
  filter: grayscale(1);
  opacity: 0.6;
}

.card .badge-warn {
  background: rgba(220, 38, 38, 0.12);
  color: var(--error);
  font-weight: 700;
}

.card .price-contact {
  color: #b45309;
}

.card .contact-link {
  align-self: flex-start;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary-dark);
  text-decoration: underline;
  padding: 9px 18px;
  border: 1.5px dashed var(--primary);
  border-radius: 999px;
}

.card .contact-link:hover,
.card .contact-link:focus-visible {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost:disabled:hover {
  background: transparent;
  color: var(--primary-dark);
}

/* --- T035: فهرست دسته‌بندی‌ها (FR-001) --- */
.category-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-block: 12px;
}

.category-bar .container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.category-bar-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.category-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap; /* در ۳۶۰px بدون اسکرول افقی (V12/21) */
}

.chip {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.chip[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}

/* --- فرم درخواست چاپ (T012/T020) --- */
.request-wrap {
  max-width: 640px;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.93rem;
  margin-bottom: 6px;
}

.field .hint {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--error);
}

.error {
  display: block;
  color: var(--error);
  font-size: 0.85rem;
  min-height: 1.1em;
  margin-top: 4px;
}

.estimate {
  background: var(--bg);
  border: 1px dashed var(--primary);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.estimate strong {
  color: var(--primary-dark);
  font-size: 1.1rem;
}

.form-success {
  margin-top: 14px;
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid var(--success);
  color: #14532d;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
}

.form-success[hidden] {
  display: none;
}

/* --- چطور کار می‌کند؟ (T007) --- */
.steps {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  counter-reset: step;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  padding-inline-start: 68px;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  inset-inline-start: 16px;
  top: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.step h3 {
  font-size: 1.02rem;
  margin-bottom: 4px;
  color: var(--primary-dark);
}

.step p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* --- Footer (T007) --- */
.site-footer {
  background: #12312e;
  color: #d7e5e3;
  padding-block: 36px 24px;
  margin-top: 24px;
}

.footer-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  margin-bottom: 20px;
}

.site-footer h4 {
  color: #fff;
  margin-bottom: 8px;
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 14px;
  font-size: 0.85rem;
  text-align: center;
  color: #9dbdb9;
}

/* --- Breakpoints (T021: mobile-first) --- */
@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .section-title {
    font-size: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .steps {
    grid-template-columns: repeat(4, 1fr);
  }

  /* منوی دسکتاپ: همیشه افقی */
  .nav-toggle {
    display: none;
  }

  .main-nav {
    position: static;
    display: block !important;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .main-nav ul {
    flex-direction: row;
    padding: 0;
    gap: 2px;
  }

  .request-wrap {
    padding: 32px;
  }
}
