:root {
  --cream: #F5E6D3;
  --cream-light: #FAF3EB;
  --cream-dark: #E8D5C0;
  --cream-deep: #D4BCA8;
  --rose: #C9A882;
  --rose-dark: #A8856A;
  --blush: #E8C4B8;
  --text: #3D2E24;
  --text-muted: #8B7355;
  --accent: #B8836A;
  --accent-light: #D4A574;
  --danger: #C45C5C;
  --success: #6B9E7A;
  --surface: rgba(255, 252, 248, 0.92);
  --surface2: #FFF9F3;
  --border: rgba(61, 46, 36, 0.1);
  --shadow: 0 8px 32px rgba(61, 46, 36, 0.1);
  --shadow-lg: 0 16px 48px rgba(61, 46, 36, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --nav-h: 68px;
  --topbar-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Vazirmatn", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--cream-light);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 80% 0%, rgba(232, 196, 184, 0.35), transparent),
    radial-gradient(ellipse 60% 40% at 10% 90%, rgba(201, 168, 130, 0.2), transparent),
    linear-gradient(180deg, var(--cream-light) 0%, var(--cream) 50%, var(--cream-light) 100%);
  pointer-events: none;
}

/* Splash */
.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(255, 252, 248, 0.9), transparent),
    linear-gradient(160deg, var(--cream) 0%, var(--cream-light) 100%);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-inner {
  text-align: center;
  padding: 0 24px;
}

.splash-brand {
  position: relative;
  width: min(260px, 72vw);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
}

.splash-brand img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transform: scale(0.9);
  animation: splashLogoIn 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.splash-brand::after {
  content: "";
  position: absolute;
  inset: -10% -30%;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(255, 255, 255, 0.65) 50%,
    transparent 62%
  );
  transform: translateX(-120%);
  animation: splashShine 1.4s ease 0.55s 1;
  pointer-events: none;
}

.splash-tagline {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  animation: splashTagIn 0.7s ease 0.65s forwards;
}

.splash-progress {
  width: min(180px, 46vw);
  height: 3px;
  margin-top: 32px;
  background: rgba(61, 46, 36, 0.1);
  border-radius: 99px;
  overflow: hidden;
}

.splash-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--accent-light));
  animation: splashProgress 0.85s ease 0.2s forwards;
}

@keyframes splashLogoIn {
  to { opacity: 1; transform: scale(1); }
}

@keyframes splashShine {
  to { transform: translateX(120%); }
}

@keyframes splashTagIn {
  to { opacity: 1; }
}

@keyframes splashProgress {
  to { width: 100%; }
}

/* App shell */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
}

.app.hidden { display: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 230, 211, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  min-height: var(--topbar-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.brand-logo {
  height: 58px;
  width: auto;
  max-width: 88px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  display: block;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blush), var(--accent));
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(184, 131, 106, 0.35);
}

.brand strong { display: block; font-size: 0.95rem; line-height: 1.2; }
.brand-text { min-width: 0; }
.brand small { color: var(--text-muted); font-size: 0.68rem; letter-spacing: 0.03em; }

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--surface);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  position: relative;
}

.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.hidden { display: none; }

.cart-count {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-count.hidden { display: none; }

.main {
  flex: 1;
  padding: 12px 16px calc(var(--nav-h) + var(--safe-b) + 16px);
  transition: opacity 0.15s;
}

.app.sub-page .main {
  padding-bottom: calc(var(--safe-b) + 24px);
}

.main.fade-out { opacity: 0; }
.main.fade-in { animation: fadeIn 0.28s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: rgba(255, 252, 248, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-b);
  z-index: 50;
  box-shadow: 0 -4px 24px rgba(61, 46, 36, 0.06);
}

.bottom-nav.hidden { display: none; }

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-item svg { width: 22px; height: 22px; }

.nav-item.active {
  color: var(--accent);
}

.nav-item.active svg { stroke: var(--accent); }

/* Sections */
.section { margin-bottom: 20px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 16px;
  line-height: 1.6;
}

.link-btn {
  border: none;
  background: none;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

/* Hero */
.hero-banner {
  background: linear-gradient(135deg, var(--blush) 0%, var(--cream-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.5);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.hero-text h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
}

.hero-text p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Slider */
.slider-track, .testimonial-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0 8px;
  margin: 0 -4px;
}

.slider-track::-webkit-scrollbar, .testimonial-track::-webkit-scrollbar { display: none; }

.slider-item {
  flex: 0 0 160px;
  scroll-snap-align: start;
}

/* Product card */
.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
}

.product-card:active { transform: scale(0.97); }

.product-card-img {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--cream-dark);
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-discount {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 8px;
}

.badge-hot {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 8px;
}

.product-card-body { padding: 10px 12px 12px; }

.product-brand {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.product-card h3 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price-row { display: flex; flex-direction: column; gap: 1px; }

.price-old {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}

.price-new {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

/* Category chips */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.cat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}

.cat-chip:active { transform: scale(0.96); }

.cat-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cat-color, var(--cream-dark));
  border-radius: 14px;
  font-size: 1.2rem;
}

