/* ============================================
   MARIANN GRAY · Quick View Modal
   Editorial product detail overlay
   ============================================ */

.quick-view {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  contain: layout style;
}

.quick-view.is-open {
  display: block;
}

/* —— BACKDROP —— */
.quick-view-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(58, 31, 36, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
  cursor: pointer;
}

.quick-view.is-open .quick-view-backdrop {
  opacity: 1;
}

/* Floating petals over backdrop */
.quick-view-petals {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s var(--ease-out) 0.2s;
}
.quick-view.is-open .quick-view-petals {
  opacity: 0.4;
}

.quick-view-petals .petal {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 0 100% 0 100%;
  background: linear-gradient(135deg, #f8c8d0, #e89eaa);
  opacity: 0.55;
  filter: blur(0.5px);
  animation: petal-fall linear infinite;
}
.quick-view-petals .petal:nth-child(1) { left: 8%;  width: 14px; animation-duration: 24s; animation-delay: -2s; }
.quick-view-petals .petal:nth-child(2) { left: 22%; width: 18px; animation-duration: 30s; animation-delay: -8s; }
.quick-view-petals .petal:nth-child(3) { left: 78%; width: 12px; animation-duration: 26s; animation-delay: -5s; }
.quick-view-petals .petal:nth-child(4) { left: 90%; width: 16px; animation-duration: 32s; animation-delay: -14s; }

/* —— DIALOG —— */
.quick-view-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(94vw, 1180px);
  max-height: min(92vh, 820px);
  background: var(--color-cream);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(196, 164, 122, 0.4) inset;
  overflow: hidden;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.94) translateY(20px);
  transition: opacity 0.5s var(--ease-out),
              transform 0.6s var(--ease-out);
}

.quick-view.is-open .quick-view-dialog {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) translateY(0);
}

/* Subtle grain over dialog */
.quick-view-dialog::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  z-index: 1;
}

/* Decorative gold corner ornaments */
.quick-view-dialog::before {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(196, 164, 122, 0.35);
  pointer-events: none;
  z-index: 5;
}

/* —— GRID LAYOUT —— */
.quick-view-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  height: min(92vh, 820px);
  position: relative;
  z-index: 2;
}

/* —— GALLERY —— */
.quick-view-gallery {
  background: white;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(196, 164, 122, 0.25);
}

.qv-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  background-image:
    radial-gradient(ellipse at top right, rgba(252, 228, 214, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(232, 180, 184, 0.3) 0%, transparent 60%);
}

.qv-main-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px;
  transition: opacity 0.35s var(--ease-out);
}

.qv-main-photo.is-changing {
  opacity: 0.2;
}

/* Photo counter */
.qv-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 100px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: white;
  letter-spacing: 0.05em;
  pointer-events: none;
}

/* Gallery arrows */
.qv-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-burgundy);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 32px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(107, 58, 58, 0.18);
  transition: all 0.3s var(--ease-out);
  padding: 0 0 4px 0;
}
.qv-arrow:hover {
  background: white;
  color: var(--color-terra);
  box-shadow: 0 10px 28px rgba(107, 58, 58, 0.28);
}
.qv-arrow-prev { left: 20px; }
.qv-arrow-next { right: 20px; }
.qv-arrow-prev:hover { transform: translateY(-50%) translateX(-3px); }
.qv-arrow-next:hover { transform: translateY(-50%) translateX(3px); }

/* Thumbnails */
.qv-thumbs {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  overflow-x: auto;
  background: var(--color-cream);
  border-top: 1px solid rgba(196, 164, 122, 0.25);
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.qv-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background: white;
  border: 1px solid var(--color-line);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  scroll-snap-align: start;
  transition: all 0.25s var(--ease-out);
  opacity: 0.7;
}
.qv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-out);
}
.qv-thumb:hover {
  opacity: 1;
}
.qv-thumb:hover img {
  transform: scale(1.05);
}
.qv-thumb.is-active {
  border-color: var(--color-burgundy);
  border-width: 2px;
  opacity: 1;
  box-shadow: 0 4px 12px rgba(107, 58, 58, 0.18);
}

