/* ===========================
   LightGallery – PSP Custom Skin
   (layout ثابت + استایل حرفه‌ای)
   =========================== */

/* همیشه روی همه‌چیز از بالا نمایش داده بشه */
.lg-backdrop,
.lg-outer {
  z-index: 2147483000 !important;
}

/* پس‌زمینه‌ی تیره و نرم */
.lg-backdrop {
  background: radial-gradient(circle at 10% 10%, rgba(15,23,42,.94), #020617);
}

/* ظرف اصلی گالری */
.lg-outer {
  font-family: inherit;
  color: #e5e7eb;
}

/* ===================== بخش حیاتی نمایش تصویر ===================== */
/* ❗ این قسمت همون منطقیه که قبلاً تصویر رو درست می‌آورد – دست نزنیم */

.lg-outer .lg-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lg-outer .lg-item {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lg-outer .lg-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(100vw, 1280px);
  max-height: min(80vh, 720px);
  margin: 0 auto;
  padding: 0 10px;
}

.lg-outer .lg-object,
.lg-outer .lg-image,
.lg-outer .lg-video-cont video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
  background: #020617;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
}

@media (max-width: 768px) {
  .lg-outer .lg-img-wrap {
    max-height: 70vh;
    padding: 0 6px;
  }
  .lg-outer .lg-object,
  .lg-outer .lg-image {
    border-radius: 14px;
  }
}

/* ===================== نوار ابزار بالا ===================== */

.lg-toolbar {
  top: 14px;
  right: 18px;
  left: auto;
  height: auto;
  padding: 0;
  gap: 8px;
  display: flex !important;
  align-items: center;
}

.lg-toolbar .lg-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(15,23,42,0.92);
  color: #e5e7eb;
  border: 1px solid rgba(148,163,184,0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background .15s ease,
    transform .15s ease,
    box-shadow .15s ease,
    border-color .15s ease,
    color .15s ease;
}

.lg-toolbar .lg-icon:hover {
  background: rgba(30,64,175,0.96);
  border-color: rgba(59,130,246,0.9);
  color: #f9fafb;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(30,64,175,0.55);
}

.lg-toolbar .lg-icon:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* دکمه بستن قرمزتر و پررنگ‌تر */
.lg-toolbar .lg-close {
  background: linear-gradient(135deg,#ef4444,#b91c1c);
  border-color: transparent;
}
.lg-toolbar .lg-close:hover {
  background: linear-gradient(135deg,#f97373,#dc2626);
}

/* شمارنده‌ی اسلاید (۱/۷) */
#lg-counter {
  font-family: inherit;
  font-size: .78rem;
  color: #cbd5f5;
  background: rgba(15,23,42,0.9);
  border-radius: 999px;
  padding: 4px 10px;
  margin-inline-start: 8px;
}

/* ===================== دکمه‌های بعدی / قبلی ===================== */

.lg-actions .lg-prev,
.lg-actions .lg-next {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(148,163,184,0.55);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background .15s ease,
    transform .15s ease,
    box-shadow .15s ease,
    border-color .15s ease,
    color .15s ease;
}

.lg-actions .lg-prev:hover,
.lg-actions .lg-next:hover {
  background: rgba(30,64,175,0.96);
  border-color: rgba(59,130,246,0.9);
  color: #f9fafb;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(30,64,175,0.55);
}

.lg-actions .lg-prev:focus-visible,
.lg-actions .lg-next:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* ===================== کپشن فارسی ===================== */

.lg-outer .lg-sub-html {
  direction: rtl;
  text-align: center;
  font-size: .9rem;
  line-height: 1.7;
  padding: 10px 24px 12px;
  color: #e5e7eb;
  background: linear-gradient(to top,
    rgba(15,23,42,0.98),
    rgba(15,23,42,0.7),
    transparent
  );
}

.lg-outer .lg-sub-html.lg-empty-html {
  display: none;
}

/* ===================== تامبنیل‌ها پایین ===================== */

.lg-thumb-outer {
  bottom: 0;
  height: auto;
  padding: 8px 0 10px;
  background: linear-gradient(to top,
    rgba(15,23,42,0.98),
    rgba(15,23,42,0.9),
    rgba(15,23,42,0.6)
  );
  border-top: 1px solid rgba(30,64,175,0.6);
  box-shadow: 0 -14px 28px rgba(15,23,42,0.8);
}

/* ظرف تامبنیل‌ها – حالت نواری اسکرول‌پذیر */
.lg-thumb-outer .lg-thumb {
  margin: 0 auto;
  padding-inline: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;           /* Firefox: hide */
}

.lg-thumb-outer .lg-thumb::-webkit-scrollbar {
  display: none;                   /* Chrome/Safari: hide */
}

/* خود آیتم‌ها */
.lg-thumb-outer .lg-thumb-item {
  flex: 0 0 auto;
  float: none !important;          /* override پیش‌فرض پلاگین */
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  transition:
    border-color .14s ease,
    transform .14s ease,
    box-shadow .14s ease,
    opacity .14s ease;
  opacity: .8;
  cursor: pointer;
}

.lg-thumb-outer .lg-thumb-item img {
  border-radius: inherit;
}

.lg-thumb-outer .lg-thumb-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15,23,42,0.75);
  opacity: 1;
}

.lg-thumb-outer .lg-thumb-item.active {
  border-color: #f97316;
  opacity: 1;
}

/* دسکتاپ – کمی بزرگ‌تر و وسط‌چین‌تر */
@media (min-width: 1024px) {
  .lg-thumb-outer .lg-thumb {
    justify-content: center;
  }
}

/* موبایل – عرض کمتر، لمس راحت‌تر */
@media (max-width: 640px) {
  .lg-thumb-outer .lg-thumb {
    padding-inline: 8px;
    gap: 6px;
  }

  .lg-thumb-outer .lg-thumb-item {
    width: 70px !important;
    height: 70px !important;
  }
}

/* ===================== ریزبهینه‌سازی ===================== */

.lg-outer,
.lg-backdrop {
  -webkit-tap-highlight-color: transparent;
}

/* هنگام باز بودن گالری، استیکی‌های صفحه مزاحم نباشند */
.lg-on .sticky-add-to-cart,
.lg-on .product-sticky-action {
  display: none !important;
}

/* جلوگیری از اسکرول پس‌زمینه در موبایل */
.lg-on {
  touch-action: none;
}
