/* ============================================
   SINGLE PRODUCT PAGE — RTL / PERSIAN
   Prefix: .aitp-
   ============================================ */

:root {
  --aitp-bg: #f5f5f5;
  --aitp-surface: #ffffff;
  --aitp-ink: #111111;
  --aitp-muted: #6b7280;
  --aitp-muted-2: #9ca3af;
  --aitp-line: rgba(0,0,0,0.06);
  --aitp-line-dash: #e5e7eb;
  --aitp-primary: #1e2a78;
  --aitp-primary-2: #2a3a8c;
  --aitp-primary-soft: rgba(30,42,120,0.08);
  --aitp-accent: #22c55e;
  --aitp-accent-2: #15803d;
  --aitp-discount: #f97316;
  --aitp-radius: 20px;
  --aitp-radius-sm: 12px;
  --aitp-shadow-1: 0 1px 2px rgba(16,24,40,.04);
  --aitp-shadow-2: 0 18px 40px -14px rgba(16,24,40,.14);
  --aitp-font: var(--itoll-font-family, 'Tahoma', system-ui, sans-serif);
}

/* ============================================
   BREADCRUMB STRIP
   ============================================ */
.aitp-crumbs {
  background: #fff;
  border-bottom: 1px solid var(--aitp-line);
  padding: 16px 24px;
}
.aitp-crumbs__wrap {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--aitp-muted);
  font-weight: 500;
  flex-wrap: nowrap;
  overflow: hidden;
}
.aitp-crumbs a { color: var(--aitp-muted); text-decoration: none; transition: color .2s; white-space: nowrap; flex-shrink: 0; }
.aitp-crumbs a:hover { color: var(--aitp-primary); }
.aitp-crumbs .sep { color: var(--aitp-muted-2); font-size: 12px; flex-shrink: 0; }
.aitp-crumbs__current {
  color: var(--aitp-ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ============================================
   PRODUCT HERO
   ============================================ */
.aitp-hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: start;
}

/* Gallery */
.aitp-gallery { display: grid; grid-template-columns: 76px 1fr; gap: 14px; }
.aitp-gallery__thumbs { display: flex; flex-direction: column; gap: 10px; }
.aitp-thumb {
  width: 76px; height: 76px;
  border-radius: 12px;
  background: var(--aitp-surface);
  border: 1.5px solid var(--aitp-line);
  padding: 8px; cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .2s, transform .2s;
}
.aitp-thumb:hover { border-color: var(--aitp-primary); }
.aitp-thumb--active {
  border-color: var(--aitp-primary);
  box-shadow: 0 0 0 3px rgba(30,42,120,0.08);
}
.aitp-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }

.aitp-main-img {
  position: relative;
  background: var(--aitp-surface);
  border: 1px solid var(--aitp-line);
  border-radius: var(--aitp-radius);
  padding: 32px;
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  overflow: hidden;
}
.aitp-main-img::before {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(34,197,94,0.08), rgba(34,197,94,0) 70%);
  z-index: 0;
}
.aitp-main-img img {
  position: relative; z-index: 1;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(16,24,40,0.18));
}
.aitp-sale-badge {
  position: absolute; top: 18px; right: 18px;
  background: linear-gradient(135deg, #ff8c3b 0%, #ea580c 100%);
  color: #fff; font-size: 12px; font-weight: 800;
  letter-spacing: 0.04em; padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 8px 18px -4px rgba(234,88,12,0.45);
  z-index: 2;
}
.aitp-zoom-hint {
  position: absolute; bottom: 14px; left: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--aitp-muted);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  padding: 6px 12px; border-radius: 999px; z-index: 2;
}
.aitp-zoom-hint svg { width: 13px; height: 13px; }

/* Info panel */
.aitp-info { display: flex; flex-direction: column; gap: 18px; }

.aitp-brand {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--aitp-primary);
  font-size: 13px; font-weight: 700;
  width: fit-content; padding: 4px 12px 4px 14px;
  border-radius: 999px; background: var(--aitp-primary-soft);
  transition: background .2s;
}
.aitp-brand:hover { background: rgba(30,42,120,0.14); }
.aitp-brand::before {
  content: ""; width: 6px; height: 6px;
  border-radius: 50%; background: var(--aitp-accent);
}

.aitp-title {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 800; letter-spacing: -0.01em;
  line-height: 1.4; margin: 0;
}

.aitp-rating { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--aitp-muted); }
.aitp-stars { display: inline-flex; gap: 2px; color: #f59e0b; }
.aitp-stars svg { width: 16px; height: 16px; }
.aitp-rating__count { color: var(--aitp-muted); }
.aitp-rating__divider { width: 4px; height: 4px; background: var(--aitp-muted-2); border-radius: 50%; }
.aitp-rating__stock {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--aitp-accent-2); font-weight: 600;
}
.aitp-rating__stock::before {
  content: ""; width: 8px; height: 8px;
  border-radius: 50%; background: var(--aitp-accent);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.20);
}

