/*
 * Sorrad Perfume Details V2 — standalone, modal-scoped stylesheet.
 * Load AFTER styles.css / themes.css / motion.css.
 * Existing chat perfume cards are intentionally not styled here.
 */
.product-modal.pmv2 {
  --pmv2-bg: #203a2a;
  --pmv2-panel: #183323;
  --pmv2-line: rgba(215, 239, 220, .15);
  --pmv2-text: #eff8f1;
  --pmv2-muted: #b5d0bb;
  --pmv2-soft: #9fc3a8;
  --pmv2-gold: #c5efcc;
  --pmv2-accent: #a2ddaF;
  --pmv2-radius: 20px;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  width: min(940px, calc(100vw - 44px));
  max-width: 940px;
  height: min(850px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  color: var(--pmv2-text);
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 13px;
  line-height: 1.75;
  text-align: start;
  border: 1px solid rgba(220, 198, 212, .2);
  border-radius: 26px;
  background: linear-gradient(145deg, #1d4930 0%, #0d1710 42%, #10251a 100%);
  box-shadow: 0 36px 120px rgba(2, 4, 13, .78), 0 1px 0 rgba(255,255,255,.06) inset;
  overflow: hidden;
  scrollbar-width: thin;
}
.product-modal.pmv2:not([open]) { display: none; }
.product-modal.pmv2[open] { display: flex; flex-direction: column; }
.product-modal.pmv2::backdrop {
  background: rgba(5, 7, 17, .79);
  backdrop-filter: blur(9px);
}

/* The toolbar and footer stay in the dialog while ONLY the middle scrolls. */
.pmv2 .pmv2-toolbar {
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
  min-height: 64px;
  padding: 11px 27px;
  border-bottom: 1px solid var(--pmv2-line);
  background: rgba(8, 14, 10, .97);
}
.pmv2 .pmv2-identity { display: flex; align-items: baseline; gap: 13px; }
.pmv2 .pmv2-identity strong {
  font: 600 15px/1.2 Georgia, 'Times New Roman', serif;
  letter-spacing: 3.5px;
  color: var(--pmv2-gold);
  direction: ltr;
}
.pmv2 .pmv2-identity span {
  font-size: 11px;
  font-weight: 400;
  color: var(--pmv2-muted);
}
.pmv2 .product-modal-close.pmv2-close {
  position: static;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  font: 400 24px/1 Arial, sans-serif;
  background: rgba(255,255,255,.06);
  color: #f3eaf1;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  transition: background .2s ease, transform .2s ease;
  cursor: pointer;
}
.pmv2 .product-modal-close.pmv2-close:hover { background: rgba(255,255,255,.15); transform: rotate(90deg); }
.pmv2 .product-modal-close.pmv2-close:focus-visible,
.pmv2 .pmv2-done:focus-visible,
.pmv2 summary:focus-visible { outline: 2px solid var(--pmv2-gold); outline-offset: 4px; }

.pmv2 .pmv2-scroll {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #4e765a #101711;
}
.pmv2 .pmv2-rendered { width: 100%; max-width: 100%; }
.pmv2 .product-modal-hero.pmv2-hero {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  align-items: center;
  gap: 34px;
  margin: 0;
  padding: 28px 34px 32px;
  text-align: start;
  background:
    radial-gradient(ellipse at 18% 8%, rgba(149,117,157,.15), transparent 53%),
    radial-gradient(ellipse at 86% 65%, rgba(223,174,126,.065), transparent 57%);
  border-bottom: 1px solid var(--pmv2-line);
}
.pmv2 .pmv2-hero-art { min-width: 0; }
.pmv2 .perfume-hero-image.pmv2-product-image {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  height: 244px;
  padding: 0;
  margin: 0;
  border-radius: 19px;
  background: linear-gradient(160deg, #fbf8f5, #eae7ef);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: 0 14px 34px rgba(0,0,0,.21);
}
.pmv2 .pmv2-product-image img { object-fit: contain; width: 100%; height: 100%; }
.pmv2 .pmv2-hero-copy { min-width: 0; }
.pmv2 .pmv2-eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  direction: ltr;
  text-align: right;
  color: var(--pmv2-gold);
  margin: 0 0 13px;
}
.pmv2 .pmv2-product-title {
  color: var(--pmv2-text);
  font-size: clamp(19px, 2.15vw, 26px);
  font-weight: 600;
  line-height: 1.9;
  margin: 0 0 9px;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.pmv2 .pmv2-product-brand {
  color: var(--pmv2-gold);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  margin: 0 0 6px;
  text-align: right;
}
.pmv2 .pmv2-product-subtitle {
  color: var(--pmv2-muted);
  font-size: 12px;
  line-height: 1.85;
  margin: 0 0 14px;
  text-align: right;
}
.pmv2 .pmv2-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pmv2 .pmv2-chip {
  padding: 5px 12px;
  border: 1px solid rgba(233,202,167,.3);
  background: rgba(233,202,167,.055);
  border-radius: 999px;
  color: var(--pmv2-gold);
  font-size: 11px;
}

/* Fallback is a small CSS bottle silhouette, never a random or fake photo. */
.pmv2 .pmv2-photo-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.pmv2 .pmv2-bottle { position: relative; display: block; width: 64px; height: 110px; }
.pmv2 .pmv2-bottle-cap {
  position: absolute; width: 28px; height: 25px; top: 3px; left: 18px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(90deg, #a7a7b4 0%, #ece9ef 40%, #8a8a99 100%);
  box-shadow: 0 2px 0 #80808c;
}
.pmv2 .pmv2-bottle-body {
  position: absolute; top: 32px; left: 5px; width: 54px; height: 68px;
  border: 2px solid #8f8598; border-radius: 13px 13px 18px 18px;
  background: linear-gradient(120deg, #ddc9d7dd, #f8e5e6b0 46%, #bbabba9c);
  box-shadow: inset 10px 0 13px #ffffff75, inset -8px 0 10px #a092ab55, 0 4px 12px #25243a2e;
}
.pmv2 .pmv2-bottle-body::after {
  content: ""; position: absolute; inset: 17px 11px 15px;
  border: 1px solid #9f93a9; border-radius: 5px;
  background: #f8eef2aa;
}
.pmv2 .pmv2-product-image img,
.pmv2 .pmv2-note-photo img { position: absolute; inset: 0; object-fit: contain; width: 100%; height: 100%; }

.pmv2 .pmv2-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.17fr) minmax(0, .83fr);
  gap: 24px;
  padding: 26px 32px 34px;
}
.pmv2 .pmv2-main,
.pmv2 .pmv2-aside { min-width: 0; display: grid; align-content: start; gap: 18px; }
.pmv2 .product-detail-section.pmv2-section {
  margin: 0;
  padding: 22px;
  min-width: 0;
  border: 1px solid var(--pmv2-line);
  border-radius: var(--pmv2-radius);
  background: rgba(255,255,255,.035);
}
.pmv2 .pmv2-section-heading { margin-bottom: 19px; }
.pmv2 .pmv2-section-heading h3 {
  color: var(--pmv2-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  margin: 0;
}
.pmv2 .pmv2-section-heading p {
  margin: 4px 0 0;
  color: var(--pmv2-soft);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.65;
}
.pmv2 .pmv2-accord-grid { display: flex; gap: 16px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.pmv2 .pmv2-accord-item { flex: 0 0 106px; min-width: 0; }
.pmv2 .pmv2-accord-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 8px; }
.pmv2 .accord-label { min-width: 0; color: #e2e0e8; font-size: 12px; font-weight: 400; line-height: 1.5; }
.pmv2 .accord-value { flex-shrink: 0; color: #9c9cab; font-size: 10px; line-height: 1.4; direction: ltr; }
.pmv2 .accord-track {
  height: 6px; width: 100%; background: rgba(255,255,255,.095);
  border-radius: 20px; overflow: hidden; direction: ltr;
}
.pmv2 .accord-fill { height: 100%; border-radius: inherit; background: var(--pmv2-accent); }
.pmv2 .pmv2-help { margin: 16px 0 0; color: var(--pmv2-soft); font-size: 10px; line-height: 1.85; }

/* The note pyramid is a visually connected three-stage journey. */
/* Three stages remain in their own full-width section INSIDE the scroll body,
   directly after a balanced overview; no detached bottom section or empty rail. */
.pmv2 .pmv2-grid.pmv2-overview {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 22px 32px 18px;
  align-items: start;
}
.pmv2 .pmv2-overview > .pmv2-section {
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.pmv2 .pmv2-overview .pmv2-metric-grid,
.pmv2 .pmv2-overview .pmv2-season-group {
  flex: 1 1 0;
}
.pmv2 .pmv2-overview .pmv2-season-group + .pmv2-season-group {
  margin-top: 10px;
}
.pmv2 .pmv2-grid.pmv2-extras {
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  padding: 18px 32px 32px;
  align-items: start;
}
.pmv2 .pmv2-grid.pmv2-single { grid-template-columns: minmax(0, 1fr); }
.pmv2 .pmv2-rendered > .pmv2-section {
  margin: 22px 32px 0;
}
.pmv2 .pmv2-rendered > .pmv2-section.pmv2-notes-section {
  margin-top: 18px;
}
.pmv2 .product-detail-section.pmv2-notes-section {
  margin: 0 32px;
  padding: 20px 22px 22px;
}
.pmv2 .pmv2-overview > .pmv2-section,
.pmv2 .pmv2-extras > .pmv2-section { min-height: 0; }

.pmv2 .pmv2-notes-track.note-pyramid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 13px;
  margin: 0;
  align-items: stretch;
}
.pmv2 .pmv2-note-stage {
  border-radius: 15px;
  background: rgba(4, 10, 7, .48);
  border: 1px solid rgba(255,255,255,.065);
  padding: 14px 16px 16px;
}
.pmv2 .pmv2-note-stage-header { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.pmv2 .pmv2-stage-index {
  direction: ltr; display: grid; place-items: center; flex: 0 0 32px;
  width: 32px; height: 32px; font: 500 11px/1 Georgia, serif;
  color: var(--pmv2-gold);
  background: rgba(233,202,167,.07);
  border: 1px solid rgba(233,202,167,.22);
  border-radius: 10px;
}
.pmv2 .pmv2-stage-words h4 { margin: 0; font-size: 12px; font-weight: 600; color: #e8e1eb; line-height: 1.65; }
.pmv2 .pmv2-stage-words small { display: block; color: var(--pmv2-soft); font-size: 10px; line-height: 1.5; }
.pmv2 .pmv2-note-list { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.pmv2 .pmv2-note-item.note-item {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 7px; width: auto; min-width: 0; margin: 0; text-align: center;
  color: #d8d5df;
  font-size: 10px; line-height: 1.6;
}
.pmv2 .note-image.pmv2-note-photo {
  position: relative; display: grid; place-items: center;
  width: 51px; height: 51px;
  flex: 0 0 51px;
  border-radius: 14px;
  background: #f8f5f9;
  border: 1px solid #ffffffb0;
}
.pmv2 .pmv2-note-photo .pmv2-photo-fallback { opacity: .82; }
.pmv2 .pmv2-note-placeholder {
  font: 500 16px/1.1 Georgia, 'Times New Roman', serif;
  color: #7d6b83;
  letter-spacing: .02em;
}
.pmv2 .pmv2-note-name { unicode-bidi: plaintext; overflow-wrap: anywhere; min-width: 0; }

/* Sidebar: small, meaningful performance cards, not tall full-width charts. */
.pmv2 .pmv2-metric-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.pmv2 .product-stat-card.pmv2-metric-card {
  display: block; padding: 15px 16px;
  /* border: 1px solid rgba(255,255,255,.07); */
  /* background: rgba(20,23,35,.30); */
  /* border-radius: 14px; */
}
.pmv2 .pmv2-metric-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pmv2 .pmv2-metric-name { font-size: 12px; color: #e7e4ec; }
.pmv2 .pmv2-metric-result { font-size: 14px; font-weight: 600; direction: ltr; color: var(--pmv2-gold); }
.pmv2 .product-stat-track.pmv2-metric-track {
  height: 7px; width: 100%; margin: 12px 0 7px;
  border-radius: 99px; background: #ffffff12; overflow: hidden;
}
.pmv2 .product-stat-fill { background: linear-gradient(90deg, #6eae80, #b8e3bf); height: 100%; }
.pmv2 .pmv2-metric-status { color: var(--pmv2-soft); font-size: 10px; line-height: 1.5; }
.pmv2 .pmv2-season-group + .pmv2-season-group { margin-top: 18px; }
.pmv2 .pmv2-season-group h4 { margin: 0 0 10px; color: #d8d7e1; font-size: 11px; font-weight: 500; }
.pmv2 .product-tags.pmv2-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.pmv2 .product-tag.pmv2-tag {
  padding: 6px 10px; gap: 7px;
  border: 1px solid rgba(233,202,167,.18);
  background: rgba(233,202,167,.065);
  border-radius: 12px;
  color: #eae5ec;
}
.pmv2 .pmv2-tag .product-tag-name { color: #eae5ec; font-size: 11px; }
.pmv2 .pmv2-tag .product-tag-share { color: var(--pmv2-gold); font-size: 10px; }
.pmv2 .pmv2-editorial-section .pmv2-section-heading { margin-bottom: 12px; }
.pmv2 .pmv2-disclosure { border-top: 1px solid var(--pmv2-line); padding: 12px 0; }
.pmv2 .pmv2-disclosure:last-child { padding-bottom: 0; }
.pmv2 .pmv2-disclosure summary {
  position: relative; list-style: none; cursor: pointer;
  padding-inline-start: 20px;
  color: #e6dee8; font-size: 12px;
}
.pmv2 .pmv2-disclosure summary::-webkit-details-marker { display: none; }
.pmv2 .pmv2-disclosure summary::before {
  content: "+"; position: absolute; inset-inline-start: 0; top: 0;
  color: var(--pmv2-gold); font: 18px/1.4 Arial, sans-serif;
}
.pmv2 .pmv2-disclosure[open] summary::before { content: "−"; }
.pmv2 .pmv2-disclosure-content { padding-top: 12px; }
.pmv2 .pmv2-disclosure-content h4 { margin: 10px 0 5px; font-size: 11px; font-weight: 600; color: var(--pmv2-gold); }
.pmv2 .pmv2-opinion-list { margin: 0; padding-inline-start: 18px; }
.pmv2 .pmv2-opinion-list li { font-size: 11px; line-height: 1.9; margin: 4px 0; color: #cecad7; }
.pmv2 .pmv2-description { margin: 11px 0 0; font-size: 11px; line-height: 2; color: #d4d0db; overflow-wrap: anywhere; }

.pmv2 .pmv2-footer {
  display: flex; justify-content: space-between; align-items: center;
  gap: 22px; flex: 0 0 auto;
  min-height: 68px; padding: 12px 27px;
  border-top: 1px solid var(--pmv2-line);
  background: rgba(7, 13, 9, .98);
}
.pmv2 .pmv2-footer > span { color: var(--pmv2-soft); font-size: 10px; line-height: 1.7; }
.pmv2 .pmv2-done {
  flex-shrink: 0; padding: 9px 17px;
  border: 1px solid rgba(233,202,167,.35);
  border-radius: 12px; background: rgba(233,202,167,.105);
  color: #d5f0d8; font-size: 11px; font-weight: 500;
  transition: background .18s ease;
}
.pmv2 .pmv2-done:hover { background: rgba(233,202,167,.18); }
.pmv2 .pmv2-state {
  min-height: 310px; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  gap: 15px; padding: 30px;
}
.pmv2 .pmv2-state .pmv2-bottle { opacity: .65; transform: scale(.8); }
.pmv2 .pmv2-state h2 { margin: 0; color: var(--pmv2-text); font-size: 17px; font-weight: 500; }
.pmv2 .pmv2-state p { margin: 0; color: var(--pmv2-muted); font-size: 12px; }

@media (max-width: 820px) {
  .product-modal.pmv2 { width: calc(100vw - 20px); max-width: none; height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); border-radius: 22px; }
  .pmv2 .product-modal-hero.pmv2-hero { grid-template-columns: 180px minmax(0,1fr); gap: 22px; padding: 24px; }
  .pmv2 .perfume-hero-image.pmv2-product-image { height: 212px; }
  .pmv2 .pmv2-grid { grid-template-columns: 1fr; padding: 19px 22px 28px; gap: 17px; }
  .pmv2 .pmv2-grid.pmv2-overview, .pmv2 .pmv2-grid.pmv2-extras {
    grid-template-columns: minmax(0, 1fr); padding: 18px 22px;
  }
  .pmv2 .pmv2-overview > .pmv2-section { height: auto; }
  .pmv2 .pmv2-rendered > .pmv2-section { margin-left: 22px; margin-right: 22px; }
  .pmv2 .product-detail-section.pmv2-notes-section { margin: 0 22px; }
  .pmv2 .pmv2-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  /* Up to eight accords fit in two rows; notes use the full mobile width. */
  .pmv2 .pmv2-accord-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 10px;
    overflow: visible;
    padding-bottom: 0;
  }
  .pmv2 .pmv2-accord-item { display: flex; flex-direction: column; }
  .pmv2 .pmv2-accord-heading {
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 7px;
  }
  .pmv2 .accord-label { min-height: 3em; font-size: 11px; overflow-wrap: anywhere; }
  .pmv2 .pmv2-notes-track.note-pyramid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 0;
  }
  .pmv2 .pmv2-note-stage { min-width: 0; padding: 14px 12px; }
  .pmv2 .pmv2-note-list {
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 12px 8px;
  }
  .pmv2 .note-image.pmv2-note-photo {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 12px;
  }
  .pmv2 .pmv2-note-item.note-item { gap: 6px; font-size: 11px; }
  .pmv2 .pmv2-note-name { max-width: 100%; }
}
@media (max-width: 540px) {
  .product-modal.pmv2 { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .pmv2 .pmv2-toolbar { min-height: 58px; padding: 10px 18px; }
  .pmv2 .pmv2-identity { gap: 9px; }
  .pmv2 .pmv2-identity strong { letter-spacing: 2px; font-size: 13px; }
  .pmv2 .pmv2-identity span { font-size: 10px; }
  .pmv2 .product-modal-hero.pmv2-hero { grid-template-columns: 108px minmax(0,1fr); gap: 15px; padding: 21px 18px; }
  .pmv2 .perfume-hero-image.pmv2-product-image { height: 145px; border-radius: 15px; }
  .pmv2 .pmv2-product-image .pmv2-bottle { transform: scale(.72); }
  .pmv2 .pmv2-eyebrow { font-size: 8px; letter-spacing: 1.8px; margin-bottom: 5px; }
  .pmv2 .pmv2-product-title { font-size: 15px; line-height: 1.65; margin-bottom: 7px; }
  .pmv2 .pmv2-product-brand { font-size: 12px; margin-bottom: 2px; }
  .pmv2 .pmv2-product-subtitle { font-size: 10px; margin-bottom: 7px; max-height: 48px; overflow: hidden; }
  .pmv2 .pmv2-chip { font-size: 10px; padding: 3px 9px; }
  .pmv2 .pmv2-grid { display: block; padding: 14px 14px 25px; }
  .pmv2 .pmv2-grid.pmv2-overview, .pmv2 .pmv2-grid.pmv2-extras { padding: 14px; gap: 13px; }
  .pmv2 .pmv2-grid.pmv2-overview { display: grid; }
  .pmv2 .pmv2-rendered > .pmv2-section { margin-left: 14px; margin-right: 14px; }
  .pmv2 .product-detail-section.pmv2-notes-section { margin: 0 14px; }
  .pmv2 .pmv2-main, .pmv2 .pmv2-aside { gap: 13px; }
  .pmv2 .pmv2-aside { margin-top: 13px; }
  .pmv2 .product-detail-section.pmv2-section { padding: 16px; border-radius: 16px; }
  .pmv2 .pmv2-accord-grid { gap: 14px 8px; }
  .pmv2 .pmv2-section-heading { margin-bottom: 14px; }
  .pmv2 .pmv2-section-heading h3 { font-size: 13px; }
  .pmv2 .pmv2-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .pmv2 .product-stat-card.pmv2-metric-card { padding: 12px 10px; }
  .pmv2 .pmv2-metric-top { display: block; }
  .pmv2 .pmv2-metric-result { display: block; margin-top: 5px; text-align: right; }
  .pmv2 .pmv2-footer { min-height: 66px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); gap: 10px; }
  .pmv2 .pmv2-footer > span { font-size: 9px; }
  .pmv2 .pmv2-done { font-size: 10px; padding: 9px 11px; }
}
@media (max-width: 360px) {
  .pmv2 .product-modal-hero.pmv2-hero { grid-template-columns: 86px minmax(0,1fr); gap: 12px; }
  .pmv2 .perfume-hero-image.pmv2-product-image { height: 125px; }
  .pmv2 .pmv2-product-title { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .pmv2 *, .pmv2 *::before, .pmv2 *::after { transition: none !important; animation: none !important; }
}
