@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
}

:root {
  --bg-deep: #101826;
  --bg-mid: #16233a;
  --bg-panel: rgba(255,255,255,0.055);
  --border-soft: rgba(255,255,255,0.10);
  --accent: #00d9b5;
  --accent-strong: #00c2a0;
  --accent-soft: rgba(0,217,181,0.16);
  --text-main: #eef3f9;
  --text-dim: #93a6bf;
  --text-dimmer: #6b7d97;
  --danger: #ff6b6b;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  direction: rtl;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(0,217,181,0.08), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(80,140,255,0.06), transparent 55%),
    linear-gradient(180deg, var(--bg-deep), var(--bg-mid));
  background-attachment: fixed;
  margin: 0;
  padding: 16px;
  min-height: 100vh;
  color: var(--text-main);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

/* ─── هدر ─── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 20px;
  padding: 12px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-sizing: border-box;
  backdrop-filter: blur(14px);
  position: sticky;
  top: 12px;
  z-index: 500;
  box-shadow: var(--shadow-soft);
}

/* ─── دکمه همبرگری ─── */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  padding: 0;
  order: -1;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.14); }
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-main);
}

/* ─── منوی کشویی همبرگری ─── */
.nav-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 1900;
}
.nav-overlay.active { display: block; }

.nav-drawer {
  position: fixed;
  top: 0; right: -320px;
  width: 100%; max-width: 300px; height: 100%;
  background: linear-gradient(180deg, #16233a, #101826);
  border-left: 1px solid var(--border-soft);
  z-index: 2000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(0,0,0,0.5);
}
.nav-drawer.open { right: 0; }

.nav-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border-soft);
}
.nav-drawer-header h3 { text-align: right; }

.nav-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  width: 100%;
  text-align: right;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  font-size: 14.5px;
  font-family: inherit;
}
.nav-item:hover { background: rgba(0,217,181,0.14); border-color: rgba(0,217,181,0.4); }

/* ─── بنر اصلی صفحه اول ─── */
.hero-banner {
  max-width: 1100px;
  margin: 0 auto 18px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px dashed var(--border-soft);
  box-shadow: var(--shadow-soft);
}
.hero-banner-placeholder {
  width: 100%;
  aspect-ratio: 21/9;
  background: linear-gradient(135deg, rgba(0,217,181,0.10), rgba(80,140,255,0.06));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-dim);
  text-align: center;
  padding: 20px;
}
.hero-banner-placeholder span { font-size: 16px; font-weight: 600; color: var(--text-main); }
.hero-banner-placeholder small { font-size: 12.5px; color: var(--text-dimmer); }

/* ─── دکمه‌های ناوبری صفحه اصلی (کاتالوگ/گالری) ─── */
.home-nav-box {
  max-width: 1100px;
  margin: 0 auto 14px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(0,217,181,0.16), rgba(255,255,255,0.05));
  border: 1px solid rgba(0,217,181,0.35);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  text-align: center;
  transition: 0.2s;
  box-shadow: var(--shadow-soft);
}
.home-nav-box:hover { transform: translateY(-2px); border-color: rgba(0,217,181,0.6); }
.home-nav-box h2 { color: #f2f7fb; font-size: 19px; }

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.header-logo img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

.header-logo h1 {
  font-size: 17px;
  margin: 0;
  text-align: right;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-soft);
  color: var(--text-main);
}

.icon-btn:hover { background: rgba(255,255,255,0.14); }

.cart-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: var(--accent);
  color: #06251f;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.call-btn, .whatsapp-btn {
  border: 1px solid var(--border-soft);
  padding: 10px 16px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: 0.2s;
}