/* Price block */
.aitp-price {
  background: var(--aitp-surface);
  border: 1px solid var(--aitp-line);
  border-radius: var(--aitp-radius-sm);
  padding: 18px 20px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.aitp-price__left { display: flex; flex-direction: column; gap: 4px; }
.aitp-price__label { font-size: 12px; color: var(--aitp-muted); font-weight: 500; }
.aitp-price__main { display: flex; align-items: baseline; gap: 6px; font-feature-settings: "tnum"; }
.aitp-price__now { font-size: 26px; font-weight: 800; color: var(--aitp-ink); letter-spacing: -0.005em; }
.aitp-price__unit { font-size: 13px; font-weight: 600; color: var(--aitp-muted); }
.aitp-price__right { display: flex; align-items: center; gap: 10px; }
.aitp-price__old { font-size: 14px; color: var(--aitp-muted-2); text-decoration: line-through; font-feature-settings: "tnum"; }
.aitp-price__discount {
  background: var(--aitp-discount); color: #fff;
  font-size: 13px; font-weight: 800;
  padding: 5px 11px; border-radius: 999px;
  font-feature-settings: "tnum";
}

/* CTA */
.aitp-cta { display: flex; gap: 12px; align-items: stretch; }
.aitp-cta-form { margin: 0; }

.aitp-qty {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--aitp-primary);
  border-radius: 12px; overflow: hidden;
  background: #fff; height: 56px; flex-shrink: 0;
}
.aitp-qty button {
  width: 44px; height: 100%;
  background: transparent; border: 0;
  color: var(--aitp-primary);
  font-size: 20px; font-weight: 700;
  cursor: pointer; display: grid; place-items: center;
  transition: background .2s, color .2s;
}
.aitp-qty button:hover { background: var(--aitp-primary); color: #fff; }
.aitp-qty input {
  width: 52px; height: 100%; border: 0;
  background: transparent; text-align: center;
  font-family: inherit; font-size: 16px; font-weight: 800;
  color: var(--aitp-ink); -moz-appearance: textfield;
}
.aitp-qty input::-webkit-outer-spin-button,
.aitp-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.aitp-qty input:focus { outline: none; }

.aitp-add {
  flex: 1; display: inline-flex; align-items: center;
  justify-content: center; gap: 10px;
  height: 56px; border: 0; border-radius: 12px;
  background: #1e2a78 !important; color: #fff !important;
  font-family: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px -6px rgba(30,42,120,.4);
  transition: background .2s, box-shadow .2s, transform .15s;
}
.aitp-add:hover { background: #2a3a8c !important; box-shadow: 0 12px 26px -6px rgba(30,42,120,.55); }
.aitp-add:active { transform: translateY(1px); }
.aitp-add svg { width: 20px; height: 20px; }
.aitp-add__short { display: none; }

.aitp-fav {
  width: 56px; height: 56px;
  border: 1.5px solid var(--aitp-line);
  border-radius: 12px; background: #fff;
  color: var(--aitp-muted); cursor: pointer;
  display: grid; place-items: center;
  transition: color .2s, border-color .2s, background .2s;
  flex-shrink: 0;
}
.aitp-fav:hover { color: #dc2626; border-color: rgba(220,38,38,0.3); background: rgba(220,38,38,0.05); }
.aitp-fav.is-active { color: #dc2626; border-color: rgba(220,38,38,0.4); background: rgba(220,38,38,0.06); }
.aitp-fav.is-active svg { fill: currentColor; }
.aitp-fav svg { width: 22px; height: 22px; }

/* Trust pills */
.aitp-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.aitp-trust-pill {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 14px 10px;
  background: var(--aitp-surface);
  border: 1px solid var(--aitp-line);
  border-radius: var(--aitp-radius-sm); text-align: center;
}
.aitp-trust-pill__icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--aitp-primary-soft); color: var(--aitp-primary);
  display: grid; place-items: center;
}
.aitp-trust-pill__icon svg { width: 18px; height: 18px; }
.aitp-trust-pill__label { font-size: 12.5px; color: var(--aitp-ink); font-weight: 600; line-height: 1.4; }
.aitp-trust-pill__sub { font-size: 11px; color: var(--aitp-muted); font-weight: 500; }

/* Meta */
.aitp-meta { border-top: 1px dashed var(--aitp-line-dash); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.aitp-meta__row { display: flex; gap: 8px; font-size: 13px; color: var(--aitp-muted); align-items: baseline; }
.aitp-meta__label { color: var(--aitp-muted); font-weight: 500; min-width: 92px; }
.aitp-meta__value { color: var(--aitp-ink); font-weight: 600; }
.aitp-meta__value a { color: var(--aitp-primary); text-decoration: none; }
.aitp-meta__value a:hover { text-decoration: underline; }
.aitp-meta__sku { font-feature-settings: "tnum"; direction: ltr; unicode-bidi: embed; }

/* Share */
.aitp-share { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--aitp-muted); }
.aitp-share__btns { display: inline-flex; gap: 6px; }
.aitp-share__btns a,
.aitp-share__btns button {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--aitp-bg); color: var(--aitp-muted);
  border: 0; cursor: pointer;
  display: grid; place-items: center;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.aitp-share__btns a:hover,
.aitp-share__btns button:hover { background: var(--aitp-primary); color: #fff; }
.aitp-share__btns svg { width: 14px; height: 14px; }

/* ============================================
   TABS
   ============================================ */
.aitp-content { max-width: 860px; margin: 0 auto; padding: 8px 24px 64px; }
.aitp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--aitp-line); margin-bottom: 28px; }
.aitp-tab {
  background: transparent; border: 0;
  padding: 14px 20px;
  font-family: inherit; font-size: 14.5px; font-weight: 600;
  color: var(--aitp-muted); cursor: pointer;
  position: relative; transition: color .2s;
}
.aitp-tab:hover { color: var(--aitp-ink); }
.aitp-tab--active { color: var(--aitp-primary); }
.aitp-tab--active::after {
  content: ""; position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 2px; background: var(--aitp-accent); border-radius: 2px;
}
.aitp-panel { display: none; }
.aitp-panel--active { display: block; }
.aitp-prose { font-size: 14.5px; line-height: 2.0; color: #374151; }
.aitp-prose p { margin: 0 0 16px; }
.aitp-prose h2 { font-size: clamp(20px, 2.2vw, 26px); font-weight: 800; color: var(--aitp-ink); margin: 36px 0 18px; }
.aitp-prose strong { color: var(--aitp-ink); font-weight: 700; }
.aitp-prose a { color: var(--aitp-primary); text-decoration: none; font-weight: 600; }
.aitp-prose a:hover { text-decoration: underline; }

/* Specs table */
.aitp-specs {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin: 14px 0 20px; font-feature-settings: "tnum";
  border: 1px solid var(--aitp-line);
  border-radius: var(--aitp-radius-sm);
  overflow: hidden; background: #fff;
}
.aitp-specs thead th {
  background: #f7f8fa; font-size: 13px; font-weight: 700;
  color: var(--aitp-ink); padding: 14px 18px;
  text-align: right; border-bottom: 1px solid var(--aitp-line);
}
.aitp-specs tbody tr:nth-child(odd) td { background: #fafbfc; }
.aitp-specs tbody td {
  padding: 14px 18px; font-size: 14px; color: #374151;
  border-bottom: 1px solid var(--aitp-line); vertical-align: middle;
}
.aitp-specs tbody tr:last-child td { border-bottom: 0; }
.aitp-specs tbody td:first-child { color: var(--aitp-ink); font-weight: 700; width: 42%; }

/* ============================================
   RELATED PRODUCTS
   ============================================ */
.aitp-related { max-width: 860px; margin: 0 auto; padding: 0 24px 64px; }
.aitp-related__head {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.aitp-related__head h2 { font-size: clamp(20px, 2.2vw, 26px); font-weight: 800; margin: 0; }
.aitp-related__head h2 span { color: var(--aitp-accent); }
.aitp-related__see {
  font-size: 13px; color: var(--aitp-primary);
  text-decoration: none; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
  transition: gap .2s;
}
.aitp-related__see:hover { gap: 10px; }
.aitp-related__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* Product card */
.aitp-card {
  background: var(--aitp-surface);
  border: 1px solid var(--aitp-line);
  border-radius: var(--aitp-radius);
  overflow: visible;
  display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s, border-color .25s;
  box-shadow: var(--aitp-shadow-1);
}
.aitp-card:hover { transform: translateY(-4px); box-shadow: var(--aitp-shadow-2); border-color: rgba(30,42,120,0.18); }
.aitp-card__media {
  position: relative; display: block; aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 50% 35%, #ffffff 0%, #f4f5f7 70%, #ebecef 100%);
  text-decoration: none;
  border-radius: var(--aitp-radius) var(--aitp-radius) 0 0;
  overflow: hidden;
}
.aitp-card__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
  padding: 20px; filter: drop-shadow(0 12px 16px rgba(16,24,40,0.16));
  transition: transform .3s;
}
.aitp-card:hover .aitp-card__media img { transform: scale(1.05); }
.aitp-card__discount {
  position: absolute; top: 12px; right: 12px;
  background: linear-gradient(135deg, #ff8c3b 0%, #ea580c 100%);
  color: #fff; font-size: 11px; font-weight: 800;
  padding: 4px 11px; border-radius: 999px;
}
.aitp-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.aitp-card__cat { font-size: 11.5px; color: var(--aitp-muted); font-weight: 500; }
.aitp-card__title {
  font-size: 14px; font-weight: 700; color: var(--aitp-ink);
  text-decoration: none; line-height: 1.55; min-height: 44px;
  transition: color .2s;
}
.aitp-card__title:hover { color: var(--aitp-primary); }
.aitp-card__price { display: flex; align-items: baseline; gap: 6px; font-feature-settings: "tnum"; }
.aitp-card__price-now { font-size: 16px; font-weight: 800; color: var(--aitp-ink); }
.aitp-card__price-unit { font-size: 11px; color: var(--aitp-muted); font-weight: 500; }
.aitp-card__cta {
  display: flex; align-items: center;
  justify-content: center; gap: 8px;
  margin: 4px 0 0;
  padding: 12px 16px;
  background: #1e2a78 !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 12px;
  font-family: inherit; font-size: 13.5px; font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: background .25s, transform .15s, box-shadow .25s;
  box-shadow: 0 4px 10px -3px rgba(30,42,120,0.35);
}
.aitp-card__cta:hover {
  background: #24338f !important;
  color: #fff !important;
  box-shadow: 0 8px 18px -4px rgba(30,42,120,0.45);
}
.aitp-card__cta:active { transform: translateY(1px); }
.aitp-card__cta svg { width: 16px; height: 16px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .aitp-hero { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 1100px) {
  .aitp-related__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .aitp-hero { padding: 22px 14px; gap: 18px; }
  .aitp-gallery { grid-template-columns: 1fr; }
  .aitp-gallery__thumbs { flex-direction: row; overflow-x: auto; order: 2; padding-bottom: 4px; }
  .aitp-thumb { width: 64px; height: 64px; flex-shrink: 0; }
  .aitp-main-img { padding: 22px; }
  .aitp-title { font-size: 19px; }
  .aitp-price { padding: 14px 16px; }
  .aitp-price__now { font-size: 22px; }
  .aitp-cta { flex-wrap: nowrap; }
  .aitp-add { font-size: 13px; height: 52px; padding: 0 12px; }
  .aitp-add__full { display: none; }
  .aitp-add__short { display: inline; }
  .aitp-qty, .aitp-fav { height: 52px; }
  .aitp-fav { width: 52px; }
  .aitp-trust { grid-template-columns: 1fr; gap: 8px; }
  .aitp-trust-pill { flex-direction: row; padding: 12px 14px; text-align: right; gap: 12px; }
  .aitp-trust-pill__icon { flex-shrink: 0; }
  .aitp-tabs { overflow-x: auto; }
  .aitp-tab { white-space: nowrap; padding: 12px 14px; font-size: 13.5px; }
  .aitp-content { padding: 0 14px 40px; }
  /* related — horizontal scroll */
  .aitp-related { padding: 0 14px 40px; }
  .aitp-related__grid {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 72% !important;
    grid-template-columns: unset !important;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin: 0 -14px;
    padding: 4px 14px 12px;
    scrollbar-width: none;
  }
  .aitp-related__grid::-webkit-scrollbar { display: none; }
  .aitp-card {
    flex-direction: column;
    scroll-snap-align: end;
    min-width: 0;
  }
  .aitp-card__media { width: 100%; aspect-ratio: 1/1; }
  .aitp-card__body { flex: 1; padding: 10px 12px 12px; gap: 6px; }
  .aitp-card__title { min-height: unset; font-size: 13px; }
  .aitp-card__price-now { font-size: 14px; }
  .aitp-card__cta { font-size: 12.5px; padding: 10px; gap: 6px; }
  .aitp-card__cta svg { width: 14px; height: 14px; }
  .aitp-specs tbody td { padding: 11px 14px; font-size: 13.5px; }
  .aitp-specs tbody td:first-child { width: 48%; }
}
/* Related grid — match listing card size */
.aitp-related__grid {
  grid-template-columns: repeat(4, 1fr);
}
.aitp-card__media { aspect-ratio: 1/1; }

/* Zoom modal */
.aitp-zoom-modal {
  display: none;
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.82);
  align-items: center; justify-content: center;
  cursor: zoom-out;
}
.aitp-zoom-modal.is-open { display: flex; }
.aitp-zoom-modal img {
  max-width: 92vw; max-height: 88vh;
  object-fit: contain; border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  cursor: default;
}
.aitp-zoom-modal__close {
  position: absolute; top: 16px; left: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: 0;
  color: #fff; cursor: pointer; font-size: 22px;
  display: grid; place-items: center;
  transition: background .2s;
}
.aitp-zoom-modal__close:hover { background: rgba(255,255,255,.3); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
