/* ============================================================
   Me2You - Product detail page (PDP) styles
   Extracted from app/listings/view.php inline <style> blocks.
   ============================================================ */

/* -- PDP layout ------------------------------------------ */
.pdp-wrap {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 0 32px;
  align-items: start;
}
@media (max-width: 767.98px) {
  .pdp-wrap {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* -- Breadcrumb ------------------------------------------ */
.pdp-crumbs {
  font-size: 13px;
  color: var(--ink-500);
  margin-bottom: 16px;
}
.pdp-crumbs a {
  color: var(--ink-500);
  text-decoration: none;
}
.pdp-crumbs a:hover {
  color: var(--brand-orange-700);
  text-decoration: underline;
}
.pdp-crumbs .sep {
  margin: 0 6px;
  color: var(--ink-300);
}

/* -- Gallery -------------------------------------------- */
.pdp-gallery {
  position: sticky;
  top: 80px;
}
@media (max-width: 767.98px) {
  .pdp-gallery {
    position: static;
  }
}
.pdp-main-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ink-100);
  border: 1px solid var(--ink-300);
}
.pdp-main-img-wrap.has-photos {
  cursor: zoom-in;
}
.pdp-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.pdp-main-img-wrap.has-photos:hover .pdp-main-img {
  transform: scale(1.03);
}
.pdp-main-img.is-placeholder {
  object-fit: contain;
  padding: 20%;
  opacity: 0.4;
}

/* Branded "No photo" card */
.pdp-no-photo {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-500);
  pointer-events: none;
}
.pdp-no-photo svg {
  opacity: 0.35;
}
.pdp-no-photo span {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  /* --ink-500 keeps this caption above 4.5:1 on the placeholder panel in
     both themes; --ink-300 dropped to about 1.4:1 on the dark card. */
  color: var(--ink-500);
}

/* Designed category placeholder for a listing with no photo. Matches the
   listing-card placeholder: a soft category-tinted panel carrying the
   category glyph, so the product page never shows a flat grey image.
   --cat-colour arrives via data-style-vars. Solid fallback fill for
   WebView without colour-mix; no gradient, no extra request. */
.pdp-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: var(--ink-100);
  background: color-mix(in srgb, var(--cat-colour, var(--ink-300)) 12%, var(--paper));
  color: var(--cat-colour, var(--ink-500));
}
.pdp-ph__glyph {
  width: 30%;
  max-width: 96px;
  height: auto;
  opacity: 0.9;
}
.pdp-ph__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
}

/* Thumbnail strip */
.pdp-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.pdp-thumb {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  border: 2px solid transparent;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
  /* --img arrives via data-style-vars (per-thumb image url). */
  background-image: var(--img, none);
}
.pdp-thumb:hover {
  transform: scale(1.06);
}
.pdp-thumb.is-active {
  border-color: var(--brand-orange);
}

/* -- Info column ---------------------------------------- */
.pdp-info {
  padding-top: 4px;
}
@media (max-width: 767.98px) {
  .pdp-info {
    padding-top: 20px;
  }
}

/* Title */
.pdp-title {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.25;
  color: var(--ink-900);
  margin: 0 0 8px;
}
@media (min-width: 768px) {
  .pdp-title {
    font-size: 28px;
  }
}

/* Price */
.pdp-price {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1.15;
  color: var(--ink-900);
  margin-bottom: 14px;
}
.pdp-price .currency {
  font-weight: 500;
  color: var(--ink-500);
  font-size: 0.7em;
}
@media (min-width: 768px) {
  .pdp-price {
    font-size: 36px;
  }
}
/* Pricing variants */
.pdp-price-quote-link {
  color: var(--brand-orange-700);
  text-decoration: none;
}
.pdp-price-note {
  color: var(--ink-500);
  font-size: 14px;
  margin: -6px 0 14px;
}
.pdp-price-from-label {
  font-weight: 500;
  color: var(--ink-500);
  font-size: 0.55em;
}

/* Condition pill. Modifier classes for each grade (--new, --like-new,
   --good, --fair) live in site.css so the same palette is reused on the
   listing card. Base colours below act as the fallback. */
.pdp-condition {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--ink-100);
  color: var(--ink-700);
}

/* Condition + location row */
.pdp-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

/* -- Seller card ---------------------------------------- */
.pdp-seller-card {
  background: var(--ink-50);
  border: 1px solid var(--ink-300);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 20px 0;
}
.pdp-seller-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.pdp-seller-head-text {
  min-width: 0;
}
.pdp-seller-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--brand-orange-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--brand-orange-700);
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
}
.pdp-seller-avatar .m2y-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.pdp-seller-name {
  font-weight: 700;
  color: var(--ink-900);
  font-size: 15px;
}
.pdp-seller-meta {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 2px;
  line-height: 1.5;
}
.pdp-seller-meta-sep {
  margin: 0 4px;
  color: var(--ink-300);
}
.pdp-seller-since {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 2px;
}
.pdp-seller-stars {
  color: var(--brand-orange);
  font-size: 14px;
  letter-spacing: 1px;
}
.pdp-seller-stars .empty {
  color: var(--ink-300);
}