.call-btn { background: rgba(80,160,255,0.14); color: #8fc3ff; }
.call-btn:hover { background: rgba(80,160,255,0.28); }
.whatsapp-btn { background: rgba(56,206,140,0.16); color: #7fe3b8; }
.whatsapp-btn:hover { background: rgba(56,206,140,0.3); }

/* ─── تایپوگرافی ─── */
h1, h2, h3 { color: var(--text-main); margin: 0; }
h3 { font-size: 19px; margin-bottom: 8px; text-align: center; }
p { text-align: right; font-size: 15px; color: var(--text-dim); line-height: 1.7; }
a { text-decoration: none; color: inherit; }

/* ─── باکس اطلاعات ─── */
.info-box {
  max-width: 1100px;
  margin: 0 auto 18px;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  padding: 22px;
  border-radius: var(--radius-lg);
  text-align: center;
  backdrop-filter: blur(12px);
}

.info-box h3 { color: #f2f7fb; font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.info-box p { margin: 6px 0; font-size: 14px; color: var(--text-dim); text-align: center; }

/* ─── دکمه پیش‌فرض ─── */
button {
  background: rgba(255,255,255,0.08);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(6px);
  cursor: pointer;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  transition: 0.2s;
}
button:hover { background: rgba(255,255,255,0.14); }

/* ─── دکمه کاتالوگ ─── */
#catalogBox {
  max-width: 1100px;
  margin: 0 auto 18px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(0,217,181,0.16), rgba(255,255,255,0.05));
  border: 1px solid rgba(0,217,181,0.35);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  text-align: center;
  transition: 0.2s;
  box-shadow: var(--shadow-soft);
}
#catalogBox:hover { transform: translateY(-2px); border-color: rgba(0,217,181,0.6); }
#catalogBox h2 { color: #f2f7fb; font-size: 19px; }

/* ─── کارت محصولات ─── */
#productList {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.product {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  backdrop-filter: blur(10px);
  padding: 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  animation: fadeIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product h3 { text-align: right; font-size: 16px; }
.product p { font-size: 13.5px; color: var(--text-dim); }

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

.add-to-cart-btn {
  margin-top: auto;
  width: 100%;
  background: var(--accent-soft);
  border: 1px solid rgba(0,217,181,0.4);
  color: var(--accent);
  font-weight: 600;
  padding: 10px;
  border-radius: var(--radius-sm);
}
.add-to-cart-btn:hover { background: rgba(0,217,181,0.3); }
.add-to-cart-btn.added { background: var(--accent); color: #06251f; }

.pkg-select {
  width: 100%;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
}

/* ─── لیست کامل بسته‌بندی‌ها با دکمه افزودن جدا ─── */
.pkg-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pkg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.pkg-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.pkg-row-label {
  font-size: 13.5px;
  color: var(--text-main);
}

.pkg-add-btn {
  flex-shrink: 0;
  background: var(--accent-soft);
  border: 1px solid rgba(0,217,181,0.4);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.pkg-add-btn:hover { background: rgba(0,217,181,0.3); }
.pkg-add-btn.added { background: var(--accent); color: #06251f; }
.pkg-add-btn.disabled,
.pkg-add-btn:disabled {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-soft);
  color: var(--text-dimmer);
  cursor: not-allowed;
}
.pkg-add-btn.disabled:hover,
.pkg-add-btn:disabled:hover { background: rgba(255,255,255,0.05); }

/* ─── دسته بندی‌ها ─── */
#categoryButtons {
  max-width: 1100px;
  margin: 0 auto 18px;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  padding: 4px 2px 10px;
  scrollbar-width: none;
}
#categoryButtons::-webkit-scrollbar { display: none; }

#categoryButtons button {
  flex-shrink: 0;
  padding: 11px 18px;
  font-size: 14.5px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* ─── گالری صفحه اصلی ─── */
.home-gallery {
  max-width: 1100px;
  margin: 0 auto 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.gallery-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.4s ease;
}
.gallery-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }

.gallery-img-wrap { width: 100%; aspect-ratio: 1/1; overflow: hidden; background: rgba(0,0,0,0.2); pointer-events: none; }
.gallery-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; pointer-events: none; }
.gallery-card:hover .gallery-img { transform: scale(1.06); }

.gallery-label { padding: 8px 8px 2px; font-size: 12.5px; font-weight: 700; color: #e6eef7; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gallery-cat { padding: 0 8px 10px; font-size: 11px; color: var(--accent); text-align: center; pointer-events: none; }

/* ─── پاپ‌آپ محصول ─── */
.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,10,18,0.72);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.popup-overlay.active { display: flex; }