/* —— INFO PANEL —— */
.quick-view-info {
  padding: 60px 56px 50px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto;
  background: var(--color-cream);
  background-image:
    radial-gradient(ellipse at bottom right, rgba(252, 228, 214, 0.5) 0%, transparent 60%);
}

.qv-eyebrow {
  font-family: var(--font-script);
  font-size: clamp(22px, 2.2vw, 28px);
  color: var(--color-terra);
  margin-bottom: 8px;
  line-height: 1.1;
}

.qv-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--color-gold);
  letter-spacing: 0.3em;
  margin-bottom: 12px;
}

.qv-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(36px, 3.6vw, 56px);
  color: var(--color-burgundy);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.qv-secondary {
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--color-terra);
  font-weight: 500;
  margin-bottom: 24px;
}

/* Decorative divider */
.qv-divider {
  display: flex;
  align-items: center;
  margin: 0 0 28px 0;
  gap: 10px;
}
.qv-divider::before, .qv-divider::after {
  content: '';
  height: 1px;
  background: var(--color-gold);
  flex: 1;
  opacity: 0.55;
}
.qv-divider-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-terra);
}

/* Actives section */
.qv-section {
  margin-bottom: 24px;
}

.qv-label {
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-terra);
  font-weight: 500;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.qv-label::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--color-gold);
}

.qv-actives {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 1.5vw, 22px);
  color: var(--color-burgundy);
  line-height: 1.5;
}

/* Made in Armenia tag */
.qv-armenia {
  font-family: var(--font-script);
  font-size: 22px;
  color: var(--color-terra);
  margin-bottom: 28px;
  display: inline-block;
}

/* Spacer pushes CTA to bottom */
.qv-spacer { flex: 1; min-height: 16px; }

/* Primary CTA */
.qv-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 36px;
  background: var(--color-burgundy);
  color: var(--color-cream);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(16px, 1.4vw, 18px);
  border-radius: 100px;
  text-decoration: none;
  align-self: flex-start;
  transition: all 0.35s var(--ease-out);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(107, 58, 58, 0.18);
  letter-spacing: 0.02em;
}
.qv-cta-primary:hover {
  background: var(--color-terra);
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(107, 58, 58, 0.28);
}
.qv-cta-primary .arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-out);
}
.qv-cta-primary:hover .arrow {
  transform: translateX(5px);
}

/* Footer meta */
.qv-meta {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(196, 164, 122, 0.25);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--color-terra);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.qv-meta-mark {
  display: flex;
  align-items: center;
}
.qv-meta-mark img {
  height: 32px;
  width: auto;
  display: block;
}

/* —— CLOSE BUTTON —— */
.quick-view-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-burgundy);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(107, 58, 58, 0.15);
  transition: all 0.3s var(--ease-out);
  padding: 0;
}
.quick-view-close:hover {
  background: var(--color-burgundy);
  color: var(--color-cream);
  transform: rotate(90deg);
}

/* —— ARMENIAN OVERRIDES —— */
html[lang="hy"] .qv-name {
  font-family: var(--font-armenian);
  font-style: normal;
  font-weight: 500;
}

/* —— RESPONSIVE —— */
@media (max-width: 900px) {
  .quick-view-dialog {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    top: 0;
    left: 0;
    transform: scale(0.96) translateY(20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .quick-view.is-open .quick-view-dialog {
    transform: none;
  }
  .quick-view-dialog::before {
    display: none;
  }
  .quick-view-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }
  .quick-view-gallery {
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(196, 164, 122, 0.25);
  }
  .qv-main {
    height: 60vh;
  }
  .qv-main { flex: 1; }
  .qv-arrow {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
  .qv-arrow-prev { left: 12px; }
  .qv-arrow-next { right: 12px; }
  .quick-view-info {
    padding: 40px 28px 28px;
  }
}

@media (max-width: 700px) {
  .qv-thumbs { padding: 12px 16px; }
  .qv-thumb { width: 52px; height: 52px; }
  .quick-view-close {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 22px;
  }
  .quick-view-info {
    padding: 28px 20px 32px;
  }
  .qv-name {
    font-size: 36px;
    line-height: 1.05;
  }
}
