/* ==========================================================================
   FlagsExpo redesign V1 (Figma) — Single product detail page
   Shares :root vars + .v2-section/.v2-pcard/.v2-carousel-* from
   redesign-v2.css and home-v2.css (recommendations reuse the home carousel).
   ========================================================================== */

.v2-pd, .v2-pd *:not(.v2-testimonials):not(.v2-testimonials *) { box-sizing: border-box; font-family: var(--v2-font); }

.v2-pd-breadcrumb { font-size: 14px; color: rgba(2,20,51,0.6); margin: 0 0 24px; }
.v2-pd-breadcrumb a { color: inherit; text-decoration: none; }
.v2-pd-breadcrumb a:hover { text-decoration: underline; }

.v2-pd-layout { display: flex; gap: 56px; align-items: flex-start; }
.v2-pd-gallery { flex: 0 0 48%; min-width: 0; }
.v2-pd-gallery-main { background: #f9f9f9; display: flex; align-items: center; justify-content: center; overflow: hidden; aspect-ratio: 1 / 1; }
.v2-pd-gallery-main a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.v2-pd-gallery-main img { max-width: 70%; max-height: 70%; width: auto; height: auto; object-fit: contain; }

.v2-pd-info { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 32px; }

.v2-pd-availability { display: flex; align-items: center; gap: 8px; font-size: 16px; color: #1c1c1c; }
.v2-pd-availability .v2-pd-dot { width: 8px; height: 8px; border-radius: 50%; background: #1a7a3c; flex-shrink: 0; }
.v2-pd-availability.is-unavailable .v2-pd-dot { background: #b90600; }

.v2-pd-title { font-family: var(--v2-font-display); font-weight: 500; font-size: 50px; line-height: 1.2; color: #021433; margin: 0 0 16px; }
.v2-pd-shortdesc { font-size: 16px; line-height: 1.6; color: rgba(0,0,0,0.7); margin: 0; max-width: 560px; }

.v2-pd-size { display: flex; flex-direction: column; gap: 16px; }
.v2-pd-size-label { font-family: var(--v2-font-display); font-weight: 500; font-size: 18px; color: #000; margin: 0; max-width: 480px; text-align: right; }

.v2-pd-sizeselector { position: relative; max-width: 480px; }
.v2-pd-sizelist { display: flex; flex-direction: column; gap: 0; border: 1px solid #c4c4c4; background: #fff; }
.v2-pd-sizeoption {
  position: relative; padding: 12px 16px; cursor: pointer; background: #fff; border-bottom: 1px solid #e5e5e5;
}
.v2-pd-sizeoption:last-child { border-bottom: none; }
.v2-pd-sizeoption:hover { background: #f9fafc; }
.v2-pd-sizeoption.is-selected { background: #f5f7fb; padding-right: 56px; }
.v2-pd-sizeoption:focus-visible { outline: 2px solid var(--v2-navy); outline-offset: -2px; }
.v2-pd-sizeoption-row { display: flex; align-items: baseline; gap: 12px; }
.v2-pd-sizeoption-name { font-family: var(--v2-font-display); font-weight: 500; font-size: 16px; color: #000; }
.v2-pd-sizeoption-dims { font-size: 14px; color: rgba(0,0,0,0.6); }
.v2-pd-sizeoption-price { margin-left: auto; font-weight: 600; font-size: 16px; color: #021433; white-space: nowrap; }
.v2-pd-sizeoption-desc { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: rgba(0,0,0,0.6); }
.v2-pd-sizeoption-type { font-weight: 600; color: rgba(0,0,0,0.75); }
.v2-pd-sizeoption-soon {
  display: inline-block; margin-top: 8px; background: var(--v2-navy); color: #fff; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px;
}
.v2-pd-sizeoption-chevron {
  display: none; position: absolute; top: 0; right: 0; bottom: 0; width: 44px;
  background: var(--v2-red); color: #fff; align-items: center; justify-content: center; font-size: 16px;
}

/* Collapsed (default): only the selected size is visible, acting as the closed selector. */
.v2-pd-sizeselector:not(.is-open) .v2-pd-sizelist { border-color: #c4c4c4; }
.v2-pd-sizeselector:not(.is-open) .v2-pd-sizeoption:not(.is-selected) { display: none; }
.v2-pd-sizeselector:not(.is-open) .v2-pd-sizeoption.is-selected .v2-pd-sizeoption-chevron { display: flex; }

/* Open: the list drops down over the page, showing every size to choose from. */
.v2-pd-sizeselector.is-open { z-index: 5; }
.v2-pd-sizeselector.is-open .v2-pd-sizelist {
  position: absolute; top: 0; left: 0; right: 0; box-shadow: 0 12px 28px rgba(0,0,0,0.15);
  max-height: min(320px, 60vh); overflow-y: auto;
}
.v2-pd-sizeselector.is-open .v2-pd-sizeoption.is-selected .v2-pd-sizeoption-chevron { display: flex; transform: rotate(180deg); }

.v2-pd-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.v2-pd-price-now { font-family: var(--v2-font); font-weight: 600; font-size: 32px; color: #021433; }
.v2-pd-price-was { font-family: var(--v2-font); font-weight: 500; font-size: 20px; color: #bebebe; text-decoration: line-through; }

.v2-pd-buy { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.v2-pd-qty { border: 1px solid #1c1c1c; display: flex; align-items: center; flex: 0 0 auto; }
.v2-pd-qty button {
  background: none; border: none; width: 48px; align-self: stretch; font-size: 20px; cursor: pointer; color: #1c1c1c;
}
.v2-pd-qty button:hover { background: #f5f6f8; }
.v2-pd-qty input {
  width: 48px; text-align: center; border: none; font-family: var(--v2-font); font-size: 24px; color: #1c1c1c;
  background: transparent; padding: 20px 0;
}
.v2-pd-addtocart {
  flex: 1 1 220px; background: var(--v2-navy); color: #fff; border: none; padding: 24px 32px;
  font-family: var(--v2-font); font-weight: 600; font-size: 16px; cursor: pointer; text-transform: uppercase;
}
.v2-pd-addtocart:hover { background: var(--v2-navy-dark); }

/* ---------- Related products (reuses .v2-pl-card from productlisting.css inside a home-style carousel) ---------- */
.v2-pd-related-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 48px; flex-wrap: wrap; }
.v2-pd-related-title { font-family: var(--v2-font-display); font-weight: 400; font-size: 56px; line-height: 0.96; color: #021433; margin: 0; }
.v2-carousel-track .v2-pl-card { flex: 0 0 296px; scroll-snap-align: start; }

@media (max-width: 1279px) {
  .v2-pd-layout { gap: 40px; }
  .v2-pd-title { font-size: 40px; }
  .v2-pd-related-title { font-size: 44px; }
}

@media (max-width: 1023px) {
  .v2-pd-layout { flex-direction: column; }
  .v2-pd-gallery { flex: none; width: 100%; }
  .v2-pd-title { font-size: 34px; }
}

@media (max-width: 640px) {
  .v2-pd-title { font-size: 28px; }
  .v2-pd-related-title { font-size: 32px; }
  .v2-pd-sizeoption-row { flex-wrap: wrap; }
  .v2-pd-sizeoption-price { margin-left: 0; }
  .v2-pd-buy { flex-direction: column; }
  .v2-pd-qty { align-self: flex-start; }
  /* .v2-pd-addtocart's flex-basis (220px) targets width on desktop's row
     layout; in column mode that basis becomes a height, and flex-grow:1
     stretches it further — reset to content-based sizing here. */
  .v2-pd-addtocart { flex: none; width: 100%; padding: 16px 24px; }
}