/* Testimonials */
.testimonial-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.testimonial-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.testimonial-avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-dark);
  border-radius: 50%;
  font-size: 1.1rem;
}

.testimonial-top strong { font-size: 0.85rem; display: block; }

.stars { color: var(--accent-light); font-size: 0.75rem; letter-spacing: 1px; }

.testimonial-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Trust strip */
.trust-strip {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.trust-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.trust-item span { font-size: 1.2rem; }
.trust-item small { font-size: 0.65rem; color: var(--text-muted); text-align: center; }

/* Category list */
.category-list { display: flex; flex-direction: column; gap: 10px; }

.category-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  text-align: right;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}

.category-row:active { transform: scale(0.98); }

.category-row-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.category-row-info { flex: 1; text-align: right; }
.category-row-info strong { display: block; font-size: 0.95rem; }
.category-row-info small { color: var(--text-muted); font-size: 0.78rem; }

.category-row svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

/* Category detail */
.cat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, var(--cat-color, var(--cream)), var(--surface));
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.cat-header-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.6);
  border-radius: 16px;
  font-size: 1.6rem;
}

.cat-header h2 { margin: 0; font-size: 1.1rem; }
.cat-header small { color: var(--text-muted); }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.search-bar svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

.search-bar input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
}

.filter-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 99px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}

.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Product detail */
.product-detail { margin: -12px -16px 0; }

.gallery {
  position: relative;
  background: var(--cream-dark);
  aspect-ratio: 1;
  overflow: hidden;
}

.gallery-track { width: 100%; height: 100%; position: relative; }

.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-slide.active { opacity: 1; }

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 0;
}

.gallery-dot.active { background: #fff; width: 20px; border-radius: 4px; }

.product-info { padding: 20px 16px; }

.product-info h1 {
  margin: 6px 0 14px;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
}

.price-block { margin-bottom: 14px; }

.price-old-lg {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--danger);
  display: block;
  margin-bottom: 2px;
}

.price-new-lg {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}

.discount-tag {
  display: inline-block;
  margin-top: 6px;
  background: rgba(196, 92, 92, 0.12);
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 8px;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.feature-tag {
  font-size: 0.72rem;
  padding: 5px 10px;
  background: var(--cream-dark);
  border-radius: 8px;
  color: var(--text-muted);
}

.desc-block {
  margin-bottom: 20px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.desc-block h4 { margin: 0 0 8px; font-size: 0.85rem; }
.desc-block p { margin: 0; font-size: 0.85rem; line-height: 1.7; color: var(--text-muted); }

.qty-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.qty-block > span { font-weight: 600; font-size: 0.9rem; }

.qty-selector {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-selector--sm { scale: 0.9; }

.qty-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--cream-dark);
  font-size: 1.2rem;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
}

.qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.qty-selector span {
  min-width: 36px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--rose-dark));
  color: #fff;
  box-shadow: 0 6px 20px rgba(184, 131, 106, 0.35);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-block { width: 100%; }
.btn-lg { padding: 15px 20px; font-size: 0.95rem; border-radius: var(--radius); }
.btn-sm { padding: 8px 14px; font-size: 0.78rem; }

/* Cart */
.cart-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.cart-item img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-info strong {
  display: block;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-info small { color: var(--text-muted); font-size: 0.72rem; }

.checkout-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.checkout-trust {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(232,196,184,0.3), rgba(245,230,211,0.5));
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.checkout-trust-icon { font-size: 1.5rem; flex-shrink: 0; }

.checkout-trust p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.6;
}

