/* =====================================================================
   VELMORAS — Product Detail Page (Nike-inspired)
   Layout: vertical thumbs + big main image | product info with collapsibles
   ===================================================================== */

.pdx-breadcrumbs {
  max-width: 1280px;
  margin: 22px auto 10px;
  padding: 0 32px;
  font-size: 12px;
  color: var(--ink-dim, #757575);
}
.pdx-breadcrumbs a { color: inherit; }
.pdx-breadcrumbs a:hover { color: #111; }
.pdx-breadcrumbs strong { color: #111; font-weight: 600; }

.pdx-wrap {
  max-width: 1280px;
  margin: 0 auto 40px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 48px;
  align-items: flex-start;
  position: relative;
}

/* ================= LEFT — Gallery ================= */
.pdx-gallery {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  position: sticky;
  top: 100px;
  align-items: start;
}
/* Thumbnails column: heights auto-computed to match main image height.
   Since we enforce max 5 images in admin, no scrolling needed. */
.pdx-thumbs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  align-self: stretch;
}
.pdx-thumb {
  flex: 1 1 0;
  min-height: 0;
  width: 76px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #f5f5f5;
  border: 2px solid transparent;
  padding: 0;
  transition: border-color 0.15s;
}
.pdx-thumb:hover { border-color: #ccc; }
.pdx-thumb.active { border-color: #111; }
.pdx-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;      /* fills the thumb — admin enforces 1:1 uploads */
  display: block;
}

/* Main image container — square 1:1 (matches admin-enforced upload ratio) */
.pdx-main {
  position: relative;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: zoom-in;
}
.pdx-main-img {
  width: 100%; height: 100%;
  object-fit: cover;      /* fills the tile — no gaps, no stretch (uploads are square) */
  display: block;
}
.pdx-arrow {
  position: absolute;
  bottom: 20px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: none;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  transition: background 0.15s;
  z-index: 3;
}
.pdx-arrow:hover { background: #fff; }
.pdx-arrow svg { width: 18px; height: 18px; color: #111; }
.pdx-arrow.pdx-prev { right: 78px; }
.pdx-arrow.pdx-next { right: 20px; }

/* 360° viewer — a clean, premium stage that replaces just the main image
   area; the info panel (right column) is untouched. Frames render with
   object-fit:contain at 82% so an inconsistently-cropped source frame
   never looks more "zoomed" than its neighbors. */
.pdx-main.mode-360 {
  background: var(--cream-2, #faf5ed);
  border-radius: 18px;
}
.pdx-360-img {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 82%; height: 82%;
  object-fit: contain;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none; /* drag is handled on the stage (.pdx-main), not the image itself */
  z-index: 2;
}
.pdx-main.mode-360 { cursor: ew-resize; }
.pdx-360-toggle {
  position: absolute; top: 16px; left: 16px; z-index: 4;
  display: flex; align-items: center; gap: 6px;
  background: var(--green, #1f4a3a); border: none; border-radius: 999px;
  padding: 10px 16px; font-size: 13px; font-weight: 600; letter-spacing: 0.2px;
  color: #fff; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  transition: background 0.15s;
}
.pdx-360-toggle:hover { background: var(--green-2, #2d6a54); }
.pdx-360-toggle svg { width: 14px; height: 14px; }
.pdx-360-toggle.on { background: var(--ink, #1a1a1a); }
.pdx-360-toggle.on:hover { background: #000; }
.pdx-main.mode-360 .pdx-main-img { visibility: hidden; }
.pdx-main.mode-360 .pdx-arrow, .pdx-main.mode-360 .pdx-zoom-lens { display: none !important; }

/* Subtle "drag/swipe to rotate" hint — never sits over the product, fades
   out after the shopper's first successful drag. */
.pdx-360-instruction {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 4;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px; color: var(--ink-dim, #6b6b6b);
  background: rgba(255,255,255,0.85); padding: 5px 12px; border-radius: 999px;
  pointer-events: none; transition: opacity 0.4s ease;
}
.pdx-360-instruction.fading { opacity: 0; }

/* Hover zoom lens */
.pdx-zoom-lens {
  position: absolute;
  pointer-events: none;
  width: 200px; height: 200px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255,255,255,0.6);
  display: none;
  z-index: 2;
}
.pdx-main.is-zooming { cursor: crosshair; }
.pdx-main.is-zooming .pdx-zoom-lens { display: block; }

/* Floating zoom result panel — left offset + width are computed in JS
   (placeResultPanel in product.js), in raw pixels relative to .pdx-gallery
   (the actual positioned ancestor), so it can never render off-screen
   regardless of which side it ends up anchored to. */
.pdx-zoom-result {
  position: absolute;
  top: 0;
  height: 100%;
  background: #f5f5f5 no-repeat;
  border-radius: 8px;
  border: 1px solid #eee;
  display: none;
  z-index: 10;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  transition: left 0.1s ease;
}
.pdx-main.is-zooming ~ .pdx-zoom-result { display: block; }

/* ================= RIGHT — Info ================= */
.pdx-info {
  padding: 4px 0;
  min-width: 0;
}
.pdx-just-in {
  color: #ea580c;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.pdx-title {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #111;
  line-height: 1.25;
  margin: 0 0 4px;
  letter-spacing: -0.2px;
}
.pdx-subtitle {
  font-size: 14px;
  color: #757575;
  margin: 0 0 18px;
}
.pdx-rating-summary {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: #555; text-decoration: none;
  margin: -10px 0 16px;
  cursor: pointer;
}
.pdx-rating-summary:hover { color: var(--green, #1e5b3a); text-decoration: underline; }
.pdx-rating-summary .stars { color: #e8a628; letter-spacing: 1px; }
.pdx-stock {
  font-size: 13px; font-weight: 600; margin: 0 0 16px;
}
.pdx-highlights {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px; margin: 18px 0; padding: 16px 18px;
  background: #f9f7f3; border-radius: 10px;
}
.pdx-highlight { font-size: 12.5px; }
.pdx-highlight .hk { display: block; color: #8b6b58; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 2px; }
.pdx-highlight .hv { color: #222; font-weight: 600; }
.pdx-stock.low { color: #b5482e; }
.pdx-stock.ok { color: #1e5b3a; }
.pdx-price-row {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 4px;
}
.pdx-price {
  font-size: 18px; font-weight: 600; color: #111;
}
.pdx-compare {
  font-size: 15px; color: #757575;
  text-decoration: line-through;
}
.pdx-save {
  font-size: 13px; color: #1e5b3a; font-weight: 600;
}
.pdx-taxnote {
  font-size: 13px; color: #757575;
  margin: 0 0 22px;
}

/* Colour swatches — image tiles */
.pdx-colors-block { margin-bottom: 22px; }
.pdx-colors {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.pdx-color-tile {
  width: 60px; height: 60px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #f5f5f5;
  border: 2px solid transparent;
  padding: 0;
  transition: border-color 0.15s;
  position: relative;
}
.pdx-color-tile:hover { border-color: #ccc; }
.pdx-color-tile.on { border-color: #111; }
.pdx-color-tile img { width: 100%; height: 100%; object-fit: cover; }
.pdx-color-tile .color-swatch {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 600; text-align: center;
  padding: 4px;
}
.pdx-color-tile.disabled { opacity: 0.4; cursor: not-allowed; }
.pdx-color-tile.disabled::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 8px, rgba(0,0,0,0.08) 8px 9px);
}
.pdx-color-name {
  font-size: 13px;
  color: #111;
  margin-top: 10px;
}
.pdx-color-name span { color: #757575; }

/* Size grid */
.pdx-size-block { margin-bottom: 22px; }
.pdx-size-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.pdx-size-head strong { font-size: 15px; font-weight: 600; color: #111; }
.pdx-size-guide {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: #111; font-weight: 500;
}
.pdx-size-guide svg { width: 18px; height: 14px; }
.pdx-size-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pdx-size {
  padding: 14px 8px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
  font-size: 14px; font-weight: 500; color: #111;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pdx-size:hover { border-color: #111; }
.pdx-size.on { border-color: #111; border-width: 2px; padding: 13px 7px; }
.pdx-size.disabled { color: #ccc; border-color: #eee; cursor: not-allowed; text-decoration: line-through; }

/* Quantity */
.pdx-qty-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.pdx-qty-row label { font-size: 14px; font-weight: 500; color: #111; }
.pdx-qty {
  display: flex; align-items: center;
  border: 1px solid #ccc;
  border-radius: 100px;
  overflow: hidden;
}
.pdx-qty button {
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #111;
}
.pdx-qty button:hover { background: #f5f5f5; }
.pdx-qty input {
  width: 42px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 14px; font-weight: 500;
  color: #111;
}

/* CTAs */
.pdx-btn-primary, .pdx-btn-outline {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 18px 24px;
  border-radius: 100px;
  font-size: 15px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: none;
}
.pdx-btn-primary {
  background: #111;
  color: #fff;
  margin-bottom: 10px;
}
.pdx-btn-primary:hover { background: #333; }
.pdx-btn-outline {
  background: #fff;
  color: #111;
  border: 1px solid #ccc;
  margin-bottom: 22px;
}
.pdx-btn-outline:hover { border-color: #111; }
.pdx-btn-outline svg { width: 18px; height: 18px; }
.pdx-btn-outline.is-fav svg path { fill: #ea580c; stroke: #ea580c; }

/* Short description */
.pdx-desc {
  font-size: 15px;
  color: #111;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Delivery check */
.pdx-delivery {
  padding: 22px 0 18px;
  border-top: 1px solid #eee;
}
.pdx-delivery strong { display: block; font-size: 15px; font-weight: 600; color: #111; margin-bottom: 4px; }
.pdx-delivery-hint { font-size: 13px; color: #757575; margin: 0 0 12px; }
.pdx-pincode {
  display: flex; align-items: center;
  border: 1px solid #ccc;
  border-radius: 6px;
  overflow: hidden;
}
.pdx-pincode input {
  flex: 1;
  padding: 14px 16px;
  border: none;
  font-size: 14px;
  color: #111;
  background: transparent;
  outline: none;
}
.pdx-pincode button {
  padding: 14px 20px;
  background: transparent;
  border: none;
  border-left: 1px solid #eee;
  font-size: 14px; font-weight: 600; color: #111;
  cursor: pointer;
}

.pdx-trust-row {
  padding: 20px 0;
  border-top: 1px solid #eee;
  display: flex; flex-direction: column; gap: 14px;
}
.pdx-trust {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: #111;
}
.pdx-trust svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ================= Collapsibles ================= */
.pdx-collapse {
  border-top: 1px solid #eee;
}
.pdx-acc {
  border-bottom: 1px solid #eee;
}
.pdx-acc summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 4px;
  font-size: 15px; font-weight: 600; color: #111;
  cursor: pointer;
  list-style: none;
  gap: 12px;
}
.pdx-acc summary::-webkit-details-marker { display: none; }
.pdx-acc summary::after {
  content: '';
  width: 12px; height: 12px;
  border-right: 2px solid #111; border-bottom: 2px solid #111;
  transform: rotate(45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.pdx-acc[open] summary::after { transform: rotate(-135deg); }
.pdx-acc-body {
  padding: 0 4px 22px;
  font-size: 14px;
  color: #333;
  line-height: 1.6;
}
.pdx-acc-body p { margin: 0 0 10px; }
.pdx-acc-body ul { margin: 0 0 10px 20px; }
.pdx-acc-body li { margin-bottom: 4px; }
.pdx-spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}
.pdx-spec-table td {
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}
.pdx-spec-table td.k { color: #757575; width: 45%; padding-right: 12px; }
.pdx-spec-table td.v { color: #111; font-weight: 500; }
.pdx-spec-section-title {
  font-size: 13px; font-weight: 700; color: #111;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 16px 0 6px;
}
.pdx-spec-section-title:first-child { margin-top: 0; }
.pdx-return-note { color: #b45309; background: #fef8ea; padding: 12px 14px; border-radius: 6px; font-size: 13.5px; }

/* ================= Responsive ================= */
@media (max-width: 1024px) {
  .pdx-wrap {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    padding: 0 24px;
  }
  .pdx-gallery {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
    position: static;
    max-height: none;
  }
  .pdx-thumb { width: 58px; height: 72px; }
  .pdx-main { min-height: 420px; }
  .pdx-zoom-result { display: none !important; }
}
@media (max-width: 800px) {
  .pdx-wrap {
    grid-template-columns: 1fr;
    padding: 0 16px;
    gap: 24px;
  }
  .pdx-gallery {
    grid-template-columns: minmax(0, 1fr);
    order: 1;
  }
  .pdx-thumbs {
    order: 2;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    max-width: 100%;
    padding: 6px 0;
  }
  .pdx-thumb { width: 60px; height: 74px; }
  .pdx-main { order: 1; min-height: auto; aspect-ratio: 1 / 1; }
  .pdx-arrow { width: 40px; height: 40px; bottom: 12px; }
  .pdx-arrow.pdx-prev { right: 62px; }
  .pdx-arrow.pdx-next { right: 12px; }
  .pdx-info { order: 3; }
  .pdx-title { font-size: 20px; }
  .pdx-size-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Toast for add to cart */
.pdx-toast {
  position: fixed;
  top: 90px; right: 20px;
  background: #111;
  color: #fff;
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 1000;
  transform: translateY(-20px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}
.pdx-toast.show { transform: translateY(0); opacity: 1; }

/* ====================================================
   PRODUCT-DETAIL v2 polish — compact pro layout
   Removes empty blank space, ties sections closer.
   ==================================================== */

/* Right column becomes sticky so info stays visible while
   the tall gallery scrolls — no blank space below either side. */
@media (min-width: 1024px) {
  .pdx-wrap {
    align-items: start !important;
    gap: 40px !important;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 440px) !important;
  }
  .pdx-info {
    position: sticky !important;
    top: 100px !important;
    align-self: start !important;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 4px;   /* room for scrollbar */
    scrollbar-width: thin;
  }
  .pdx-info::-webkit-scrollbar { width: 6px; }
  .pdx-info::-webkit-scrollbar-thumb { background: rgba(30,91,58,0.25); border-radius: 4px; }

  /* Gallery: not sticky anymore — it flows naturally so its bottom aligns
     with the end of the .pdx-wrap grid, not the viewport. */
  .pdx-gallery {
    position: static !important;
    top: auto !important;
    align-self: start !important;
  }
}

/* Reduce excessive vertical padding between sections */
.pdx-wrap { margin-bottom: 32px !important; padding-top: 8px !important; }
.arrivals-section { padding-top: 12px !important; padding-bottom: 32px !important; }
.arrivals-card    { padding: 24px !important; }

/* Compact accordions inside product info */
.pdx-info details {
  border-top: 1px solid var(--line, #e8e0d5);
}
.pdx-info details summary { padding: 14px 0 !important; }

/* Single-image products: no thumbnail rail, no arrows — the gallery
   grid collapses to a single full-width column so there's no dead
   76px gap on the left where the thumb rail used to be. */
.pdx-gallery:has(.pdx-thumbs[style*="display: none"]) {
  grid-template-columns: 1fr;
}
