/* ==========================================================
   سیسمونی نی‌نی ماه - استایل اصلی
   پالت: آبی‌های زنده و شاداب
   ========================================================== */
:root {
  --primary: #1a8cff;
  --primary-600: #0a6fe0;
  --primary-700: #0757b8;
  --sky: #26c6ff;
  --blue-50: #eef7ff;
  --blue-100: #d9ecff;
  --blue-200: #b0d6ff;
  --bg: #f4f9ff;
  --card: #ffffff;
  --ink: #0b1b33;
  --muted: #4a5b78;
  --line: #dbe7f5;
  --danger: #e5384f;
  --ok: #0f9d58;
  --radius: 16px;
  --shadow-sm: 0 2px 10px rgba(26, 140, 255, 0.10);
  --shadow-md: 0 12px 30px rgba(26, 140, 255, 0.18);
  --header-h: 82px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 5000;
  background: var(--primary-700); color: #fff; padding: 8px 14px; border-radius: 10px; text-decoration: none;
}
.skip-link:focus { top: 10px; }

.container { max-width: 1220px; margin: 0 auto; padding: 0 20px; }
section { padding: 64px 0; scroll-margin-top: 90px; }
#top, #categories, #about, #contact { scroll-margin-top: 90px; }

/* ---------- افکت محو شدن هنگام اسکرول (با جاوااسکریپت کنترل می‌شود) ---------- */
.fx { will-change: opacity; }

