/* ====== Color System (brand) ====== */
:root {
  --primary: #ff2d55; /* قرمز روح‌دار */
  --primary-light: #ff4757; /* قرمز روشن‌تر */
  --primary-dark: #e63946; /* قرمز تیره‌تر */
  --accent: #ff6b35; /* نارنجی روشن */
  --accent-light: #ff8a65; /* نارنجی روشن‌تر */
  --success: #00e676; /* سبز نئونی */
  --ink: #0c0f14; /* deep text */
  --muted: #6b7280; /* secondary text */
  --bg: linear-gradient(135deg, #fef3e7 0%, #fdf2e9 25%, #fef7ed 50%, #fef3c7 75%, #fef2f2 100%); /* گرادیانت پاییزی */
  --bg-muted: rgba(255, 255, 255, 0.8); /* بخش‌ها با شفافیت */
  --bg-soft: rgba(255, 255, 255, 0.9); /* بخش‌های نرم */
  --border: #e5e7eb; /* soft border */
  --border-light: #f1f3f4; /* lighter border */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-1: 0 8px 24px rgba(2, 6, 23, 0.06);
  --shadow-2: 0 12px 32px rgba(2, 6, 23, 0.08);
  --shadow-soft: 0 4px 16px rgba(25, 191, 211, 0.1);
  --gradient-primary: linear-gradient(135deg, #ff2d55, #ff4757);
  --gradient-accent: linear-gradient(135deg, #ff6b35, #ff8a65);
  --gradient-soft: linear-gradient(135deg, #f6f7f9, #ffffff);
  --ring: 0 0 0 3px rgba(25, 191, 211, 0.25);
}

/* ====== Base ====== */
html,
body {
  margin: 0;
  background: linear-gradient(135deg, 
    #fef3e7 0%, 
    #fdf2e9 25%, 
    #fef7ed 50%, 
    #fef3c7 75%, 
    #fef2f2 100%
  );
  background-attachment: fixed;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    "Vazirmatn", "IRANSans", Arial;
  scroll-behavior: smooth;
  transition: all 0.3s ease;
}

/* حذف خط زیر همه لینک‌ها در حالت hover */
a:hover {
  text-decoration: none !important;
}

a:focus {
  text-decoration: none !important;
}

/* ====== Global Animations ====== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-scale {
  animation: fadeInScale 0.5s ease-out;
}
/* ====== Modern Product Cards ====== */
.product-card {
  background: var(--gradient-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
  border-radius: var(--radius-lg);
}

.product-card:hover::before {
  opacity: 0.05;
}

.product-card:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow: 0 25px 50px -12px rgba(25, 191, 211, 0.25);
  border-color: var(--primary);
}

.product-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  margin: 8px;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-md);
}

.product-card:hover .product-image img {
  transform: scale(1.15) rotate(2deg);
}

.product-info {
  padding: 16px;
  position: relative;
  z-index: 2;
}

.product-title {
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px 0;
  font-size: 16px;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.product-card:hover .product-title {
  color: var(--primary-dark);
}

.product-price {
  font-weight: 700;
  color: var(--accent);
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-price-old {
  text-decoration: line-through;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.product-discount {
  background: var(--gradient-accent);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}
/* ====== Modern Buttons & Interactive Elements ====== */
.btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(25, 191, 211, 0.4);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--gradient-soft);
  color: var(--ink);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--gradient-primary);
  color: white;
  border-color: var(--primary);
}

.btn-accent {
  background: var(--gradient-accent);
}

.btn-accent:hover {
  box-shadow: 0 10px 25px rgba(255, 83, 51, 0.4);
}

/* ====== Form Elements ====== */
.form-input {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  transition: all 0.3s ease;
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
  transform: translateY(-1px);
}

.form-input::placeholder {
  color: var(--muted);
}
img {
  display: block;
  max-width: 100%;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 16px;
}
.section {
  padding: 28px 0;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-weight: 800;
  font-size: 20px;
}
.section-sub {
  color: var(--muted);
  font-size: 14px;
}
.section-actions a {
  font-size: 14px;
  color: var(--primary);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
}

/* ====== Hero Slider ====== */
.viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16/6; /* نسبت تصویر */
  min-height: 320px; /* تضمین ارتفاع روی مرورگرهای قدیمی */
}

.hero {
  background: var(--bg-muted, #f6f7f9);
  padding: 20px 0;
}

/* اضافه کن / جایگزین کن */
.slider {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.06);
  background: #000;
}

.slides {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease;
  will-change: transform;
}
.slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 32px;
  color: #fff;
}

