/* ==========================================================================
   VPR Fashion 8.4.1 — Header + Product Gallery Reliability Fixes
   ========================================================================== */

/* ---------- Header: remove stray list dots and keep controls predictable ---------- */
.site-header .main-nav ul,
.site-header .main-nav li,
.mobile-drawer .drawer-nav,
.mobile-drawer .drawer-nav li {
  margin: 0 !important;
  padding-inline-start: 0 !important;
  list-style: none !important;
}
.site-header .main-nav li::marker,
.mobile-drawer .drawer-nav li::marker {
  content: "";
  font-size: 0;
}

.site-header .header-inner > .header-actions {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: 0;
  gap: 6px;
  margin-inline-start: auto;
}
.site-header .header-actions > * {
  flex: 0 0 auto;
}
.site-header .burger {
  position: relative;
  z-index: 2;
  flex: 0 0 44px;
  padding: 0;
  border: 0;
  color: var(--vpr-primary, #1f1b24);
}
.site-header .burger span,
.site-header .burger span::before,
.site-header .burger span::after {
  left: 0;
}

@media (min-width: 1081px) {
  .site-header .burger {
    display: none !important;
  }
}

@media (max-width: 1080px) {
  .site-header .main-nav {
    display: none !important;
  }
  .site-header .header-search {
    display: none !important;
  }
  .site-header .burger {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  .mobile-drawer,
  .drawer-overlay {
    z-index: 100001;
  }
  .drawer-overlay {
    z-index: 100000;
  }
  .mobile-drawer {
    height: 100vh;
    height: 100dvh;
    overscroll-behavior: contain;
  }
}

@media (max-width: 768px) {
  .site-header .header-inner {
    min-height: 64px;
    padding-inline: 12px;
    gap: 8px;
  }
  .site-header .site-logo {
    min-width: 0;
    max-width: 42vw;
    overflow: hidden;
  }
  .site-header .site-logo .custom-logo-link,
  .site-header .site-logo > a {
    display: flex;
    min-width: 0;
  }
  .site-header .site-logo img,
  .site-header .custom-logo {
    display: block;
    width: auto;
    max-width: 42vw;
    height: 34px;
    object-fit: contain;
  }
  .site-header .site-logo .logo-text {
    display: none !important;
  }
  .site-header .header-inner > .header-actions {
    display: flex !important; /* هرگز display:contents نباشد */
    gap: 4px;
    min-width: max-content;
  }
  .site-header .header-actions .icon-btn,
  .site-header .burger {
    width: 40px;
    height: 40px;
    min-width: 40px;
    flex-basis: 40px;
    padding: 0 !important;
    border-radius: 12px;
  }
  .site-header .header-actions .icon-btn svg {
    width: 20px;
    height: 20px;
  }
  .site-header .header-account {
    display: none !important;
  }
}

@media (max-width: 380px) {
  .site-header .site-logo,
  .site-header .site-logo img,
  .site-header .custom-logo {
    max-width: 46vw;
  }
  /* علاقه‌مندی از نوار پایین موبایل قابل دسترسی است؛ جا برای همبرگر حفظ شود. */
  .site-header .header-wishlist {
    display: none !important;
  }
}

body.vpr-menu-open {
  overflow: hidden !important;
}

/* ---------- Product gallery: clickable main image and usable thumbnails ---------- */
.vpr-product-gallery {
  width: 100%;
  min-width: 0;
}
.vpr-product-gallery .gallery-main {
  isolation: isolate;
}
.vpr-product-gallery .gallery-main-button {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  overflow: hidden;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}
.vpr-product-gallery .gallery-main-button:focus-visible {
  outline: 3px solid var(--vpr-accent, #c99b6b);
  outline-offset: -4px;
}
.vpr-product-gallery .gallery-main img {
  display: block;
  pointer-events: none;
  opacity: 1;
  transform: scale(1);
  transition: opacity .18s ease, transform .35s ease !important;
}
.vpr-product-gallery .gallery-main-button:hover img {
  transform: scale(1.025);
}
.vpr-product-gallery .gallery-main img.is-changing {
  opacity: .72;
}
.vpr-product-gallery .zoom-hint {
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

.vpr-product-gallery .gallery-thumbs {
  padding: 2px 1px 7px;
  scrollbar-width: thin;
}
.vpr-product-gallery .gallery-thumb {
  display: block;
  flex: 0 0 78px;
  width: 78px;
  height: 78px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #f7f4f7;
  opacity: .72;
  cursor: pointer;
  transition: border-color .18s ease, opacity .18s ease, transform .18s ease;
}
.vpr-product-gallery .gallery-thumb img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 9px !important;
  object-fit: cover;
  opacity: 1 !important;
  pointer-events: none;
}
.vpr-product-gallery .gallery-thumb:hover,
.vpr-product-gallery .gallery-thumb.active,
.vpr-product-gallery .gallery-thumb[aria-current="true"] {
  border-color: var(--vpr-primary, #4a1942);
  opacity: 1;
}
.vpr-product-gallery .gallery-thumb:hover {
  transform: translateY(-2px);
}
.vpr-product-gallery .gallery-thumb:focus-visible {
  outline: 3px solid var(--vpr-accent, #c99b6b);
  outline-offset: 2px;
  opacity: 1;
}

/* ---------- Full-screen lightbox ---------- */
body.vpr-lightbox-open {
  overflow: hidden !important;
  touch-action: none;
}
.vpr-gallery-lightbox[hidden] {
  display: none !important;
}
.vpr-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100100;
  display: grid;
  place-items: center;
  padding: 22px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
  direction: rtl;
}
.vpr-gallery-lightbox.open {
  opacity: 1;
  visibility: visible;
}
.vpr-lightbox-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(12, 9, 13, .93);
  cursor: zoom-out;
}
.vpr-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  height: min(92vh, 920px);
  height: min(92dvh, 920px);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.vpr-lightbox-figure {
  width: 100%;
  height: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
}
.vpr-lightbox-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(92vh - 52px);
  max-height: calc(92dvh - 52px);
  object-fit: contain;
  border-radius: 10px;
  opacity: 1;
  transition: opacity .15s ease;
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.vpr-lightbox-figure img.is-loading {
  opacity: .35;
}
.vpr-lightbox-counter {
  min-width: 68px;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: auto;
}
.vpr-lightbox-close,
.vpr-lightbox-arrow {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  pointer-events: auto;
  transition: background .18s ease, transform .18s ease;
}
.vpr-lightbox-close:hover,
.vpr-lightbox-arrow:hover {
  background: rgba(255, 255, 255, .24);
  transform: scale(1.06);
}
.vpr-lightbox-close:focus-visible,
.vpr-lightbox-arrow:focus-visible {
  outline: 3px solid var(--vpr-accent, #c99b6b);
  outline-offset: 2px;
}
.vpr-lightbox-close svg,
.vpr-lightbox-arrow svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vpr-lightbox-close {
  top: 0;
  left: 0;
}
.vpr-lightbox-prev {
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.vpr-lightbox-next {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}
.vpr-lightbox-prev:hover,
.vpr-lightbox-next:hover {
  transform: translateY(-50%) scale(1.06);
}

@media (max-width: 768px) {
  .vpr-product-gallery .gallery-thumb {
    flex-basis: 66px;
    width: 66px;
    height: 66px;
    border-radius: 10px;
  }
  .vpr-gallery-lightbox {
    padding: 10px;
  }
  .vpr-lightbox-dialog {
    width: 100%;
    height: 100%;
  }
  .vpr-lightbox-figure img {
    max-height: calc(100dvh - 92px);
    border-radius: 6px;
  }
  .vpr-lightbox-close,
  .vpr-lightbox-arrow {
    width: 42px;
    height: 42px;
    background: rgba(18, 13, 19, .62);
  }
  .vpr-lightbox-close {
    top: 4px;
    left: 4px;
  }
  .vpr-lightbox-prev {
    right: 4px;
  }
  .vpr-lightbox-next {
    left: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vpr-gallery-lightbox,
  .vpr-product-gallery .gallery-main img,
  .vpr-product-gallery .gallery-thumb {
    transition: none !important;
  }
}
