@font-face {
  font-family: 'ShopFont';
  src: url('../fonts/Vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ShopFont, Tahoma, Arial, sans-serif;
  direction: rtl;
  background: #f6f7fb;
  color: #111827;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1180px, calc(100% - 28px)); margin: 0 auto; }
.topbar { background: #111827; color: #fff; font-size: 13px; padding: 9px 0; }
.header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner { display: flex; align-items: center; gap: 18px; padding: 16px 0; }
.logo { font-size: 24px; font-weight: 900; color: #0f766e; white-space: nowrap; }
.search { flex: 1; }
.search input {
  width: 100%;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  border-radius: 14px;
  padding: 13px 16px;
  font-family: inherit;
}
.cart-link {
  background: #0f766e;
  color: #fff;
  padding: 11px 15px;
  border-radius: 14px;
  font-weight: 800;
}
.nav { background: #fff; border-bottom: 1px solid #e5e7eb; }
.nav-inner { display: flex; gap: 18px; overflow-x: auto; padding: 12px 0; font-weight: 700; color: #374151; }
.hero { padding: 30px 0; }
.hero-box {
  background: linear-gradient(135deg, #0f766e, #064e3b);
  color: #fff;
  border-radius: 28px;
  padding: 44px;
  min-height: 250px;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 20px;
  align-items: center;
  overflow: hidden;
}
.hero h1 { margin: 0 0 14px; font-size: clamp(28px, 5vw, 54px); line-height: 1.25; }
.hero p { margin: 0 0 24px; color: #d1fae5; font-size: 17px; }
.btn {
  border: 0;
  background: #f59e0b;
  color: #111827;
  padding: 12px 18px;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  display: inline-block;
}
.section { padding: 24px 0; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-title h2 { margin: 0; font-size: 24px; }
.grid { display: grid; gap: 16px; }
.category-grid { grid-template-columns: repeat(4, 1fr); }
.product-grid { grid-template-columns: repeat(4, 1fr); }
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
}
.category-card { min-height: 100px; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #0f766e; }
.product-card { position: relative; }
.product-image {
  background: #f3f4f6;
  border-radius: 18px;
  aspect-ratio: 1.15 / .9;
  object-fit: cover;
  margin-bottom: 14px;
}
.product-title { font-size: 15px; font-weight: 900; line-height: 1.8; min-height: 54px; }
.product-price { display: flex; gap: 8px; align-items: center; margin: 10px 0 14px; flex-wrap: wrap; }
.price { color: #0f766e; font-weight: 900; }
.old-price { color: #9ca3af; text-decoration: line-through; font-size: 13px; }
.badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}
.footer {
  margin-top: 40px;
  background: #111827;
  color: #d1d5db;
  padding: 36px 0;
}
.footer h3 { color: #fff; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 24px; }
.form-control {
  width: 100%;
  border: 1px solid #d1d5db;
  padding: 13px 14px;
  border-radius: 14px;
  font-family: inherit;
  margin-bottom: 12px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
}
.table th, .table td { border-bottom: 1px solid #e5e7eb; padding: 14px; text-align: right; }
.empty { background: #fff; border: 1px dashed #cbd5e1; border-radius: 20px; padding: 30px; text-align: center; color: #64748b; }
.muted-text { color: #64748b; }

/* Product page gallery */
.product-detail-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 26px;
  align-items: start;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
}
.product-media {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.product-main-image-box {
  background: #f3f4f6;
  border-radius: 22px;
  padding: 14px;
  width: 100%;
  overflow: hidden;
}
.product-main-image {
  width: 100% !important;
  height: 420px !important;
  object-fit: contain !important;
  border-radius: 18px;
  background: #f8fafc;
}
.product-gallery {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 10px;
  margin-top: 12px;
}
.product-gallery-thumb {
  display: block;
  width: 100%;
  height: 82px;
  padding: 5px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}
.product-gallery-thumb.active {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}
.product-gallery-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 10px;
}
.product-description {
  line-height: 2.1;
  overflow-x: auto;
}
.product-description h1,
.product-description h2,
.product-description h3,
.product-description h4 {
  margin-top: 18px;
}
.product-description table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  background: #fff;
}
.product-description th,
.product-description td {
  border: 1px solid #d1d5db;
  padding: 10px;
  vertical-align: middle;
}
.product-description a {
  color: #0f766e;
  font-weight: 800;
}
.product-description blockquote {
  border-right: 4px solid #0f766e;
  margin: 14px 0;
  padding: 10px 14px;
  background: #f0fdfa;
  border-radius: 12px;
}
.product-description img {
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  margin: 14px auto;
}
.product-description video {
  display: block;
  width: 100%;
  max-width: 860px;
  border-radius: 18px;
  margin: 16px auto;
  background: #111827;
}
.product-description iframe {
  display: block;
  width: 100%;
  max-width: 860px;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 18px;
  margin: 16px auto;
  background: #111827;
}
.product-description .embed-box {
  width: 100%;
  max-width: 860px;
  margin: 16px auto;
}
.product-description .embed-box iframe {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  .hero-box { grid-template-columns: 1fr; padding: 28px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .product-detail-card { grid-template-columns: 1fr; }
  .product-main-image { height: 320px !important; }
  .product-gallery { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
}
@media (max-width: 520px) {
  .product-grid { grid-template-columns: 1fr; }
  .product-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .product-gallery-thumb { height: 78px; }
}