.bg-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.15));
}
.slide-content {
  position: relative;
  z-index: 2;
  max-width: 560px;
}
.slide h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.4;
}
.slide p {
  margin: 0 0 16px;
  color: #eef7fb;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent, #ff5333);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.08);
}

/* کنترل‌ها و دات‌ها */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D2691E, #DAA520);
  box-shadow: 0 8px 24px rgba(210, 105, 30, 0.3);
  border: 0;
  font-size: 24px;
  line-height: 44px;
  text-align: center;
  color: #ffffff;
  transition: all 0.3s ease;
}
.nav-btn:hover {
  background: linear-gradient(135deg, #A0522D, #B8860B);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 12px 30px rgba(139, 69, 19, 0.5);
}
.nav-prev {
  right: 12px;
}
.nav-next {
  left: 12px;
}
.dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 3;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(210, 105, 30, 0.4);
  transition: all 0.3s ease;
}
.dot.is-active {
  background: #D2691E;
  transform: scale(1.2);
}

/* demo slide backgrounds (no external images) */
.bg-1 {
  background: radial-gradient(
      1200px 420px at 85% -10%,
      rgba(255, 255, 255, 0.35),
      transparent
    ),
    linear-gradient(45deg, #14a1b3, #19bfd3);
}
.bg-2 {
  background: radial-gradient(
      1000px 420px at 10% -10%,
      rgba(255, 255, 255, 0.35),
      transparent
    ),
    linear-gradient(45deg, #ff6a49, #ff5333);
}
.bg-3 {
  background: radial-gradient(
      1200px 420px at 85% 110%,
      rgba(255, 255, 255, 0.25),
      transparent
    ),
    linear-gradient(45deg, #5fb15f, #66b766);
}

/* ====== Discounted Products ====== */
.products {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) {
  .products {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 900px) {
  .products {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 640px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
  }
}
.product {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
}
.product .media {
  aspect-ratio: 1/1;
  background: var(--bg-muted);
  display: grid;
  place-items: center;
}
.product .media .ph {
  width: 54%;
  height: 54%;
  border-radius: 12px;
  background: linear-gradient(135deg, #eaeef3, #f6f7f9);
}
.product .info {
  padding: 12px;
}
.product .title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 6px;
}
.product .meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.product .price {
  display: flex;
  align-items: center;
  gap: 8px;
}
.price-now {
  font-weight: 800;
}
.price-old {
  color: var(--muted);
  text-decoration: line-through;
}
.off {
  margin-inline-start: auto;
  background: rgba(255, 83, 51, 0.1);
  color: #b82107;
  border: 1px solid rgba(255, 83, 51, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.card-actions {
  padding: 0 12px 12px;
  margin-top: auto;
}
.btn-add {
  width: 100%;
  background: var(--primary);
  color: #fff;
  padding: 10px;
  border-radius: 10px;
  font-weight: 700;
}
.btn-add:hover {
  filter: brightness(1.04);
}

/* ====== Festivals ====== */
.festivals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1000px) {
  .festivals {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 720px) {
  .festivals {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 460px) {
  .festivals {
    grid-template-columns: 1fr;
  }
}
.festival {
  position: relative;
  isolation: isolate;
  min-height: 140px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}
.festival .bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    35deg,
    rgba(25, 191, 211, 0.12),
    rgba(102, 183, 102, 0.15)
  );
}
.festival .paint {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px 140px at 85% 120%,
    rgba(255, 83, 51, 0.18),
    transparent
  );
}
.festival .inner {
  position: relative;
  z-index: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}
.festival .name {
  font-weight: 800;
}
.festival .desc {
  color: var(--muted);
  font-size: 13px;
}
.festival .cta {
  margin-top: auto;
  align-self: flex-start;
}

/* ====== Utilities ====== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ====== Sellers (Latest) ====== */
.sellers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) {
  .sellers {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 900px) {
  .sellers {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 640px) {
  .sellers {
    grid-template-columns: repeat(2, 1fr);
  }
}
.seller {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.seller-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.seller .logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef2f7, #f8fafc);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--muted);
}
.seller .name {
  font-weight: 800;
}
.seller .meta {
  color: var(--muted);
  font-size: 12px;
}
.seller .rating {
  margin-inline-start: auto;
  font-size: 12px;
}
.seller-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
}
.btn-outline {
  flex: 1;
  border: 1px solid var(--primary);
  color: var(--primary);
  background: #fff;
  padding: 9px;
  border-radius: 10px;
  font-weight: 700;
}
.btn-outline:hover {
  background: rgba(25, 191, 211, 0.08);
}

/* ====== One-Row CTA (Seller/Buyer) ====== */
.cta-row {
  padding: 32px 0;
}
.cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 740px) {
  .cta-grid {
    grid-template-columns: 1fr;
  }
}
.cta-card {
  position: relative;
  min-height: 140px;
  border-radius: 20px;
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.6s;
}

.cta-card:hover::before {
  left: 100%;
}

.cta-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}
.cta-card .title {
  font-size: 26px;
  font-weight: 900;
  margin: 0;
}
.cta-card .desc {
  opacity: 0.95;
  margin-top: 6px;
}
.cta-card svg {
  opacity: 0.95;
}
.cta-card.is-seller {
  background: linear-gradient(135deg, #f97316, #fb923c, #fbbf24);
}

.cta-card.is-seller:hover {
  background: linear-gradient(135deg, #ea580c, #f97316, #fb923c);
}

.cta-card.is-buyer {
  background: linear-gradient(135deg, #60a5fa, #3b82f6, #6366f1);
}

.cta-card.is-buyer:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb, #4f46e5);
}

/* ====== About Section ====== */
.about {
  background: var(--bg-muted);
  padding: 32px 0;
}
.about .prose {
  line-height: 1.9;
}
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
@media (max-width: 900px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .features {
    grid-template-columns: 1fr;
  }
}
.feature {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.feature strong {
  display: block;
  margin-bottom: 6px;
}

/* ====== Extra mobile-friendly tweaks ====== */
.festival img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product .media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Medium screens */
@media (max-width: 780px) {
  .viewport {
    aspect-ratio: 16/9;
    min-height: 280px;
  }
  .slide {
    padding: 24px;
  }
  .slide-content {
    max-width: 100%;
  }
  .slide h2 {
    font-size: clamp(20px, 4.4vw, 26px);
  }
  .slide p {
    font-size: clamp(13px, 3.3vw, 15px);
  }
}

/* Small screens */
@media (max-width: 560px) {
  .container {
    padding-inline: 12px;
  }
  .section {
    padding: 22px 0;
  }
  .nav-btn {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
  .dots {
    bottom: 8px;
  }
  .cta {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .viewport {
    min-height: 220px;
  }
  .slide {
    padding: 16px;
  }
  .section-title {
    font-size: 18px;
  }
  .section-sub {
    font-size: 12px;
  }
  .products,
  .sellers {
    grid-template-columns: 1fr;
  }
  .cta-card .title {
    font-size: clamp(18px, 6vw, 22px);
  }
  .cta-card svg {
    width: 56px;
    height: 56px;
  }
}

/* Ultra small screens */
@media (max-width: 320px) {
  .nav-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  .dot {
    width: 7px;
    height: 7px;
  }
  .btn-add {
    padding: 8px;
    border-radius: 8px;
    font-size: 13px;
  }
  .festival {
    min-height: 120px;
  }
  .seller {
    padding: 12px;
  }
}

/* Page-specific adjustments moved from inline style */
.section[aria-labelledby="festivalsTitle"] {
  background: var(--bg-muted);
}