.checkout-rows { margin-bottom: 14px; }

.checkout-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.88rem;
  border-bottom: 1px dashed var(--border);
}

.checkout-row:last-child { border-bottom: none; }

.checkout-row.highlight {
  background: rgba(184, 131, 106, 0.08);
  margin: 0 -8px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border-bottom: none;
}

.text-accent { color: var(--accent); }

.delivery-note {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: var(--cream-light);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.delivery-note span { font-size: 1.2rem; flex-shrink: 0; }
.delivery-note p { margin: 0; }

/* Success */
.success-page { text-align: center; padding: 20px 0; }

.success-icon { font-size: 3rem; margin-bottom: 12px; }

.success-page h2 { margin: 0 0 8px; }

.success-page > p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0 0 20px;
}

.tracking-box {
  background: var(--surface);
  border: 2px dashed var(--accent-light);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.tracking-box small { color: var(--text-muted); display: block; margin-bottom: 6px; }

.tracking-box code {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  word-break: break-all;
}

/* Profile */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blush), var(--accent));
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.profile-header h2 { margin: 0; font-size: 1.1rem; }
.profile-header small { color: var(--text-muted); }

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 8px;
}

.card-head h3 { margin: 0; font-size: 0.95rem; }

.tracking-code-sm {
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--cream-light);
  padding: 4px 8px;
  border-radius: 6px;
}

/* Progress bar */
.progress-wrap { margin-bottom: 12px; }

.progress-bar {
  height: 4px;
  background: var(--cream-dark);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blush));
  border-radius: 99px;
  transition: width 0.5s ease;
}

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.45;
  transition: opacity 0.3s;
}

.progress-step.done { opacity: 1; }
.progress-step.current .step-dot { background: var(--accent); color: #fff; }

.step-dot {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-dark);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.progress-step small { font-size: 0.78rem; line-height: 1.3; }

.order-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  font-size: 0.85rem;
}

.order-history { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.order-row {
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.order-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.order-row-top code { font-size: 0.72rem; color: var(--accent); }

.order-status {
  font-size: 0.7rem;
  padding: 3px 8px;
  background: var(--cream-dark);
  border-radius: 6px;
  white-space: nowrap;
}

.order-row-items {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}

.order-row-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.help-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  text-align: right;
  box-shadow: var(--shadow);
}

.help-link-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-dark);
  border-radius: 14px;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.help-link-card strong { display: block; font-size: 0.9rem; color: var(--text); }
.help-link-card small { color: var(--text-muted); font-size: 0.75rem; }
.help-link-card svg { width: 18px; color: var(--text-muted); flex-shrink: 0; margin-right: auto; }

/* Help page */
.help-hero {
  text-align: center;
  padding: 20px;
  margin-bottom: 20px;
}

.help-hero span { font-size: 2.5rem; display: block; margin-bottom: 8px; }
.help-hero h2 { margin: 0 0 6px; }
.help-hero p { margin: 0; color: var(--text-muted); font-size: 0.88rem; }

.help-steps {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.help-steps h3 { margin: 0 0 14px; font-size: 0.95rem; }

.help-steps ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.85rem;
  line-height: 1.7;
}

.help-step-body {
  flex: 1;
  min-width: 0;
}

.help-steps li span {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.help-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.help-card h3 { margin: 0 0 14px; font-size: 0.95rem; }

.timeline { display: flex; flex-direction: column; gap: 14px; }

.timeline-item {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
}

.timeline-item span { font-size: 1.3rem; flex-shrink: 0; }
.timeline-item strong { display: block; margin-bottom: 2px; }
.timeline-item p { margin: 0; color: var(--text-muted); font-size: 0.8rem; line-height: 1.5; }

.support-btn { margin-top: 8px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state.compact { padding: 32px 16px; }

.empty-state .icon { font-size: 2.5rem; margin-bottom: 12px; }

.empty-state h4 { margin: 0 0 8px; }

.empty-state p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0 0 16px;
}

.empty-state.hidden { display: none; }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: rgba(61, 46, 36, 0.92);
  color: #fff;
  padding: 12px 20px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 500;
  max-width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}