.popup-box {
  background: linear-gradient(160deg, #1a2740, #101a2c);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px 20px 20px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  animation: popupIn 0.25s ease;
}

@keyframes popupIn {
  from { opacity: 0; transform: scale(0.94) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-close {
  position: absolute; top: 12px; left: 14px;
  background: rgba(255,255,255,0.08); border: none; color: #ccc;
  font-size: 17px; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.popup-close:hover { background: rgba(255,255,255,0.2); color: #fff; }

.goto-cat-btn {
  display: block; width: 100%; margin-top: 14px; padding: 12px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(0,217,181,0.4); border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 600;
}
.goto-cat-btn:hover { background: rgba(0,217,181,0.3); }

/* ─── سبد خرید (کشویی) ─── */
.cart-drawer {
  position: fixed;
  top: 0; left: -420px;
  width: 100%; max-width: 400px; height: 100%;
  background: linear-gradient(180deg, #16233a, #101826);
  border-left: 1px solid var(--border-soft);
  z-index: 2000;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 12px 0 40px rgba(0,0,0,0.5);
}
.cart-drawer.open { left: 0; }

.cart-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border-soft);
}
.cart-drawer-header h3 { text-align: right; }

.cart-drawer-items { flex: 1; overflow-y: auto; padding: 12px 16px; }

.cart-item {
  display: flex; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cart-item img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex: 1; text-align: right; }
.cart-item-info .name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.cart-item-info .pkg { font-size: 12px; color: var(--text-dimmer); }
.cart-item-qty { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.cart-item-qty button { width: 26px; height: 26px; padding: 0; border-radius: 6px; font-size: 14px; }
.cart-item-remove { color: var(--danger); font-size: 12px; margin-top: 6px; cursor: pointer; }

.cart-drawer-footer { padding: 16px 20px; border-top: 1px solid var(--border-soft); }
.cart-empty { text-align: center; color: var(--text-dimmer); padding: 40px 10px; font-size: 14px; }

.checkout-btn {
  width: 100%; padding: 14px; background: var(--accent); color: #06251f;
  font-weight: 700; font-size: 15px; border-radius: var(--radius-sm); border: none;
}
.checkout-btn:hover { background: var(--accent-strong); }

.cart-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 1900;
}
.cart-overlay.active { display: block; }

/* ─── دکمه بازگشت به بالا ─── */
.scroll-top-btn {
  position: fixed; bottom: 24px; right: 20px; left: auto;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); color: #06251f;
  border: none; font-size: 20px;
  box-shadow: 0 6px 20px rgba(0,217,181,0.35);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.2s;
  z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.scroll-top-btn:hover { transform: translateY(-3px); }

/* ─── صفحه تسویه حساب ─── */
.checkout-wrap { max-width: 640px; margin: 0 auto; }
.checkout-section {
  background: var(--bg-panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px;
  backdrop-filter: blur(10px);
}
.checkout-section h3 { text-align: right; margin-bottom: 14px; font-size: 16px; color: var(--accent); }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; text-align: right; font-size: 13.5px; color: var(--text-dim); margin-bottom: 6px; }
.form-row input, .form-row textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06); border: 1px solid var(--border-soft);
  color: var(--text-main); font-family: inherit; font-size: 14.5px;
}
.form-row textarea { min-height: 80px; resize: vertical; }

.checkout-line { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: var(--text-dim); border-bottom: 1px solid rgba(255,255,255,0.06); }
.checkout-line:last-child { border-bottom: none; }
.checkout-total { display: flex; justify-content: space-between; padding-top: 12px; font-size: 16px; font-weight: 700; color: var(--text-main); }

.submit-order-btn {
  width: 100%; padding: 15px; background: var(--accent); color: #06251f;
  font-weight: 700; font-size: 16px; border-radius: var(--radius-sm); border: none;
}
.submit-order-btn:hover { background: var(--accent-strong); }
.submit-order-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.shipping-options { display: flex; flex-direction: column; gap: 8px; }
.shipping-option {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; color: var(--text-main);
}
.shipping-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.shipping-option input { accent-color: var(--accent); width: 16px; height: 16px; }

.cards-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.card-item {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 14px; text-align: center;
}
.card-number {
  font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: 1px;
  direction: ltr; margin-bottom: 4px;
}
.card-holder { font-size: 13px; color: var(--text-dim); }

.order-success {
  text-align: center; padding: 40px 20px;
}
.order-success .check { font-size: 56px; color: var(--accent); margin-bottom: 12px; }

.field-error { color: var(--danger); font-size: 12.5px; margin-top: 4px; text-align: right; display: none; }
.form-row.invalid input, .form-row.invalid textarea { border-color: var(--danger); }
.form-row.invalid .field-error { display: block; }

/* ─── موبایل ─── */
@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 12px;
  }
  .header-logo { justify-content: center; flex-basis: 100%; }
  .header-logo h1 { font-size: 13.5px; }
  .header-logo img { width: 34px; height: 34px; }
  .header-buttons { flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
  .call-btn, .whatsapp-btn { padding: 9px 14px; font-size: 12.5px; }
  .icon-btn { width: 40px; height: 40px; font-size: 18px; }
  .home-gallery { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #productList { grid-template-columns: 1fr; }
  .cart-drawer { max-width: 100%; }
}
