/* ==================================================================
   فروشگاه زرنت — فهرست محصولات، صفحه محصول، سبد خرید
   (رنگ‌ها از متغیرهای style.css)
=================================================================== */

/* --- اجزای عمومی --- */
.zn-icon { width: 22px; height: 22px; flex: none; }
.zn-btn--sm { min-height: 38px; min-width: 0; padding: 4px 14px; font-size: 14px; }
.zn-btn--ghost { background: transparent; color: var(--zn-gold); border: 1px solid var(--zn-gold-mid); }
.zn-btn--ghost:hover { background: rgba(207,173,63,.08); }
.zn-btn.is-disabled, .zn-btn:disabled { opacity: .5; cursor: not-allowed; filter: none; transform: none; }
.zn-btn.is-added { animation: zn-pop .5s ease; }
@keyframes zn-pop { 40% { transform: scale(1.06); } }

.zn-price { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; font-weight: 700; }
.zn-price small { font-size: .75em; font-weight: 400; color: var(--zn-soft); }

.zn-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--zn-soft); }
.zn-crumbs a:hover { color: var(--zn-gold); }

.zn-link-more { display: inline-flex; align-items: center; gap: 6px; color: var(--zn-gold); font-weight: 600; font-size: 15px; }
.zn-link-more img { width: 22px; height: 22px; filter: invert(72%) sepia(43%) saturate(560%) hue-rotate(5deg) brightness(92%); }

.zn-alert {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 20px;
  background: rgba(207,173,63,.12); border: 1px solid var(--zn-gold-mid); color: var(--zn-white);
}

.zn-empty {
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  padding: 70px 20px; border: 1px dashed var(--zn-grey); border-radius: 20px;
}
.zn-empty h1, .zn-empty h2 { font-size: 24px; font-weight: 600; }
.zn-empty p { color: var(--zn-soft); max-width: 460px; }
.zn-empty .zn-icon { width: 54px; height: 54px; color: var(--zn-gold); }
.zn-empty__debug { font-size: 12px; direction: ltr; opacity: .7; }
.zn-empty__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* --- هدر: سبد خرید --- */
.zn-header__actions { display: flex; align-items: center; gap: 14px; }
.zn-header__cart {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 45px; height: 45px; border-radius: 5px;
  border: 1px solid var(--zn-gold-mid); color: var(--zn-gold);
}
.zn-header__cart:hover { background: rgba(207,173,63,.1); opacity: 1; }
.zn-header__badge {
  position: absolute; top: -7px; left: -7px; min-width: 20px; height: 20px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--zn-gold-grad); color: var(--zn-primary);
  font-size: 11px; font-weight: 700; line-height: 1;
}
.zn-header__badge[hidden] { display: none; }

/* --- سربرگ فروشگاه --- */
.zn-shop__hero {
  padding: 50px 100px 40px; display: flex; flex-direction: column; gap: 14px;
  background: radial-gradient(120% 140% at 85% 0%, rgba(207,173,63,.14) 0%, rgba(10,55,34,0) 55%);
}
.zn-shop__title { font-size: 34px; font-weight: 600; }
.zn-shop__lead { color: var(--zn-soft); max-width: 640px; }
.zn-shop__body { padding: 40px 100px 80px; display: flex; flex-direction: column; gap: 24px; }
.zn-shop__count { color: var(--zn-soft); font-size: 14px; }

/* قیمت لحظه‌ای */
/* نوار افقی قابل اسکرول — API ممکن است ده‌ها نرخ برگرداند */
.zn-rates {
  display: flex; gap: 12px; margin-top: 10px; max-width: 100%;
  overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px;
  scrollbar-width: thin; scrollbar-color: var(--zn-gold-mid) transparent;
}
.zn-rate {
  flex: none; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 2px; min-width: 170px;
  padding: 10px 16px; border-radius: 10px;
  background: rgba(5,28,17,.6); border: 1px solid rgba(170,142,51,.45);
}
.zn-rate__name { font-size: 13px; color: var(--zn-soft); }
.zn-rate__price { font-size: 18px; color: var(--zn-gold); }
.zn-rate__time { font-size: 11px; color: var(--zn-grey); }