/* Message seller button (inside seller card) */
.pdp-message-seller {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-300);
  color: var(--ink-700);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

/* Report / block seller row */
.pdp-report-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.pdp-report-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-300);
  color: var(--ink-500);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.pdp-block-form {
  flex: 1;
  margin: 0;
}
.pdp-block-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.pdp-block-btn--blocked {
  border-color: var(--brand-orange);
  color: var(--brand-orange-700);
}

/* Per-suggestion thumbnail. The url() arrives via data-style-vars (--img). */
.pdp-suggestion-thumb {
  background-image: var(--img, none);
  background-size: cover;
  background-position: center;
}

/* -- Escrow banner -------------------------------------- */
.pdp-escrow {
  background: var(--success-100);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 20px;
}
.pdp-escrow-icon {
  flex-shrink: 0;
  margin-top: 1px;
}
.pdp-escrow .lbl {
  font-weight: 700;
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.35;
}
.pdp-escrow .sub {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 3px;
  line-height: 1.45;
}

/* -- Action buttons ------------------------------------- */
.pdp-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.pdp-actions .btn-cart {
  flex: 1 1 0;
  min-width: 0;
}
.pdp-actions .btn-offer {
  flex: 0 0 auto;
}
.pdp-cart-icon {
  vertical-align: -3px;
  margin-right: 6px;
}
@media (max-width: 767.98px) {
  .pdp-actions {
    flex-direction: column;
  }
  .pdp-actions .btn-cart,
  .pdp-actions .btn-offer {
    width: 100%;
  }
}

.pdp-secondary-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.btn-wishlist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-300);
  background: var(--paper);
  color: var(--ink-500);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  padding: 0;
}
.btn-wishlist:hover {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-wishlist.is-saved {
  color: var(--danger);
  background: var(--danger-100);
  border-color: var(--danger);
}
/* -- Location pill -------------------------------------- */
.pdp-location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 6px;
}

/* -- Description ---------------------------------------- */
.pdp-desc-section {
  max-width: 780px;
}
.pdp-desc-text {
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--ink-700);
  font-size: 15px;
}
.pdp-desc-text.is-clamped {
  max-height: 6.8em;
  overflow: hidden;
  position: relative;
}
.pdp-desc-text.is-clamped::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5em;
  background: linear-gradient(transparent, var(--paper));
  pointer-events: none;
}
.pdp-read-more {
  display: inline-block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-orange-700);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.pdp-read-more:hover {
  text-decoration: underline;
}

/* -- Section headings ----------------------------------- */
.pdp-section-heading {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink-900);
  margin: 0 0 16px;
}
.pdp-section-heading.is-flush {
  margin: 0;
}
.pdp-section-heading .count {
  color: var(--ink-500);
  font-weight: 600;
}

/* Section header row (heading + "View all") */
.pdp-section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* "See all reviews" footer link */
.pdp-reviews-link {
  font-weight: 700;
  font-size: 15px;
}

/* "You might also like" and "More from <seller>" related strips.
   These use a Bootstrap .row with .col-6.col-md-3 children, so a single
   suggestion stretches to a quarter-width card stranded in a wide blank
   row, looking like a broken grid. Switch the row to an auto-fill grid so
   one card sits at its natural ~200px width on the left and multiple cards
   still flow neatly. Scoped to the related sections via the PDP headings. */
.pdp-section-heading + .row,
.pdp-section-head-row + .row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

/* Neutralise Bootstrap column sizing inside the grid so the cards size to
   the grid tracks rather than 50% / 25% of the row width. */
.pdp-section-heading + .row > [class*="col-"],
.pdp-section-head-row + .row > [class*="col-"] {
  max-width: none;
  flex: none;
  width: auto;
}

/* -- Sold overlay --------------------------------------- */
.pdp-sold-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink-100);
  border: 1px solid var(--ink-300);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-700);
  margin-bottom: 16px;
  width: 100%;
  justify-content: center;
}

/* -- Verified badge ------------------------------------- */
.pdp-verified {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 4px;
}
.pdp-verified.pdp-verified-id {
  margin-left: 2px;
}
.pdp-verified svg {
  display: block;
}

/* -- Share bar ------------------------------------------ */
.pdp-share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.pdp-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-200);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  transition: opacity 0.2s, transform 0.15s;
}
.pdp-share-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
/* Share-target colours, darkened so white text clears 4.5:1 contrast while
   staying recognisable (WhatsApp green, Facebook blue, email orange). */