/* ---------- هدر ---------- */
header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background .3s, box-shadow .3s;
}
header.scrolled {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 26px rgba(10, 111, 224, 0.14);
}
.nav-wrapper { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 16px; padding-block: 8px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
/* لوگو: هرگز برش نمی‌خورد (object-fit: contain) و نسبت تصویر حفظ می‌شود */
.logo-box {
  display: inline-flex; align-items: center; justify-content: center;
  height: 64px; min-width: 64px; max-width: 160px; padding: 4px;
  background: #fff; border: 2px solid var(--blue-200); border-radius: 14px; flex-shrink: 0;
}
.logo-box img { height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.brand-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-title strong { font-size: 1.2rem; font-weight: 800; color: var(--primary-700); }
.brand-title small { font-size: .76rem; color: var(--muted); }

.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; transition: color .2s; }
.nav-links a:hover { color: var(--primary); }
.header-actions { display: flex; gap: 10px; }

/* ---------- دکمه‌ها ---------- */
.btn {
  border: none; border-radius: 12px; padding: 10px 18px; font-size: .9rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: .82rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(135deg, var(--sky), var(--primary) 45%, var(--primary-600)); color: #fff; box-shadow: 0 5px 14px rgba(26, 140, 255, .38); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(26, 140, 255, .5); }
.btn-soft { background: var(--blue-100); color: var(--primary-700); }
.btn-soft:hover { background: var(--blue-200); }
.btn-dark { background: #0b1b33; color: #5fd4ff; }
.btn-dark:hover { background: #14294d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.mt { margin-top: 8px; }
.link-btn { background: none; border: none; color: inherit; cursor: pointer; padding: 0; text-align: start; }
.link-btn:hover { color: #fff; }

/* ---------- هیرو ---------- */
.hero { padding: 64px 0 48px; background: radial-gradient(circle at top right, var(--blue-100) 0%, var(--bg) 62%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; }
.hero-badge { display: inline-block; background: var(--blue-100); color: var(--primary-700); padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 700; margin-bottom: 16px; }
.hero h2 { font-size: 2.4rem; font-weight: 800; line-height: 1.35; margin-bottom: 16px; }
.hero h2 em { font-style: normal; color: var(--primary); }
.hero p { color: var(--muted); font-size: 1.05rem; margin-bottom: 28px; max-width: 540px; }
.search-bar { display: flex; background: #fff; padding: 6px; border-radius: 14px; box-shadow: var(--shadow-md); border: 1px solid var(--line); max-width: 480px; }
.search-bar input { flex: 1; min-width: 0; border: none; outline: none; padding: 10px 14px; font-size: .95rem; background: transparent; }
.search-bar:focus-within { border-color: var(--primary); }

.hero-visual { background: linear-gradient(145deg, var(--sky), var(--primary) 50%, var(--primary-700)); border-radius: 28px; padding: 24px; color: #fff; box-shadow: var(--shadow-md); text-align: center; }
.hero-logo { background: rgba(255, 255, 255, .92); border-radius: 20px; padding: 16px; display: flex; align-items: center; justify-content: center; height: 300px; }
.hero-logo img { max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.hero-visual p { margin: 14px 0 0; color: #fff; font-weight: 700; font-size: 1rem; }

/* ---------- دسته‌بندی و محصولات ---------- */
.section-header { text-align: center; margin-bottom: 32px; }
.section-header h3 { font-size: 1.85rem; font-weight: 800; margin-bottom: 6px; }
.section-header p { color: var(--muted); }
.category-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 32px; }
.cat-btn {
  padding: 10px 22px; border-radius: 999px; border: 2px solid var(--blue-100); background: #fff;
  font-weight: 700; cursor: pointer; transition: all .2s;
}
.cat-btn:hover, .cat-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 5px 14px rgba(26, 140, 255, .3); }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 24px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 30px 0; }
.product-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s; }
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.product-img { position: relative; height: 210px; background: var(--blue-50); overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-tag { position: absolute; top: 12px; inset-inline-start: 12px; background: rgba(10, 111, 224, .92); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 8px; }
.product-body { padding: 18px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.product-title { font-size: 1.04rem; font-weight: 700; margin-bottom: 4px; }
.product-desc { font-size: .86rem; color: var(--muted); }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.product-price { font-weight: 800; color: var(--primary-600); font-size: .98rem; }

/* ---------- درباره ما + اسلایدر ---------- */
.about-section { background: #fff; border-block: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.about-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 14px; }
.about-text { color: var(--muted); margin-bottom: 16px; }
.checks { list-style: none; display: grid; gap: 10px; font-weight: 600; }
.checks li::before { content: '✔'; color: var(--primary); margin-inline-end: 8px; }

.slider { position: relative; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-md); height: 360px; background: var(--blue-100); touch-action: pan-y; }
.slides-track { display: flex; height: 100%; transition: transform .7s cubic-bezier(.25, .8, .25, 1); }
.slide { min-width: 100%; height: 100%; position: relative; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-caption { position: absolute; inset-inline: 0; bottom: 0; padding: 40px 20px 34px; color: #fff; font-weight: 600; background: linear-gradient(transparent, rgba(7, 30, 70, .82)); }
.slider-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 40px; height: 40px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--primary-700); font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.slider-btn:hover { background: #fff; }
.slider-btn.next { left: 12px; }
.slider-btn.prev { right: 12px; }
.slider-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 7px; z-index: 5; }
.dot { width: 10px; height: 10px; border-radius: 99px; border: none; background: rgba(255, 255, 255, .6); cursor: pointer; transition: all .3s; padding: 0; }
.dot.active { background: var(--sky); width: 26px; }

/* ---------- فوتر ---------- */
footer { background: #0b1b33; color: #c6d4ea; padding: 48px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; margin-bottom: 30px; }
footer h4 { color: #fff; margin-bottom: 12px; }
footer p, .footer-list { font-size: .9rem; }
.footer-list { list-style: none; display: grid; gap: 8px; }
footer a { color: inherit; text-decoration: none; }
footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1c3157; padding-top: 18px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-size: .85rem; }
.creator-credit { color: #5fd4ff; font-weight: 600; direction: ltr; unicode-bidi: plaintext; }

/* ---------- مودال ---------- */
.modal { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(7, 20, 45, .66); backdrop-filter: blur(4px); }
.modal.open { display: flex; }
.modal-card { position: relative; background: #fff; width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto; border-radius: 20px; padding: 28px; box-shadow: 0 24px 50px rgba(0, 0, 0, .28); }
.modal-card.wide { max-width: 860px; }
.modal-card h3 { margin-bottom: 6px; padding-inline-end: 40px; }
.modal-close { position: absolute; top: 16px; inset-inline-end: 16px; width: 34px; height: 34px; border: none; border-radius: 50%; background: var(--blue-50); cursor: pointer; }
.modal-close:hover { background: var(--blue-100); }
.hint { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }

.field { margin-bottom: 14px; }
.field.grow { flex: 1; margin-bottom: 0; }
.field label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 6px; }
.field input:not([type=file]), .field select, .field textarea, .inline-form input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .92rem; background: #fff; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .inline-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 140, 255, .15); }
.field input[type=file] { margin-top: 6px; font-size: .8rem; max-width: 100%; }
.otp-input { text-align: center; letter-spacing: 10px; font-weight: 800; font-size: 1.3rem !important; }

.alert { padding: 10px 12px; border-radius: 10px; font-size: .85rem; margin-bottom: 14px; }
.alert-info { background: var(--blue-100); color: var(--primary-700); }
.alert-danger { background: #ffe3e7; color: #a3162b; }
.alert-success { background: #dcf7e8; color: #0a6b3a; }

.account-box { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 0 22px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--blue-100); display: grid; place-items: center; font-size: 1.9rem; }

/* ---------- پنل مدیریت ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 18px; }
.tab { border: 2px solid var(--blue-100); background: #fff; border-radius: 999px; padding: 7px 16px; font-weight: 700; cursor: pointer; font-size: .88rem; }
.tab.active, .tab:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.card-form { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 20px; }
.card-form h4 { margin: 10px 0; }
.card-form h4:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.preview-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.list-title { margin: 6px 0 10px; }
.inline-form { display: flex; gap: 8px; }
.icon-input { width: 70px !important; text-align: center; flex: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fff; }
.row-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.row-main > div { min-width: 0; }
.row-main strong { display: block; overflow-wrap: anywhere; }
.row small { color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: var(--blue-50); flex-shrink: 0; }
.thumb.lg { width: 96px; height: 72px; }
.row input.cat-input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.row input.cat-icon { width: 60px; text-align: center; }
.row input.cat-name { flex: 1; min-width: 120px; }
.steps { padding-inline-start: 22px; margin-bottom: 14px; display: grid; gap: 4px; }
.steps code, .hint code { background: var(--blue-100); padding: 1px 6px; border-radius: 6px; font-size: .8rem; direction: ltr; unicode-bidi: plaintext; }
.file-btn { cursor: pointer; }
.file-btn input { display: none; }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 20px; inset-inline: 0; z-index: 3000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { pointer-events: auto; background: #0b1b33; color: #fff; padding: 10px 18px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .28); font-size: .9rem; max-width: 460px; }
.toast-success { background: var(--ok); }
.toast-danger { background: var(--danger); }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 860px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; }
  .hero h2 { font-size: 1.9rem; }
  .nav-wrapper { flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; gap: 18px; padding-bottom: 4px; white-space: nowrap; }
  .form-grid { grid-template-columns: 1fr; }
  .slider { height: 280px; }
  .hero-logo { height: 220px; }
  section { padding: 48px 0; }
}
@media (max-width: 520px) {
  .brand-title small { display: none; }
  .header-actions .btn { padding: 8px 12px; font-size: .82rem; }
  .modal-card { padding: 22px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