/* نوار ابزار */
.zn-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 12px; border-radius: 12px; background: var(--zn-primary); border: 1px solid #1d3f2d;
}
.zn-toolbar__search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; height: 42px; border-radius: 8px; background: var(--zn-bg); color: var(--zn-soft);
}
.zn-toolbar__search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none;
  color: var(--zn-white); font-size: 15px;
}
.zn-toolbar__search input::placeholder { color: var(--zn-grey); }
.zn-select {
  height: 42px; padding: 0 12px 0 34px; border-radius: 8px; border: 1px solid #1d3f2d;
  background: var(--zn-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23CFAD3F' stroke-width='1.6'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat left 12px center;
  color: var(--zn-white); font-family: inherit; font-size: 14px; appearance: none; cursor: pointer;
}

.zn-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.zn-chip {
  padding: 5px 14px; border-radius: 20px; font-size: 14px;
  border: 1px solid var(--zn-grey); color: var(--zn-soft);
}
.zn-chip:hover { border-color: var(--zn-gold-mid); color: var(--zn-white); opacity: 1; }
.zn-chip.is-active { background: var(--zn-gold-grad); border-color: transparent; color: var(--zn-primary); font-weight: 600; }

/* --- شبکه و کارت محصول --- */
.zn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.zn-pcard {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--zn-green); border-radius: 16px; border: 1px solid rgba(255,255,255,.04);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.zn-pcard:hover { transform: translateY(-3px); border-color: rgba(207,173,63,.5); box-shadow: 0 16px 30px rgba(0,0,0,.25); }
.zn-pcard__media { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--zn-soft); overflow: hidden; }
.zn-pcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.zn-pcard:hover .zn-pcard__media img { transform: scale(1.04); }
.zn-pcard__tag {
  position: absolute; top: 10px; right: 10px; padding: 3px 10px; border-radius: 6px;
  background: var(--zn-black); border: 1px solid var(--zn-gold-mid); color: var(--zn-gold);
  font-size: 12px; font-weight: 600;
}
.zn-pcard__tag--out { right: auto; left: 10px; background: #5b1d1d; border-color: #8a3a3a; color: #ffd6d6; }
.zn-pcard.is-out .zn-pcard__media img { filter: grayscale(.7); opacity: .7; }
.zn-pcard__body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; }
.zn-pcard__meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.zn-pcard__cat { color: var(--zn-soft); }
.zn-pcard__cat:hover { color: var(--zn-gold); }
.zn-pcard__rating { display: inline-flex; align-items: center; gap: 4px; color: var(--zn-gold); font-weight: 600; }
.zn-pcard__rating img { width: 14px; height: 14px; }
.zn-pcard__title { font-size: 16px; font-weight: 600; line-height: 1.6; }
.zn-pcard__title a:hover { color: var(--zn-gold); opacity: 1; }
.zn-pcard__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.zn-pcard__price { display: flex; align-items: baseline; gap: 4px; font-size: 16px; color: var(--zn-white); }
.zn-pcard__from { font-size: 12px; color: var(--zn-soft); }
.zn-pcard .zn-btn--sm .zn-icon { width: 18px; height: 18px; }

/* صفحه‌بندی */
.zn-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.zn-pager a, .zn-pager span {
  min-width: 40px; height: 40px; padding: 0 8px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--zn-grey); font-weight: 600;
}
.zn-pager a:hover { border-color: var(--zn-gold); color: var(--zn-gold); opacity: 1; }
.zn-pager .is-current { background: var(--zn-gold-grad); border-color: transparent; color: var(--zn-primary); }
.zn-pager .zn-pager__gap { border: 0; min-width: 20px; }

/* بخش محصولات صفحه اصلی / مشابه */
.zn-products-sec { padding: 80px 100px; display: flex; flex-direction: column; gap: 30px; }
.zn-products-sec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.zn-products-sec__head > div { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.zn-products-sec .zn-rates { margin-top: -10px; }

/* --- صفحه محصول --- */
.zn-single__top { padding: 30px 100px 60px; display: flex; flex-direction: column; gap: 24px; }
.zn-single__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 50px; align-items: start; }