.pdp-share-btn--whatsapp {
  background: #157347;
  color: #fff;
  border-color: #157347;
}
.pdp-share-btn--whatsapp:hover {
  color: #fff;
}
.pdp-share-btn--facebook {
  background: #1565C0;
  color: #fff;
  border-color: #1565C0;
}
.pdp-share-btn--facebook:hover {
  color: #fff;
}
.pdp-share-btn--twitter {
  background: #000;
  color: #fff;
  border-color: #000;
}
.pdp-share-btn--twitter:hover {
  color: #fff;
}
.pdp-share-btn--copy {
  background: var(--ink-100);
  color: var(--ink-700);
  border-color: var(--ink-300);
}
.pdp-share-btn--email {
  background: #B65F0A;
  color: #fff;
  border-color: #B65F0A;
}
.pdp-share-btn--email:hover {
  color: #fff;
}

/* Inline links in the seller card (See all reviews) need a non-colour cue. */
.pdp-seller-meta a,
.pdp-seller-rating a,
.pdp-reviews-link {
  text-decoration: underline;
}

/* Copied toast */
.pdp-copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-900);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
}
.pdp-copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   SOCIAL: likes + comments
   ============================================================ */
.pdp-social {
  max-width: 780px;
  border-top: 1px solid var(--ink-200);
  padding-top: 24px;
}
.pdp-social-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.pdp-like-form { margin: 0; }
.pdp-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--ink-300);
  background: var(--paper);
  color: var(--ink-700);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.pdp-like-btn:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange-700);
}
.pdp-like-btn.is-liked {
  background: var(--brand-orange-100);
  border-color: var(--brand-orange);
  color: var(--brand-orange-700);
}
.pdp-like-btn .count { font-variant-numeric: tabular-nums; }
.pdp-like-static {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-500);
  font-weight: 700;
  font-size: 14px;
}
.pdp-comment {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--ink-100);
}
.pdp-comment-body-wrap {
  min-width: 0;
}
.pdp-comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-orange-100);
  color: var(--brand-orange-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.pdp-comment-name {
  font-weight: 700;
  color: var(--ink-900);
  font-size: 14px;
}
.pdp-comment-date {
  color: var(--ink-500);
  font-size: 12px;
  margin-left: 6px;
}
.pdp-comment-body {
  color: var(--ink-700);
  font-size: 14px;
  line-height: 1.6;
  margin-top: 3px;
  word-break: break-word;
}
.pdp-comment-form textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-300);
  padding: 10px 12px;
  font-size: 14px;
  resize: vertical;
  min-height: 76px;
}
.pdp-comment-empty {
  color: var(--ink-500);
  font-size: 14px;
  padding: 8px 0 4px;
}
.pdp-social-signin {
  color: var(--ink-500);
  font-size: 14px;
  margin-top: 12px;
}

/* ============================================================
   Image gallery: lightbox
   ============================================================ */
.m2y-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.m2y-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}
.m2y-lightbox__img-wrap {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.m2y-lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: center center;
  transition: transform 0.1s ease;
}
.m2y-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}
.m2y-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.3);
}
.m2y-lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}
.m2y-lightbox__arrow:hover {
  background: rgba(255, 255, 255, 0.3);
}
.m2y-lightbox__arrow--left {
  left: 16px;
}
.m2y-lightbox__arrow--right {
  right: 16px;
}
.m2y-lightbox__counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
}
@media (max-width: 576px) {
  .m2y-lightbox__arrow {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
  .m2y-lightbox__arrow--left {
    left: 8px;
  }
  .m2y-lightbox__arrow--right {
    right: 8px;
  }
}

/* ============================================================
   Auction panel (PDP). Live bid box rendered when the listing
   has a row in the auctions table.
   ============================================================ */
.pdp-auction {
  border: 1px solid var(--ink-200, #e4e0db);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  background: var(--surface, #fff);
}
.pdp-auction-msg {
  margin-bottom: 12px;
}
.pdp-auction-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.pdp-auction-tag {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-700, #3b352f);
}
.pdp-auction-live,
.pdp-auction-closed {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}
.pdp-auction-live {
  background: #ddf1e4;
  color: #1e6e3e;
}
.pdp-auction-closed {
  background: #ede7e3;
  color: #5b4a40;
}
.pdp-auction-figs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 14px;
}
.pdp-auction-figs .fig .lbl {
  font-size: 12px;
  color: var(--ink-500, #8a8178);
}
.pdp-auction-figs .fig .val {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-900, #221e1a);
}
.pdp-auction-bid-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.pdp-auction-bid-row .form-control {
  flex: 1 1 auto;
}
.pdp-auction-note {
  font-size: 13px;
  color: var(--ink-500, #8a8178);
  margin: 8px 0 0;
}
.pdp-auction-outcome {
  font-size: 14px;
  color: var(--ink-700, #3b352f);
}

/* Reserve with lay-bye button spacing on the PDP. */
.pdp-laybye-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* The branded placeholder renders via listing_image_markup (a listing-card__photo),
   so size it to fill the square detail frame the same way a real seller photo
   does, instead of sitting at its intrinsic size with grey gaps around it. */
.pdp-main-img-wrap .listing-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