.toast.hidden { display: none; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (min-width: 481px) {
  .app { box-shadow: var(--shadow-lg); }
}

/* ── Admin panel ── */
.admin-page .admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-page .admin-header h2 { margin: 0; font-size: 1.15rem; }

.admin-badge {
  font-size: 0.68rem;
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  border-radius: 99px;
  font-weight: 600;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.admin-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}

.admin-stat.wide { grid-column: 1 / -1; }

.admin-stat span {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
}

.admin-stat small { color: var(--text-muted); font-size: 0.68rem; }

.admin-toolbar { margin-bottom: 14px; }

.admin-order-list { display: flex; flex-direction: column; gap: 10px; }

.admin-order-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
}

.admin-order-row.clickable { cursor: pointer; transition: transform 0.15s; }
.admin-order-row.clickable:active { transform: scale(0.98); }

.admin-order-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.admin-order-row-top code { font-size: 0.72rem; color: var(--accent); }

.admin-order-row-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.admin-order-row-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.order-status.delivered { background: rgba(107, 158, 122, 0.15); color: var(--success); }

.admin-customer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-subtitle {
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.admin-items { display: flex; flex-direction: column; gap: 10px; }

.admin-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.admin-item img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}

.admin-item div { flex: 1; min-width: 0; }
.admin-item strong { display: block; font-size: 0.82rem; }
.admin-item small { color: var(--text-muted); }

.admin-stage-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-stage-btn {
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  text-align: right;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s;
}

.admin-stage-btn.done { border-color: rgba(107, 158, 122, 0.35); }
.admin-stage-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--rose-dark));
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

#admin-advance-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.bottom-nav .nav-item.hidden { display: none; }

/* Telegram-only block */
.tg-blocked {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--cream) 0%, var(--cream-light) 100%);
}

.tg-blocked.hidden { display: none; }

.tg-blocked-inner {
  max-width: 360px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow-lg);
}

.tg-blocked-logo {
  width: min(180px, 55vw);
  height: auto;
  display: block;
  margin: 0 auto 16px;
}

.tg-blocked-icon { font-size: 3rem; display: block; margin-bottom: 12px; }

.tg-blocked-inner h1 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.tg-blocked-inner p {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ── Admin tabs ── */
.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
}

.admin-tab.active {
  background: rgba(107, 158, 122, 0.12);
  border-color: rgba(107, 158, 122, 0.4);
  color: var(--accent);
}

/* ── Admin product management ── */
.glass-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.glass-panel h4 { margin: 0 0 12px; font-size: 0.9rem; }

.pick-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input, .textarea, select.input {
  width: 100%;
  background: var(--cream-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 0.88rem;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.textarea { resize: vertical; min-height: 80px; }

.input:focus, .textarea:focus, select.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107, 158, 122, 0.15);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  margin-bottom: 8px;
  cursor: pointer;
}

.admin-ad-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-products-toolbar { margin-bottom: 14px; }

.product-admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}

.product-admin-card.inactive { opacity: 0.65; }

.product-admin-card-top {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.product-admin-preview {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--cream-light);
  border: 1px solid var(--border);
}

.product-admin-preview img {
  width: 100%;
  height: 100%;
  display: block;
}

.product-admin-meta { flex: 1; min-width: 0; }

.product-admin-meta h4 {
  margin: 0 0 4px;
  font-size: 0.88rem;
  line-height: 1.35;
}

.product-admin-meta p {
  margin: 0 0 3px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.product-admin-price { color: var(--accent) !important; font-weight: 700; }

.product-admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.product-admin-actions .btn { flex: 1; min-width: 0; }

.ad-upload-hint {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.ad-upload-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}

.ad-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.ad-file-name {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-align: center;
}

.img-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.img-preview-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cream-light);
  aspect-ratio: 1;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}

.img-preview-wrap.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}

.img-preview-wrap.empty::after {
  content: "پیش‌نمایش تصویر";
  color: var(--text-muted);
  font-size: 0.82rem;
}

.img-preview-wrap.empty .img-preview-img { display: none; }

.img-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}

.img-fit-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
}

.img-fit-controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.gallery-slide {
  overflow: hidden;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