.zn-gallery { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 20px; }
.zn-gallery__main { aspect-ratio: 1 / 1; border-radius: 20px; overflow: hidden; background: var(--zn-soft); border: 1px solid var(--zn-gold-mid); }
.zn-gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.zn-gallery__thumbs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.zn-gallery__thumbs button {
  flex: none; width: 76px; height: 76px; padding: 0; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; background: var(--zn-soft); cursor: pointer; opacity: .7;
}
.zn-gallery__thumbs button.is-active, .zn-gallery__thumbs button:hover { border-color: var(--zn-gold); opacity: 1; }
.zn-gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.zn-buybox { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.zn-single__title { font-size: 30px; font-weight: 600; line-height: 1.5; }
.zn-single__rating { display: inline-flex; align-items: center; gap: 6px; color: var(--zn-gold); font-weight: 600; }
.zn-single__rating img { width: 18px; height: 18px; }
.zn-single__rating small { color: var(--zn-soft); font-weight: 400; }

.zn-specs { display: flex; flex-direction: column; width: 100%; }
.zn-specs li { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid rgba(97,116,107,.4); }
.zn-specs li span { color: var(--zn-soft); }
.zn-specs--short li { padding: 6px 0; font-size: 14px; }

.zn-variants { border: 0; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.zn-variants legend { font-weight: 600; margin-bottom: 8px; }
.zn-variant {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--zn-grey); cursor: pointer; transition: border-color .2s ease, background .2s ease;
}
.zn-variant:hover { border-color: var(--zn-gold-mid); }
.zn-variant:has(input:checked) { border-color: var(--zn-gold); background: rgba(207,173,63,.08); }
.zn-variant input { accent-color: var(--zn-gold); width: 18px; height: 18px; margin: 0; }
.zn-variant__label { flex: 1; }
.zn-variant__price { font-size: 14px; }
.zn-variant.is-out { opacity: .5; cursor: not-allowed; }

.zn-buybox__price { display: flex; flex-direction: column; gap: 2px; }
.zn-buybox__price > span { font-size: 13px; color: var(--zn-soft); }
.zn-buybox__price .zn-price { font-size: 28px; color: var(--zn-gold); }
.zn-buybox__actions { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }
.zn-buybox__add { flex: 1; min-width: 220px; }
.zn-buybox__stock { font-size: 13px; color: var(--zn-soft); }
.zn-buybox__out { padding: 12px 16px; border-radius: 10px; background: rgba(91,29,29,.5); color: #ffd6d6; width: 100%; }

.zn-qty {
  display: inline-flex; align-items: center; height: 45px; border-radius: 5px;
  border: 1px solid var(--zn-grey); overflow: hidden;
}
.zn-qty button {
  width: 42px; height: 100%; border: 0; background: transparent; color: var(--zn-white);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px;
}
.zn-qty button:hover:not(:disabled) { background: rgba(255,255,255,.06); color: var(--zn-gold); }
.zn-qty button .zn-icon { width: 18px; height: 18px; }
.zn-qty input {
  width: 48px; height: 100%; border: 0; background: transparent; color: var(--zn-white);
  text-align: center; font-size: 16px; font-weight: 600; -moz-appearance: textfield; appearance: textfield;
}
.zn-qty input::-webkit-outer-spin-button, .zn-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.zn-qty--sm { height: 38px; }
.zn-qty--sm button { width: 34px; }
.zn-qty--sm input { width: 40px; font-size: 14px; }

.zn-plans { width: 100%; padding: 16px; border-radius: 14px; background: var(--zn-primary); border: 1px solid #1d3f2d; display: flex; flex-direction: column; gap: 12px; }
.zn-plans__head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.zn-plans__head img { width: 26px; height: 26px; }
.zn-plans__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.zn-plans__table th { text-align: right; font-weight: 400; color: var(--zn-soft); padding: 6px 4px; border-bottom: 1px solid #1d3f2d; }
.zn-plans__table td { padding: 8px 4px; border-bottom: 1px solid rgba(29,63,45,.6); }
.zn-plans__table td small { color: var(--zn-soft); margin-inline-start: 4px; }
.zn-plans__note { font-size: 12px; color: var(--zn-grey); }

.zn-perks { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--zn-soft); }
.zn-perks li { display: flex; align-items: center; gap: 6px; }
.zn-perks img { width: 22px; height: 22px; }

.zn-single__details { padding: 60px 100px; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 50px; }
.zn-single__details h2, .zn-single__reviews h2 { font-size: 22px; font-weight: 600; margin-bottom: 16px; }
.zn-single__desc .entry-content { color: var(--zn-soft); }
.zn-single__desc .entry-content p { margin-bottom: 1em; }
.zn-single__reviews { padding: 60px 100px; }
.zn-comments { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.zn-comments .zn-review { justify-content: flex-start; gap: 12px; }
.zn-review__date { font-size: 12px; color: var(--zn-grey); }
.zn-single__reviews-note { margin-top: 16px; font-size: 13px; color: var(--zn-soft); }

/* --- سبد خرید --- */
.zn-cart__loading { padding: 40px; text-align: center; color: var(--zn-soft); }
.zn-cart__layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 30px; align-items: start; }
.zn-cart__layout[hidden], .zn-empty[hidden], .zn-cart__loading[hidden] { display: none; }
.zn-cart__items { display: flex; flex-direction: column; gap: 12px; }
.zn-citem {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto 150px 32px; align-items: center; gap: 16px;
  padding: 12px; border-radius: 14px; background: var(--zn-green);
}
.zn-citem.is-out { opacity: .65; }
.zn-citem__img { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--zn-soft); }
.zn-citem__img img { width: 100%; height: 100%; object-fit: cover; }
.zn-citem__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.zn-citem__name { font-weight: 600; }
.zn-citem__name:hover { color: var(--zn-gold); opacity: 1; }
.zn-citem__label, .zn-citem__unit { font-size: 13px; color: var(--zn-soft); }
.zn-citem__warn { font-size: 13px; color: #ffb4b4; }
.zn-citem__total { text-align: left; color: var(--zn-gold); }
.zn-citem__remove {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--zn-grey);
  background: transparent; color: var(--zn-soft); font-size: 20px; line-height: 1; cursor: pointer;
}
.zn-citem__remove:hover { border-color: #c96a6a; color: #ffb4b4; }

.zn-summary {
  position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px;
  padding: 22px; border-radius: 16px; background: var(--zn-primary); border: 1px solid var(--zn-gold-mid);
}
.zn-summary h2 { font-size: 20px; font-weight: 600; }
.zn-summary dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.zn-summary dl > div { display: flex; justify-content: space-between; gap: 10px; }
.zn-summary dt { color: var(--zn-soft); }
.zn-summary dd { margin: 0; font-weight: 600; }
.zn-summary__total { padding-top: 12px; border-top: 1px solid #1d3f2d; }
.zn-summary__total dd .zn-price { font-size: 20px; color: var(--zn-gold); }
.zn-summary__note { font-size: 12px; color: var(--zn-grey); }
.zn-summary__checkout { width: 100%; }
.zn-summary .zn-link-more { align-self: center; font-size: 14px; }

/* پیام افزودن به سبد */
.zn-toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 100;
  display: flex; align-items: center; gap: 16px; padding: 12px 18px; border-radius: 12px;
  background: var(--zn-soft); color: var(--zn-primary); font-weight: 600;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  transform: translate(-50%, 140%); opacity: 0; transition: transform .3s ease, opacity .3s ease;
}
.zn-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.zn-toast a { padding: 4px 12px; border-radius: 6px; background: var(--zn-gold-grad); color: var(--zn-primary); white-space: nowrap; }

/* --- واکنش‌گرایی --- */
@media (max-width: 1250px) {
  .zn-shop__hero, .zn-shop__body, .zn-products-sec, .zn-single__top, .zn-single__details, .zn-single__reviews { padding-inline: 40px; }
}

@media (max-width: 1024px) {
  .zn-single__grid, .zn-single__details { grid-template-columns: 1fr; gap: 30px; }
  .zn-gallery { position: static; }
  .zn-cart__layout { grid-template-columns: 1fr; }
  .zn-summary { position: static; }
}

@media (max-width: 768px) {
  .zn-shop__hero, .zn-shop__body, .zn-products-sec, .zn-single__top, .zn-single__details, .zn-single__reviews { padding-inline: 20px; }
  .zn-shop__hero { padding-top: 30px; }
  .zn-shop__title { font-size: 26px; }
  .zn-single__title { font-size: 24px; }
  .zn-products-sec { padding-block: 50px; }
  .zn-products-sec__head { flex-direction: column; align-items: flex-start; }
  .zn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .zn-pcard__body { padding: 10px 12px 12px; }
  .zn-pcard__title { font-size: 14px; }
  .zn-pcard__foot { flex-direction: column; align-items: stretch; }
  .zn-pcard__foot .zn-btn { width: 100%; }
  .zn-toolbar__search { flex-basis: 100%; }
  .zn-select { flex: 1; }
  .zn-rate { min-width: 150px; }
  .zn-header__actions { gap: 8px; }
  .zn-header__cart { width: 38px; height: 38px; }
  .zn-citem { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img info rm" "img qty total"; gap: 8px 12px; }
  .zn-citem__img { grid-area: img; width: 64px; height: 64px; }
  .zn-citem__info { grid-area: info; }
  .zn-citem .zn-qty { grid-area: qty; justify-self: start; }
  .zn-citem__total { grid-area: total; justify-self: end; }
  .zn-citem__remove { grid-area: rm; justify-self: end; }
  .zn-toast { width: calc(100% - 32px); justify-content: space-between; }
}

@media (max-width: 340px) {
  .zn-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .zn-pcard, .zn-pcard__media img, .zn-toast, .zn-btn { transition: none; animation: none; }
}
