:root {
  --ink: #eaf4ff;
  --blue-900: #0b1f3a;
  --blue-800: #0f2742;
  --blue-700: #14395d;
  --cyan-500: #00c6ff;
  --orange-500: var(--brand-orange-500, var(--brand-orange-500));
  --orange-400: var(--brand-orange-400, var(--brand-orange-400));
  --violet-500: #6a11cb;
  --indigo-500: #2575fc;
  --h1: 4.0000rem;
  --h2: 3.2000rem;
  --h3: 2.4000rem;
  --h4: 2.0000rem;
  --h5: 1.8000rem;
  --h6: 1.6000rem;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

/* The document is the ONLY scroller on this page. A `height: 100%` body
   (or a flex-centring body) silently turns `body` into a second scroll
   container: the window then has nothing to scroll while content gets
   clipped, which is what made the page jump straight to the reviews and
   refuse to scroll back up. Keep body a plain block that grows. */
body {
  font-family: "poppins", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.4999rem;
  background-color: var(--neutral-50);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  display: block;
  position: relative;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  transition: 0.5s ease;
  font-family: poppins, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
a {
  cursor: default;
  text-decoration: none;
}
/* Light backdrop so the detail pages sit on the same airy var(--neutral-50) theme as
   the rest of the site — brand colours appear as soft blurred glows instead
   of a heavy dark gradient. */
.backdrop {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  background: linear-gradient(160deg, #f7fafc 0%, #eef4f9 45%, #e3edf6 100%);
}

.backdrop .orb1,
.backdrop .orb2,
.backdrop .orb3 {
  width: 380px;
  height: 380px;
  border-radius: 50%;
  position: absolute;
  animation: pop 6s both infinite alternate;
  opacity: 0.45;
  filter: blur(70px);
  pointer-events: none;
}

@keyframes pop {
  from {
    scale: 0.9;
  }
  to {
    scale: 1.1;
  }
}

.orb1 {
  background: radial-gradient(circle, rgba(255, 122, 0, 0.4), rgba(255, 122, 0, 0) 70%);
  right: -40px;
  top: 40px;
}

.orb2 {
  background: radial-gradient(circle, rgba(37, 117, 252, 0.35), rgba(37, 117, 252, 0) 70%);
  top: 100px;
  left: -60px;
}

.orb3 {
  background: radial-gradient(circle, rgba(0, 198, 255, 0.3), rgba(0, 198, 255, 0) 70%);
  top: 55%;
  right: 10%;
}

/* Normal flow: `position: absolute` + `height: 100%` took `main` out of the
   document so its content could never grow the page (no scrollbar, content
   clipped below the fold). Relative + intrinsic height lets the page scroll
   from the product card all the way to the last layer. */
main {
  width: 100%;
  height: auto;
  min-height: 100vh;
  position: relative;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 40px;
  justify-content: start;
}

main .layer1 {
  width: 100%;
  height: auto;
  min-height: 720px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 10px 10px 28px;
  gap: 10px;
  background: white;
  box-shadow: 0 12px 32px rgba(2, 42, 70, 0.12);
  border: 1px solid rgba(15, 39, 66, 0.14);
  border-radius: 16px;
}

.layer1 .imageContainer,
.layer1 .productSummary {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

.layer1 .imageContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  min-height: 520px;
  height: auto;
}

.imageContainer .mainImage {
  width: 100%;
  height: 80%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--blue-800);
}

.mainImage:hover img {
  transform: scale(1.1);
}

.mainImage img {
  height: 100%;
  width: 100%;
  object-fit: contain;
  object-position: center;
  /* background-color: var(--neutral-200);   */
}

.imageContainer .thumbnails {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 5px;
  width: 100%;
  height: 150px;
  overflow-y: hidden;
  max-width: 675px;
  border-radius: 8px;

  scrollbar-width: thin;
}

.thumbnails .thumbnail {
  width: 100%;
  height: 100%;
  display: flex;

  align-items: center;
  border: 1px solid var(--blue-800);
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.mainImage:hover img,
.thumbnail:hover img {
  transform: scale(1.1);
}

.layer1 .productSummary {
  height: auto;
  display: flex;
  align-items: start;
  justify-content: start;
  gap: 10px;
  flex-direction: column;
  padding: 10px;
  border-radius: 8px;
}

.productSummary .productName {
  width: 100%;

  span {
    font-size: var(--h2);
    font-weight: bold;
    color: var(--blue-800);
  }
}

.productSummary .productPrice {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;

  .Pprice {
    width: 100%;
    font-size: var(--h4);
  }

  .Pprice span {
    font-weight: bold;
  }

  /* Price negotiable tag beside the detail-page price. */
  .neg-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 12px;
    vertical-align: middle;
    font-size: 1.1500rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #d95f00;
    background: rgba(255, 127, 17, 0.12);
    border: 1px solid rgba(255, 127, 17, 0.45);
    padding: 4px 10px;
    border-radius: 999px;
  }

  /* Original (pre-discount) price — faded grey with strikethrough so new price pops */
  .price-orig {
    color: #b4bcd0;
    text-decoration: line-through;
    text-decoration-color: #c8cdd6;
    text-decoration-thickness: 1.5px;
    font-weight: 400;
    font-size: 0.8em;
    margin-right: 4px;
    opacity: 0.65;
  }

  /* Current (discounted) price beside it — bold, high contrast */
  .Pprice span:not(.price-orig):not(.discount-tag):not(.neg-tag) {
    color: var(--orange-500);
    font-weight: 800;
    font-size: 1.2em;
  }

  /* Discount badge ("15% OFF" / "Save GH₵200") */
  .discount-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.35);
    color: var(--danger-600, var(--danger-600));
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: middle;
    animation: discountPop 0.35s ease both;
  }

  @keyframes discountPop {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
  }
}

.productPrice svg {
  width: 29px;
  height: 29px;
  fill: var(--ink);

  border-radius: 5px;
  padding: 1px;
}

.productPrice .watchlist {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  overflow: hidden;
  gap: 10px;
  padding: 5px;
  border-radius: 12px;
  background: var(--blue-800);
  cursor: pointer;
}

.watchlist .text {
  white-space: nowrap;
  font-size: var(--h6);
  color: var(--ink);
  display: none;
}

.productPrice .watchlist:hover .text {
  display: inline-block;
}
.productPrice .watchlist:hover {
  width: 180px;
}

.productSummary .productDescription {
  font-size: var(--h5);
  font-weight: 400;
  color: var(--blue-900);
  line-height: 30px;
}

.productSummary .productOwner {
  display: flex;
  background: #f4f4f4;
  align-items: center;
  border-radius: 8px;
  padding: 2px 12px;
  justify-content: center;

  column-gap: 15px;
  backdrop-filter: blur(8px);
}

.productOwner .uDetails:nth-child(1) {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  overflow: hidden;
}

.uDetails img {
  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;
}

.uDetails .uname {
  display: flex;
  align-items: start;
  justify-content: start;
  flex-direction: column;
  line-height: 16px;
  font-size: var(--h6);
  color: var(--blue-900);
  font-weight: 500;
}

.uname span:nth-child(2) {
  font-size: 1.2000rem;
  color: var(--orange-400);
}

.uname span.joined {
  font-size: 1.0000rem;
  color: var(--blue-900);
}

.msg-btn {
  border: none;
  background: linear-gradient(45deg, var(--blue-700), var(--indigo-500));
  padding: 10px;
  border-radius: 5px;
  width: 100%;
  cursor: pointer;
  color: var(--white);
  font-weight: 600;
  display: block;
  margin: 4px 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  font-size: 1.3001rem;
  border: 1px solid rgba(255, 255, 255, 0.2);

  a {
    text-decoration: none;
    color: white;
    font-size: 1.3001rem;
    font-weight: 600;
    background: none;
    padding: 3px;
    border-radius: 8px;
    cursor: pointer;
  }
}

.msg-btn {
  background: linear-gradient(45deg, var(--cyan-500), var(--indigo-500));
}

.msg-btn:hover,
#reportSellerBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  opacity: 0.95;
}

.ctaSection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.buyButton {
  button {
    font-size: var(--h6);
    color: var(--blue-800);
    font-weight: 600;
    border-radius: 8px;
    background: linear-gradient(45deg, var(--cyan-500), var(--blue-800));
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: white;
    padding: 8px 15px;
    gap: 5px;
    cursor: pointer;

    svg {
      width: 28px;
      height: 28px;
    }
  }
}

.buyButton button:hover {
  animation: none;
  transform: scale(0.9);
  box-shadow: 2px 10px 15px var(--cyan-500), 2px 10px 14px var(--blue-800);
}

.productInformation {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
}

.productInfo {
  display: flex;
  align-items: start;
  justify-content: center;
  padding: 5px;

  flex-direction: column;
  border-radius: 8px;
}

.productInfo .info {
  font-size: 1.4999rem;
  font-weight: 500;
  padding: 10px;
  background: white;
  border-radius: 50px;

  span {
    font-weight: 600;
    color: var(--orange-500);
  }
}

.productInformation .report {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.caution span {
  font-size: 1.3001rem;
  font-weight: 600;
  color: var(--blue-800);
}

.layer2 {
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-top: 8px;
}

.productComments {
  width: 1fr;
  height: auto;
  display: grid;
  grid-auto-rows: 2fr;
  gap: 10px;
  grid-auto-columns: 1fr;
  grid-template-areas:
    "c c c u"
    "c c c u";
}

.productComments .comments {
  grid-area: c;
  background: white;
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  padding: 10px;
  overflow: visible;
  gap: 10px;
  justify-content: start;
  border-radius: 10px;
  flex-direction: column;
}

.productComments .userContainer {
  grid-area: u;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  
  background: white;
  box-shadow: 1px 1px 2px var(--blue-800);
  padding: 10px;
  border-radius: 10px;
}
.userContainer .productOwner {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  height: 100%;
}

.productOwner .userInfo {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 10px;
  width: 100%;
}

.uDetails .report {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.caution {
  width: 100%;
  display: flex;
  align-items: start;
  height: 100%;
  justify-content: start;
  flex-direction: column;
  gap: 10px;
}

.caution p {
  font-size: var(--h6);
  color: var(--blue-900);
  font-weight: 600;
}

.caution ol {
  display: flex;
  align-items: start;
  list-style: none;
  font-size: var(--h6);
  font-weight: 500;
  color: var(--orange-500);
  justify-content: center;
  flex-direction: column;
}

.CommentsCont {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  gap: 5px;
  max-height: 280px;
  
}

.commentInput {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
}

.commentInput .inputField {
  width: 100%;
  height: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.inputField textarea {
  width: 100%;
  height: 45px;
  resize: none;
  border-radius: 8px;

  font-size: 1.4999rem;
  padding: 8px;
  font-weight: 500;
  color: var(--blue-700);
  outline: none;
}

.inputField textarea::placeholder {
  font-size: var(--h6);
  font-weight: 600;
  color: var(--blue-800);
}


.comment {
  display: flex;
  width: 100%;
  align-items: start;
  justify-content: center;
  flex-direction: column;
  border-radius: 8px;
  max-width: 475px;
}
/* Optimistic review card while the server confirms the post. */
.comment.pending-review { opacity: 0.75; animation: pendingPulse 1.4s ease-in-out infinite; }
@keyframes pendingPulse { 50% { opacity: 0.5; } }
.pending-badge {
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 99px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.6800rem;
  font-weight: 700;
  vertical-align: middle;
}

.comment:hover {
  transform: translateY(-7px);
  box-shadow: 2px 8px 14px var(--orange-500), 2px 8px 13px var(--blue-700);
}

.comment .commentData {
  display: flex;
  align-items: start;
  justify-content: start;
  gap: 10px;
  width: 100%;
  padding: 10px;
}

.commentData .userImage {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
}

.userImage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.commentData .userDet {
  display: flex;
  align-items: start;
  justify-content: start;
  flex-direction: column;
}

.commentData span.reviewComment {
  display: -webkit-box;
  width: 465px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  text-overflow: ellipsis;
  overflow: hidden;

  -webkit-box-orient: vertical;
}

.inputField button {
  width: 80px;
  height: 40px;
  background: linear-gradient(45deg, var(--blue-800), var(--violet-500));
  color: white;
  font-size: var(--h6);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.inputField button:hover {
  transform: scale(0.9);
  box-shadow: 2px 10px 15px var(--blue-800), 2px 10px 14px var(--violet-500);
}

.commentData:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.userInformation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.commentData .userDet .userName span {
  font-size: var(--h6);
  color: var(--blue-900);
  font-weight: 600;
}

.commentData .userDet {
  line-height: 15px;
}

.commentData .userDet .userRole span {
  font-size: 1.3001rem;
  color: var(--orange-500);
  font-weight: 500;
}

/* ---- Reviews upgrade (F9): histogram, verified badge, photos ---- */

.review-histogram {
  width: 100%;
  max-width: 520px;
  margin: 4px auto 12px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 39, 66, 0.1);
  border-radius: 12px;
  background: rgba(15, 39, 66, 0.03);
}

.hist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}

.hist-label {
  flex: 0 0 42px;
  font-size: 1.2500rem;
  font-weight: 600;
  color: var(--blue-800);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.hist-label .ic-star {
  color: #f59e0b;
}

.hist-bar {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 39, 66, 0.1);
  overflow: hidden;
}

.hist-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.hist-count {
  flex: 0 0 24px;
  text-align: right;
  font-size: 1.2000rem;
  color: var(--blue-700);
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 1.1001rem;
  font-weight: 600;
  color: #0d9e63;
  background: rgba(13, 158, 99, 0.12);
  white-space: nowrap;
  vertical-align: 2px;
}

.review-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 2px;
}

.review-photo {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(15, 39, 66, 0.12);
}

.review-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comment-photo-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.photo-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px dashed rgba(15, 39, 66, 0.35);
  border-radius: 8px;
  font-size: 1.2500rem;
  font-weight: 600;
  color: var(--blue-800);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.photo-pick-btn:hover {
  border-color: var(--orange-500);
  color: var(--orange-500);
}

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-preview {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(15, 39, 66, 0.15);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  line-height: 14px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: var(--white);
  font-size: 1.2000rem;
  cursor: pointer;
}

.layer3 {
  width: 100%;
  margin-top: 20px;
  border-radius: 16px;
  background-color: white;
  border: 1px solid rgba(15, 39, 66, 0.14);
  box-shadow: 0 12px 32px rgba(2, 42, 70, 0.12);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.list {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  flex-direction: column;
  height: auto;
  min-height: 300px;
  position: relative;
  border-radius: 18px;
  width: 220px;
  min-width: 220px;
  flex: 0 0 220px;
  border: 1.5px solid var(--line);
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 10px 24px rgba(11, 31, 49, 0.1);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  scroll-snap-align: start;
}

.list:hover {
  transform: translateY(-8px);
  border-color: var(--brand-orange-200, #ffb463);
  box-shadow: 0 26px 52px rgba(11, 31, 49, 0.2), 0 0 0 1.5px rgba(255, 138, 43, 0.4), 0 12px 34px rgba(255, 138, 43, 0.2);
}

.list .chip-cnt {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: flex-start;
  color: var(--white);
  overflow: hidden;
}

.chip-cnt .chip {
  background: rgba(1, 42, 70, 0.85);
  color: var(--white);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.6800rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: default;
  transition: 0.2s ease;
  flex-shrink: 0;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip:hover {
  background: rgba(1, 42, 70, 0.95);
  color: var(--white);
}

.list .image-p {
  width: 100%;
  height: 170px;
  background: #eef3f9;
  overflow: hidden;
  flex: none;
}

.image-p img:hover {
  transform: scale(1.06);
}

.image-p img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  object-position: center;
}

.product-data {
  width: 100%;
  height: auto;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-direction: column;
  gap: 8px;
  padding: 15px 16px 18px;
  background: var(--white);
}

.list .product-h {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  font-size: 1.4000rem;
}

.list .product-h span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.1200rem;
  color: #0b1f31;
  font-weight: 600;
  letter-spacing: 0;
}

.list .product-h svg {
  fill: #0b1f31;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  cursor: pointer;
  height: 20px;
  flex-shrink: 0;
}

.list .product-d {
  color: #6b7d95;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  padding: 0;
  font-size: 0.8599rem;
  line-height: 1.5;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
}

.list .product-f {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  margin-top: auto;
  color: #0b1f31;
}

.product-f .price {
  font-size: 1.2500rem;
  color: var(--brand-orange-400, var(--brand-orange-400));
  font-weight: 700;
}

.product-f .view-btn {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  font-size: 0.9001rem;
  color: #6b7d95;
}

.layer3 {
  padding: 10px;
}

/*
 * The card strips (.sProducts/.oAds) are width:100%; max-width:1270px. On a
 * phone that 1270px "cap" becomes the strip's minimum intrinsic width, and
 * .detail-sec — a flex item with the default min-width:auto — refuses to
 * shrink below it. The whole page then balloons to ~1299px and every card
 * escapes the viewport. Let the strip's parents shrink so the overflow stays
 * clipped inside the strip's own overflow-x:auto instead.
 */
.layer3 .detail-sec,
.layer4 .ownersAds {
  min-width: 0;
  flex: 1 1 auto;
}

.layer3 .detail-sec h1,
.layer4 .ownersAds h1 {
  font-size: var(--h1);
  color: var(--blue-900);
  padding: 10px;
}

.no-similar,
.no-ads {
  width: 100%;
  text-align: center;
  color: var(--blue-900);
  font-size: 1.8000rem;
  font-weight: 600;
  padding: 30px 10px;
  background: rgba(15, 39, 66, 0.08);
  border: 1px dashed var(--blue-700);
  border-radius: 12px;
}

.detail-sec .sProducts,
.layer4 .oAds {
  display: flex;
  align-items: start;
  justify-content: start;
  gap: 12px;
  width: 100%;
  max-width: 1270px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 6px 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--brand-orange-500, var(--brand-orange-500)) #f2f6fa;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
}

.detail-sec .sProducts::-webkit-scrollbar,
.layer4 .oAds::-webkit-scrollbar {
  height: 8px;
}

.detail-sec .sProducts::-webkit-scrollbar-track,
.layer4 .oAds::-webkit-scrollbar-track {
  background: rgba(15, 39, 66, 0.08);
  border-radius: 999px;
}

.detail-sec .sProducts::-webkit-scrollbar-thumb,
.layer4 .oAds::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--brand-orange-500, var(--brand-orange-500)), #2575fc);
  border-radius: 999px;
}


.productReport {
  width: 100%;
  height: auto;
  margin-top: 20px;
  border-radius: 16px;
  padding: 10px;
  background: white;
  border: 1px solid rgba(15, 39, 66, 0.14);
  box-shadow: 0 12px 32px rgba(2, 42, 70, 0.12);
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: start;
}

.productReport .header span {
  font-size: var(--h1);
  color: var(--blue-800);
  font-weight: 600;
}

.productReport .reportContent {
  width: 100%;
}

.reportContent form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: end;
  justify-content: end;
  gap: 10px;
}

.reportContent form textarea {
  width: 100%;
  height: 120px;
  resize: none;
  margin-top: 10px;
  border-radius: 8px;
  padding: 5px;
}

.reportContent form button {
  width: 10%;
  height: 40px;
  background: linear-gradient(45deg, var(--blue-900), var(--violet-500));
  color: white;
  padding: 10px;
  margin: 5px;
  font-size: 1.4999rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.reportContent form button:hover {
  transform: scale(0.9);
  box-shadow: 2px 10px 15px var(--blue-900), 2px 10px 14px var(--violet-500);
}

.layer4 {
  background: white;
  width: 100%;
  padding: 10px;
  height: auto;

  margin: 20px 0;
  border-radius: 16px;
  border: 1px solid rgba(15, 39, 66, 0.14);
  box-shadow: 0 12px 32px rgba(2, 42, 70, 0.12);
}

.layer4 .ownersAds h1 {
  font-size: var(--h1);
  color: var(--blue-900);
  font-weight: 700;
  padding: 10px;
}

.layer4 .oAds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 16px 18px 20px;
}

/* ============================================================
   Ads By Username — Complete card restyle
   ============================================================ */
.oa-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid rgba(15, 39, 66, 0.1);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 4px 16px rgba(11, 31, 49, 0.06);
}
.oa-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 138, 43, 0.4);
  box-shadow: 0 16px 40px rgba(11, 31, 49, 0.14), 0 0 0 2px rgba(255, 138, 43, 0.15);
}

/* Image area */
.oa-card-img {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, #eef3f9, #dde7f2);
}
.oa-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.oa-card:hover .oa-card-img img {
  transform: scale(1.06);
}
.oa-card-price {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: linear-gradient(135deg, #0b2b46, #14395d);
  color: var(--white);
  font-size: 0.8500rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.02em;
}

/* Body area */
.oa-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 16px;
}
.oa-card-title {
  font-size: 0.9200rem;
  font-weight: 600;
  color: #0b1f3a;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oa-card-desc {
  font-size: 0.7801rem;
  color: #6b7d95;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oa-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 39, 66, 0.06);
}
.oa-card-condition,
.oa-card-region {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7200rem;
  font-weight: 500;
  color: #5a7a94;
  background: rgba(15, 39, 66, 0.04);
  padding: 3px 9px;
  border-radius: 6px;
}
.oa-card-condition svg,
.oa-card-region svg {
  opacity: 0.55;
  flex-shrink: 0;
}

/* Button Pulse Animation */
.buyProduct {
  position: relative;
  overflow: hidden;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(20, 57, 93, 0.4);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(20, 57, 93, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(20, 57, 93, 0);
  }
}

/* Main Image Cursor */
.mainImage img {
  cursor: zoom-in;
  transition: opacity 0.2s ease-in-out, transform 0.3s ease;
}

.mainImage img:hover {
  transform: scale(1.02);
}

/* Popup Overlay */
.image-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 26, 42, 0.9); /* Matching your --blue-900 */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(8px);
}

.image-popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Popup Content */
.popup-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  transform: scale(0.8);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-popup-overlay.active .popup-content {
  transform: scale(1);
}

.popup-content img {
  width: 100%;
  height: 90%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Close Button */
.close-popup {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 35px;
  cursor: pointer;
  font-weight: bold;
  transition: color 0.2s;
}

.close-popup:hover {
  color: var(--orange-500); /* Matching your theme's accent */
}

.posted {
  font-size: 1.3001rem;
  color: var(--blue-800);
  font-weight: 600;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.posted button {
  padding: 8px 16px;
  background: linear-gradient(45deg, var(--cyan-500), var(--indigo-500));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.3001rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.posted button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 198, 255, 0.3);
}

.posted button:active {
  transform: translateY(0);
}

.share-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.share-detail-btn svg {
  flex-shrink: 0;
}

.commentInput .inputField div {
  width: auto;
  height: 40px;
  
  border-radius: 8px;
}

.commentInput .inputField div select {
  width: 100px;
  height: 100%;
  padding: 1px;
  font-size: 1.4000rem;
  outline: none;
  border: 1px solid var(--indigo-500);
  border-radius: 5px;
}

.commentInput .inputField div select:focus{
  box-shadow: 2px 4px 8px #000;
  transform: translateY(-2px);
  border: none;
}

/* ============ MARKET ANALYTICS LAYER ============ */
.layer-market {
  width: 100%;
  margin-top: 20px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid rgba(15, 39, 66, 0.14);
  box-shadow: 0 12px 32px rgba(2, 42, 70, 0.12);
  overflow: visible;
}

.market-analytics-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  background: linear-gradient(135deg, rgba(37, 117, 252, 0.06), rgba(106, 17, 203, 0.04));
  border-bottom: 1px solid rgba(15, 39, 66, 0.08);
}

.market-analytics-header svg {
  color: var(--indigo-500, #2575fc);
  flex-shrink: 0;
}

.market-analytics-header span {
  font-size: 1.8000rem;
  font-weight: 700;
  color: var(--blue-900, #0b1f3a);
  letter-spacing: 0.02em;
}

.market-analytics-body {
  display: grid;
  /* The trend column now carries the graph AND the change timeline, so it
     takes the extra width; market position stays readable at 0.8fr. */
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 20px;
  padding: 20px 22px;
}

.market-ph-wrap,
.market-mi-wrap {
  min-width: 0;
}

.market-ph-wrap .ph-label {
  font-size: 1.3001rem;
  font-weight: 700;
  color: var(--blue-800, #0f2742);
  margin-bottom: 12px;
}

/* Override market insights internal card to blend into the layer */
.market-mi-wrap .mi-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.market-mi-wrap .mi-label {
  font-size: 1.3001rem;
  font-weight: 700;
  color: var(--blue-800, #0f2742);
  margin-bottom: 12px;
}

.market-mi-wrap .mi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.market-mi-wrap .mi-stat {
  background: rgba(15, 39, 66, 0.04);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.market-mi-wrap .mi-val {
  font-size: 1.4000rem;
  font-weight: 800;
  color: var(--blue-900, #0b1f3a);
}

.market-mi-wrap .mi-key {
  font-size: 0.7500rem;
  color: var(--neutral-500, var(--neutral-500));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.market-mi-wrap .mi-deal {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.8800rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.market-ph-wrap .ph-empty {
  text-align: center;
  color: var(--neutral-400, var(--neutral-400));
  font-size: 0.9200rem;
  padding: 16px;
}

/* Dark mode */
[data-theme="dark"] .layer-market {
  background: #121a2b;
  border-color: #263449;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .market-analytics-header {
  background: linear-gradient(135deg, rgba(37, 117, 252, 0.1), rgba(106, 17, 203, 0.06));
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .market-analytics-header svg {
  color: #5a9bff;
}

[data-theme="dark"] .market-analytics-header span {
  color: #e8eef7;
}

[data-theme="dark"] .market-ph-wrap .ph-label,
[data-theme="dark"] .market-mi-wrap .mi-label {
  color: #e8eef7;
}

[data-theme="dark"] .market-mi-wrap .mi-stat {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .market-mi-wrap .mi-val {
  color: #e8eef7;
}

[data-theme="dark"] .market-mi-wrap .mi-key {
  color: #93a4bb;
}

[data-theme="dark"] .market-ph-wrap .ph-empty {
  color: #71849c;
}

/* =============================================
   GROUP DEALS LAYER
   ============================================= */
.layer-group-deals {
  width: 100%;
  margin-top: 20px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid rgba(15, 39, 66, 0.14);
  box-shadow: 0 12px 32px rgba(2, 42, 70, 0.12);
  overflow: hidden;
}

.group-deals-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.06), rgba(16, 185, 129, 0.04));
  border-bottom: 1px solid rgba(15, 39, 66, 0.08);
}

.group-deals-header svg {
  color: var(--emerald-500, #22c55e);
  flex-shrink: 0;
}

.group-deals-header span {
  font-size: 1.8000rem;
  font-weight: 700;
  color: var(--blue-900, #0b1f3a);
  letter-spacing: 0.02em;
}

.group-deals-body {
  padding: 20px 22px;
}

/* Override group-buy card internal styling to blend into layer */
.gb-wrap .gb-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.gb-wrap .gb-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.4000rem;
  font-weight: 700;
  color: var(--blue-800, #0f2742);
  margin-bottom: 10px;
}

.gb-wrap .gb-header svg {
  color: var(--emerald-500, #22c55e);
}

.gb-wrap p {
  color: var(--neutral-500, var(--neutral-500));
  font-size: 0.9200rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.gb-wrap .gb-create-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gb-wrap .gb-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gb-wrap .gb-form-row label {
  font-size: 0.8800rem;
  font-weight: 600;
  color: var(--blue-800, #0f2742);
  min-width: 120px;
}

.gb-wrap .gb-form-row input {
  flex: 1;
  max-width: 160px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(15, 39, 66, 0.15);
  background: rgba(15, 39, 66, 0.03);
  font-size: 0.9200rem;
  color: var(--blue-900, #0b1f3a);
}

.gb-wrap .gb-form-row input:focus {
  outline: 2px solid var(--emerald-500, #22c55e);
  border-color: transparent;
}

.gb-wrap .btn-primary {
  align-self: flex-start;
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #10b981);
  color: var(--white);
  font-weight: 600;
  font-size: 0.9200rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.gb-wrap .btn-primary:hover {
  opacity: 0.9;
}

.gb-wrap .alert {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8500rem;
}

.gb-wrap .alert.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Dark mode */
[data-theme="dark"] .layer-group-deals {
  background: #121a2b;
  border-color: #263449;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .group-deals-header {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.06));
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .group-deals-header svg {
  color: #4ade80;
}

[data-theme="dark"] .group-deals-header span {
  color: #e8eef7;
}

[data-theme="dark"] .gb-wrap .gb-header {
  color: #e8eef7;
}

[data-theme="dark"] .gb-wrap .gb-header svg {
  color: #4ade80;
}

[data-theme="dark"] .gb-wrap p {
  color: #93a4bb;
}

[data-theme="dark"] .gb-wrap .gb-form-row label {
  color: #c5d0dc;
}

[data-theme="dark"] .gb-wrap .gb-form-row input {
  background: rgba(255, 255, 255, 0.04);
  border-color: #384d65;
  color: #e8eef7;
}

[data-theme="dark"] .gb-wrap .btn-primary {
  background: linear-gradient(135deg, #16a34a, #059669);
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
  .market-analytics-body {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .market-analytics-header {
    padding: 12px 16px;
  }
  .market-analytics-header span {
    font-size: 1.4999rem;
  }
  .market-mi-wrap .mi-row {
    grid-template-columns: 1fr 1fr;
  }
  .group-deals-header {
    padding: 12px 16px;
  }
  .group-deals-header span {
    font-size: 1.4999rem;
  }
  .group-deals-body {
    padding: 16px;
  }
  .gb-wrap .gb-form-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .gb-wrap .gb-form-row input {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .market-analytics-body {
    padding: 12px;
    gap: 14px;
  }
  .market-mi-wrap .mi-row {
    grid-template-columns: 1fr;
  }
  .group-deals-body {
    padding: 12px;
  }
}

/* ============ RESPONSIVE ============ */

/* Tablet & down */
@media (max-width: 900px) {
  :root {
    --h1: 3.0000rem;
    --h2: 2.6000rem;
    --h3: 2.1001rem;
    --h4: 1.8000rem;
    --h5: 1.6000rem;
    --h6: 1.4000rem;
  }

  main {
    padding: 12px;
  }

  main .layer1 {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .layer1 .imageContainer {
    width: 100%;
    height: auto;
  }

  .imageContainer .mainImage {
    height: 340px;
  }

  .layer1 .productSummary {
    width: 100%;
  }

  .productComments {
    grid-template-areas: "c" "u";
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    height: auto;
  }

  .productComments .comments,
  .productComments .userContainer {
    height: auto;
  }

  .CommentsCont {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .layer4 {
    margin: 10px 0;
  }

  .detail-sec .sProducts,
  .layer4 .oAds {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }
}

/* Mobile */
@media (max-width: 640px) {
  main {
    padding: 8px;
  }

  .imageContainer .mainImage {
    height: 260px;
  }

  .imageContainer .thumbnails {
    height: 100px;
  }

  .productSummary .productName span {
    font-size: var(--h2);
  }

  .productSummary .productDescription {
    font-size: var(--h6);
    line-height: 24px;
  }

  .productPrice .watchlist {
    width: 34px;
    height: 34px;
  }

  .ctaSection {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .buyButton button {
    width: 100%;
    font-size: var(--h6);
  }

  .posted {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .posted button {
    width: 100%;
  }

  .layer3 .detail-sec h1,
  .layer4 .ownersAds h1 {
    font-size: 2.2000rem;
  }

  .commentData span.reviewComment {
    width: 100%;
  }

  .commentInput .inputField {
    flex-direction: column;
    align-items: stretch;
  }

  .inputField textarea {
    height: 60px;
  }

  .inputField button {
    width: 100%;
  }
}

/* Small mobile */
@media (max-width: 400px) {
  .imageContainer .mainImage {
    height: 220px;
  }

  .imageContainer .thumbnails {
    height: 80px;
  }

  .productInformation .productInfo .info {
    font-size: 1.3001rem;
    padding: 7px 10px;
  }

  .productOwner .userInfo {
    flex-wrap: wrap;
  }

  .productReport .header span {
    font-size: 2.4000rem;
  }
}

/* ===== Owner card + report section polish (phones) ===== */
@media (max-width: 640px) {
  .productComments .userContainer {
    padding: 16px;
  }

  .productOwner .uDetails:nth-child(1) {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
  }

  .productOwner .userInfo {
    align-items: center;
  }

  .caution {
    background: rgba(255, 122, 0, 0.07);
    border: 1px solid rgba(255, 122, 0, 0.28);
    border-radius: 12px;
    padding: 12px;
    margin: 2px 0;
  }

  /* The four owner actions (Message / Profile / Report user / Report
     product) become a tidy 2x2 grid instead of squeezing into one row. */
  .uDetails .report {
    flex-wrap: wrap;
    gap: 8px;
  }

  .uDetails .report > * {
    flex: 1 1 calc(50% - 8px);
    min-width: 120px;
  }

  .msg-btn {
    width: 100%;
    font-size: 1.2000rem;
    padding: 10px 6px;
  }

  .msg-btn a {
    font-size: 1.2000rem;
  }

  /* Bottom product-report form: full-width button on phones */
  .reportContent form {
    align-items: stretch;
  }

  .reportContent form button {
    width: 100%;
    margin: 5px 0;
  }

  .reportContent form textarea {
    height: 100px;
  }
}



/* ===== Verified seller badge (owner card) ===== */
.owner-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
  margin-left: 6px;
  color: #1d8cf8;
  font-size: 0.7200rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(29, 140, 248, 0.1);
  border: 1px solid rgba(29, 140, 248, 0.35);
  padding: 2px 9px;
  border-radius: 999px;
}

.owner-verified.hidden {
  display: none;
}

/* ===== Delivery row in the summary ===== */
.del-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.8000rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-right: 6px;
}

.del-badge.on {
  color: #0f8a4d;
  background: rgba(31, 191, 117, 0.12);
  border: 1px solid rgba(31, 191, 117, 0.4);
}

.del-badge.off {
  color: #6b7d95;
  background: rgba(107, 125, 149, 0.1);
  border: 1px solid rgba(107, 125, 149, 0.3);
}

.del-badge.yango {
  color: #c2410c;
  background: rgba(255, 138, 43, 0.12);
  border: 1px solid rgba(255, 138, 43, 0.4);
}

.del-badge.eta {
  color: #0b5cad;
  background: rgba(46, 132, 255, 0.1);
  border: 1px solid rgba(46, 132, 255, 0.35);
}

/* ===== Delivery modal: regions + estimated time details ===== */
.delivery-details {
  margin-top: 4px;
  background: #f5f9fc;
  border: 1px solid #e2ebf4;
  border-radius: 12px;
  padding: 12px 14px;
}

.delivery-eta-line,
.delivery-regions-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0;
  font-size: 0.9200rem;
  color: #33475f;
}

.delivery-eta-line b,
.delivery-regions-line b {
  color: #16283e;
  font-weight: 700;
  white-space: nowrap;
}

.delivery-region-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dchip {
  background: var(--white);
  border: 1px solid #d5e2ee;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.7801rem;
  font-weight: 600;
  color: #1f3a5f;
}

.dchip.all {
  background: rgba(31, 191, 117, 0.1);
  border-color: rgba(31, 191, 117, 0.4);
  color: #0f8a4d;
}

/* ===== Attribute chips (dynamic fields from the sell form) ===== */
.detail-extra {
  margin-top: 14px;
}

.attr-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 9px;
  /* Full width of the card, and chips may never overflow it. */
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.attr-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 0.8199rem;
  color: #24344a;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.attr-chip b {
  flex: 0 0 auto;
  font-weight: 600;
  color: #06426e;
  font-size: 0.7401rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Values wrap in full — long ones are never truncated. */
.attr-chip i {
  flex: 1 1 auto;
  min-width: 0;
  font-style: normal;
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible;
  text-overflow: clip;
}

/* Attribute chips are LINKS now (click → marketplace filtered by that
   attribute), so they need the link reset + a visible hover affordance. */
a.attr-chip {
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

a.attr-chip:hover,
a.attr-chip:focus-visible {
  border-color: var(--brand-orange-400, var(--brand-orange-400));
  background: var(--neutral-50);
  outline: none;
}

a.attr-chip:hover i {
  color: #b45309;
}

[data-theme="dark"] a.attr-chip:hover,
[data-theme="dark"] a.attr-chip:focus-visible {
  background: rgba(255, 138, 43, 0.18);
  border-color: var(--brand-orange-400, var(--brand-orange-400));
}

/* ===== Delivery button (next to Contact Seller) ===== */
/* Extends the existing .ctaSection rule — keeps its space-between layout,
   wraps on narrow screens and gives both buttons equal flex columns. */
.ctaSection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.buyButton,
.offerButton,
.escrowButton,
.deliveryButton,
.compareButton {
  flex: 1;
  min-width: 150px;
}

/* Mini comparison summary tooltip on the Compare button — anchored to the
   button's container so it floats above the action row. Shown on hover /
   keyboard focus; fetches compare.php Mode 3 for the live scores. */
.compareButton {
  position: relative;
}

.cmp-mini-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: 292px;
  max-width: calc(100vw - 40px);
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(91, 63, 200, 0.22);
  background: var(--white);
  color: #33415c;
  font-size: 0.7801rem;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 14px 34px rgba(24, 30, 60, 0.18), 0 3px 10px rgba(24, 30, 60, 0.12);
  animation: cmp-tip-in 0.16s ease;
}
.cmp-mini-tip[hidden] {
  display: none;
}

@keyframes cmp-tip-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Little arrow pointing down at the button. */
.cmp-mini-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--white);
}

.cmp-mini-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.8000rem;
  color: #4c2fae;
  margin-bottom: 8px;
}

.cmp-mini-tip-load {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7a93;
}
.cmp-mini-spin {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(91, 63, 200, 0.25);
  border-top-color: #5b3fc8;
  border-radius: 50%;
  animation: cmp-spin 0.7s linear infinite;
}
@keyframes cmp-spin {
  to {
    transform: rotate(360deg);
  }
}

.cmp-mini-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 9px;
}
.cmp-mini-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.cmp-mini-row.cmp-mini-win {
  background: rgba(91, 63, 200, 0.07);
  border-radius: 8px;
  padding: 3px 7px;
  margin: -3px -7px;
}
.cmp-mini-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a89be0;
}
.cmp-mini-row.cmp-mini-win .cmp-mini-dot {
  background: #5b3fc8;
}
.cmp-mini-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.cmp-mini-score {
  flex: none;
  font-weight: 700;
  color: #4c2fae;
  font-variant-numeric: tabular-nums;
}
.cmp-mini-mine .cmp-mini-name {
  color: #6b7a93;
}

.cmp-mini-foot {
  color: var(--neutral-500, var(--neutral-500));
  font-size: 0.7300rem;
  border-top: 1px solid rgba(91, 63, 200, 0.12);
  padding-top: 8px;
}
.cmp-mini-cta {
  color: #5b3fc8;
  font-weight: 700;
}

.buyButton button,
.escrowButton button {
  width: 100%;
}

/* "Compare Similar" CTA — violet, opens the comparison page scoped to this
   category. The icon sits in its own soft chip and the button lifts with a
   violet glow on hover, presses down on click and shows a clear focus ring. */
button.compareProduct {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #f3eeff, #e0d4ff);
  color: #4c2fae;
  border: 1.5px solid #b9a6f8;
  border-radius: 12px;
  padding: 10px 15px;
  font-family: inherit;
  font-size: var(--h6);
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 4px 12px rgba(91, 63, 200, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

/* Icon sits in its own soft chip so the action reads instantly. */
button.compareProduct svg {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(91, 63, 200, 0.12);
  color: #5b3fc8;
  box-sizing: content-box;
  flex-shrink: 0;
}

button.compareProduct:hover {
  transform: translateY(-2px);
  border-color: #a38af5;
  background: linear-gradient(135deg, #e9e0ff, #d2c2ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 12px 24px rgba(91, 63, 200, 0.28);
}

button.compareProduct:active {
  transform: translateY(0) scale(0.98);
}

button.compareProduct:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(91, 63, 200, 0.35), 0 8px 20px rgba(91, 63, 200, 0.22);
}

button.escrowProduct {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #e8f4ff, #d2e9ff);
  color: #0b4f8a;
  border: 1.5px solid #a8d0f5;
  border-radius: 12px;
  padding: 11px 15px;
  font-family: inherit;
  font-size: var(--h6);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button.escrowProduct:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(11, 79, 138, 0.24);
  background: linear-gradient(135deg, #d6ecff, #bfdffb);
}

button.deliveryProduct {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #fff3e2, #ffe3c2);
  color: #b45309;
  border: 1.5px solid #ffc98a;
  border-radius: 12px;
  padding: 11px 15px;
  font-family: inherit;
  font-size: var(--h6);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button.deliveryProduct:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(255, 138, 43, 0.28);
  background: linear-gradient(135deg, #ffe9cd, #ffd8a8);
}

/* "Make an offer" CTA — haggling green, matches the sibling escrow/delivery
   buttons (shown only on negotiable listings via JS). */
button.offerProduct {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #e9f9ef, #d2f2df);
  color: #0e7a3e;
  border: 1.5px solid #9fdcb8;
  border-radius: 12px;
  padding: 11px 15px;
  font-family: inherit;
  font-size: var(--h6);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button.offerProduct:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(14, 122, 62, 0.24);
  background: linear-gradient(135deg, #d8f5e4, #bfeccf);
}

button.offerProduct svg {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .ctaSection {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .buyButton,
  .escrowButton,
  .deliveryButton,
  .offerButton,
  .compareButton {
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
  }

  .offerButton {
    display: flex;
  }
  .offerButton .offerProduct {
    width: 100%;
  }
}

/* ===== Delivery / Yango handoff modal ===== */
.delivery-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(4, 16, 28, 0.62);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.delivery-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.delivery-modal {
  position: relative;
  width: min(460px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: 20px;
  padding: 26px 24px 22px;
  box-shadow: 0 30px 70px rgba(2, 14, 26, 0.4);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.28s ease;
}

.delivery-modal-overlay.open .delivery-modal {
  transform: translateY(0) scale(1);
}

.delivery-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #eef3f8;
  color: #24344a;
  font-size: 1.2500rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.delivery-modal-close:hover {
  background: #ffe1d6;
  color: #c2410c;
  transform: rotate(90deg);
}

.delivery-modal-head {
  text-align: center;
  margin-bottom: 16px;
}

.delivery-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #06426e;
  background: linear-gradient(135deg, #eaf3fb, #d7e9f8);
}

.delivery-modal-head h3 {
  margin: 0 0 4px;
  font-size: 1.2500rem;
  color: #0b1f31;
}

.delivery-modal-sub {
  margin: 0;
  color: #6b7d95;
  font-size: 0.8800rem;
}

.delivery-status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9500rem;
  font-weight: 600;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.delivery-status.on {
  color: #0f8a4d;
  background: rgba(31, 191, 117, 0.1);
  border: 1px solid rgba(31, 191, 117, 0.35);
}

.delivery-status.off {
  color: #6b7d95;
  background: rgba(107, 125, 149, 0.08);
  border: 1px solid rgba(107, 125, 149, 0.25);
}

.delivery-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.delivery-yango-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(135deg, #fff7ec, #ffeede);
  border: 1px solid #ffd9ac;
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 14px;
  color: #9a3412;
}

.delivery-yango-note svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.delivery-yango-note b {
  display: block;
  font-size: 0.9200rem;
  margin-bottom: 3px;
}

.delivery-yango-note p {
  margin: 0;
  font-size: 0.8199rem;
  line-height: 1.5;
  opacity: 0.85;
}

.delivery-form label {
  display: block;
  font-size: 0.7801rem;
  font-weight: 600;
  color: #06426e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 12px 0 5px;
}

.delivery-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--neutral-200);
  border-radius: 11px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 0.9200rem;
  color: #0b1f31;
  background: #f8fbfe;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.delivery-form input:focus {
  border-color: var(--brand-orange-400, var(--brand-orange-400));
  box-shadow: 0 0 0 3px rgba(255, 138, 43, 0.15);
  background: var(--white);
}

.delivery-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.delivery-arrange {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 0.9500rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, #06426e, var(--brand-navy-900, #012a46));
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.delivery-arrange:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(1, 42, 70, 0.35);
}

.delivery-copy {
  border: 1.5px solid var(--neutral-200);
  background: var(--white);
  color: #06426e;
  border-radius: 12px;
  padding: 13px 18px;
  font-family: inherit;
  font-size: 0.9200rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.delivery-copy:hover {
  border-color: var(--brand-orange-400, var(--brand-orange-400));
  transform: translateY(-2px);
}

.delivery-modal-foot {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.7600rem;
  color: #8b9ab0;
}

@media (max-width: 480px) {
  .delivery-modal-actions {
    flex-direction: column;
  }

  .delivery-copy {
    width: 100%;
  }
}

/* --- Floating user-nav (pages without a navbar) --- */
#user-nav-js {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(11, 60, 93, 0.15);
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(2, 42, 70, 0.18);
}
#user-nav-js.user-nav-loading {
  visibility: hidden;
  pointer-events: none;
}
#user-nav-js.user-nav-shown {
  animation: userNavPop 0.35s ease both;
}
#user-nav-js a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s ease;
}
#user-nav-js a:hover {
  transform: translateY(-2px);
}
#user-nav-js img.userIcon {
  border: 2px solid var(--brand-orange-500, var(--brand-orange-500));
}
#user-nav-js a.login-btn {
  font-weight: 600;
  padding: 0.6000rem 1.4000rem;
  border-radius: 999px;
  background: linear-gradient(45deg, #ff8a00, #ffb15e);
  color: var(--white);
  border: none;
  box-shadow: 0 4px 14px rgba(255, 127, 17, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#user-nav-js a.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 127, 17, 0.55);
}
@keyframes userNavPop {
  from { opacity: 0; transform: translateY(-8px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Mobile floating nav (handle + expanded panel) --- */
/* Hidden state forced so display:flex doesn't override hidden attribute */
#user-nav-js .user-nav-handle[hidden],
#user-nav-js .user-nav-expanded[hidden] {
  display: none !important;
}

.user-nav-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-navy-700, var(--brand-navy-700)), #0a7fb5);
  box-shadow: 0 4px 16px rgba(10, 59, 93, 0.3);
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.user-nav-handle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(10, 59, 93, 0.4);
}
.user-nav-handle:active {
  cursor: grabbing;
}

.user-nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-navy-700, var(--brand-navy-700)), #0a7fb5);
}
.user-nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid var(--brand-orange-500, var(--brand-orange-500));
}
.user-nav-logo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1001rem;
  color: var(--white);
}

/* Expanded panel — appears below/above the handle with smooth transitions */
.user-nav-expanded {
  position: absolute;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(11, 60, 93, 0.12);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(2, 42, 70, 0.2);
  min-width: 180px;
  /* Smooth open/close transitions */
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s ease;
}

/* When JS removes [hidden] and adds .user-nav-expanded open state */
.user-nav-expanded[open],
#user-nav-js.expanded .user-nav-expanded {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Handle shrinks slightly when menu opens */
#user-nav-js.expanded .user-nav-handle {
  transform: scale(0.85);
  opacity: 0.5;
  pointer-events: none;
}

.user-nav-expanded .user-nav-close {
  align-self: flex-start;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(11, 60, 93, 0.08);
  color: var(--brand-navy-700, var(--brand-navy-700));
  font-size: 1.2000rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.user-nav-expanded .user-nav-close:hover {
  background: var(--brand-navy-700, var(--brand-navy-700));
  color: var(--white);
  transform: rotate(90deg);
}

.user-nav-expanded .user-nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-nav-expanded .user-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9001rem;
  color: var(--brand-navy-700, var(--brand-navy-700));
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.user-nav-expanded .user-nav-link:hover {
  background: rgba(11, 60, 93, 0.08);
  color: #0a7fb5;
}

.user-nav-expanded .user-nav-link.login-btn {
  background: linear-gradient(135deg, #ff8a00, #ffb15e);
  color: var(--white);
  font-weight: 600;
  border-radius: 10px;
}

.user-nav-expanded .user-nav-link.logout-btn {
  color: var(--danger-600, var(--danger-600));
}

.user-nav-expanded .user-nav-link.logout-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.user-nav-expanded .user-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand-orange-500, var(--brand-orange-500));
  color: #1a0d00;
  font-size: 0.6500rem;
  font-weight: 700;
  line-height: 1;
}

/* Desktop: hide the handle/expanded, keep the server-rendered pill */
@media (min-width: 768px) {
  #user-nav-js .user-nav-handle,
  #user-nav-js .user-nav-expanded {
    display: none !important;
  }
}

/* Mobile: hide the desktop pill, show the handle + expanded */
@media (max-width: 767px) {
  .user-nav-pill {
    display: none;
  }
}

/* --- Gallery UX polish --- */
.imageContainer .mainImage {
  background: #f6f8fb;
  cursor: zoom-in;
}

.mainImage img {
  transition: opacity 0.2s ease, transform 0.35s ease;
}

.thumbnails .thumbnail {
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.thumbnails .thumbnail:hover {
  transform: translateY(-2px);
  border-color: var(--orange-400, var(--brand-orange-400, var(--brand-orange-400)));
  box-shadow: 0 4px 12px rgba(2, 42, 70, 0.18);
}

.thumbnails .thumbnail.active {
  border: 2px solid var(--brand-orange-500, var(--brand-orange-500));
  box-shadow: 0 0 0 3px rgba(255, 127, 17, 0.25);
  transform: translateY(-2px);
}

.thumbnails .thumbnail.active img {
  opacity: 0.95;
}

/* Lightbox overlay */
.image-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 20, 36, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.image-popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.image-popup-overlay .popup-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.image-popup-overlay .popup-content img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-popup-overlay .close-popup {
  position: absolute;
  top: -40px;
  right: 0;
  font-size: 3.4000rem;
  color: var(--white);
  cursor: pointer;
  line-height: 1;
  transition: transform 0.2s ease;
}

.image-popup-overlay .close-popup:hover {
  transform: scale(1.2);
  color: var(--brand-orange-500, var(--brand-orange-500));
}

/* --- Wishlist button state on detail pages --- */
.watchlist {
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  border: 2px solid transparent;
}

.watchlist .wishlist-heart {
  transition: fill 0.2s ease, transform 0.2s ease;
}

.watchlist:hover .wishlist-heart {
  transform: scale(1.12);
}

.watchlist.wishlisted {
  background: #ffe9ee;
  border-color: #ff2d55;
}

.watchlist.wishlisted .wishlist-heart {
  fill: #ff2d55;
}

.watchlist.wishlisted .text {
  color: #d6335a;
}

.watchlist:focus-visible {
  outline: 2px solid var(--color-ring, var(--brand-orange-700));
  outline-offset: 2px;
}


/* Notification centre styling lives in assets/css/notifications.css,
   which every page that renders the bell loads. The partial, conflicting
   copy that used to sit here was removed so there is one source of truth. */

/* ============================================================
   Redesigned owner card + reviews section
   (shared by product & service detail pages)
   ============================================================ */

.productComments {
  height: auto;
  min-height: 440px;
  align-items: stretch;
}

.productComments .comments {
  align-items: stretch;
  background: var(--white);
  border: 1px solid rgba(15, 39, 66, 0.1);
  box-shadow: 0 10px 30px rgba(2, 42, 70, 0.08);
  border-radius: 16px;
  padding: 16px 18px 14px;
  gap: 12px;
}

.productComments .comments h1 {
  font-size: 1.8999rem;
  font-weight: 700;
  color: var(--blue-900);
  text-align: center;
  letter-spacing: 0.3px;
}

.productComments .comments h1::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange-500), var(--cyan-500));
}

/* --- Owner card (right column) --- */
.productComments .userContainer {
  background: linear-gradient(180deg, var(--white) 0%, var(--skel-sheen, #f6f9fc) 100%);
  border: 1px solid rgba(15, 39, 66, 0.1);
  box-shadow: 0 10px 30px rgba(2, 42, 70, 0.08);
  border-radius: 16px;
  padding: 18px 16px;
  overflow: hidden;
  position: relative;
}

.productComments .userContainer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-800), var(--cyan-500), var(--orange-500));
}

.userContainer .productOwner {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  height: 100%;
}

/* head: avatar + identity */
.owner-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.productOwner .uDetails.owner-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--orange-500);
  box-shadow: 0 4px 14px rgba(255, 106, 0, 0.35);
}

.owner-id {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.owner-id .uname {
  font-size: 1.6000rem;
  font-weight: 700;
  color: var(--blue-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.owner-meta {
  font-size: 1.2000rem;
  font-weight: 600;
  color: var(--orange-500);
  background: rgba(255, 106, 0, 0.1);
  border: 1px solid rgba(255, 106, 0, 0.22);
  border-radius: 999px;
  padding: 2px 10px;
  align-self: flex-start;
}

.owner-id .joined {
  font-size: 1.1500rem;
  color: #718096;
}

/* Star rating row under the owner name */
.owner-rating {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  position: relative;
  margin-top: 1px;
}

.owner-stars,
.owner-stars-fill {
  font-size: 1.3001rem;
  letter-spacing: 2px;
  line-height: 1;
}

.owner-stars {
  position: relative;
  display: inline-block;
  color: #d4d8dd;
}

.owner-stars-fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #f59e0b;
  display: block;
}

.owner-rating-text {
  font-size: 1.1500rem;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

/* caution box */
.caution {
  width: 100%;
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.14), rgba(255, 106, 0, 0.05));
  border: 1px solid rgba(255, 122, 0, 0.3);
  border-left: 3px solid var(--orange-500);
  border-radius: 12px;
  padding: 12px 14px;
  height: auto;
}

.caution-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.3500rem;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 6px;
}

.caution ol {
  counter-reset: safety;
  list-style: none;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: 0;
}

.caution li {
  counter-increment: safety;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.caution li::before {
  content: counter(safety);
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--orange-500);
  color: var(--white);
  font-size: 1.0500rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.caution li span {
  font-size: 1.2500rem;
  font-weight: 500;
  color: #5b4636;
  line-height: 1.5;
}

.caution li strong {
  color: #b45309;
}

/* owner action buttons */
.owner-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: auto;
}

.owner-action {
  border: none;
  border-radius: 10px;
  padding: 9px 6px;
  font-size: 1.2500rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--white);
  background: linear-gradient(45deg, var(--blue-700), var(--indigo-500));
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
}

.owner-action a {
  color: var(--white);
  text-decoration: none;
  font-size: 1.2500rem;
  font-weight: 600;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.owner-action.msg-btn {
  background: linear-gradient(45deg, var(--cyan-500), var(--indigo-500));
}

.owner-action.danger {
  background: linear-gradient(45deg, #e11d48, var(--orange-500));
}

.owner-action.danger-alt {
  background: linear-gradient(45deg, var(--violet-500), var(--indigo-500));
}

.owner-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  filter: brightness(1.06);
}

.owner-action:active {
  transform: translateY(0);
}

/* --- Reviews list --- */
.CommentsCont {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
}

.comment {
  background: var(--neutral-50, var(--neutral-50));
  border: 1px solid rgba(15, 39, 66, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.comment:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(2, 42, 70, 0.12);
  border-color: rgba(255, 122, 0, 0.35);
}

.comment .commentData {
  padding: 0;
  gap: 8px;
}

.commentData:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.userInformation {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.commentData .userImage {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--white);
  box-shadow: 0 2px 6px rgba(2, 42, 70, 0.15);
}

.commentData .userDet {
  line-height: 1.35;
  min-width: 0;
}

.commentData .userDet .userName span {
  font-size: 1.3001rem;
  font-weight: 600;
  color: var(--blue-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  display: block;
}

.commentData .userDet .userRole span {
  font-size: 1.1001rem;
  color: var(--orange-500);
  font-weight: 500;
}

.starRating {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 179, 71, 0.16);
  border: 1px solid rgba(255, 179, 71, 0.3);
  border-radius: 999px;
  padding: 2px 9px;
  flex-shrink: 0;
}

.starRating > span:first-child {
  font-size: 1.1001rem;
  font-weight: 700;
  color: #b45309;
}

.starRating .stars {
  font-size: 1.0500rem;
  letter-spacing: 1px;
}

.commentData span.reviewComment {
  font-size: 1.2500rem;
  color: var(--neutral-700, var(--neutral-700));
  line-height: 1.55;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commentMeta {
  padding: 4px 0 0;
  font-size: 1.0500rem;
  font-weight: 500;
  color: var(--neutral-400, var(--neutral-400));
}

.no-comments {
  grid-column: 1 / -1;
  text-align: center;
  padding: 26px 12px;
  color: #718096;
  font-size: 1.4000rem;
  background: rgba(15, 39, 66, 0.04);
  border: 1px dashed rgba(15, 39, 66, 0.2);
  border-radius: 12px;
}

.no-comments a {
  color: var(--orange-500);
  font-weight: 600;
}

/* --- Review input --- */
.commentInput {
  padding: 2px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.commentInput .inputField {
  gap: 8px;
  background: var(--neutral-50, var(--neutral-50));
  border: 1px solid rgba(15, 39, 66, 0.12);
  border-radius: 12px;
  padding: 8px;
}

.inputField textarea {
  border: 1px solid rgba(15, 39, 66, 0.15);
  background: var(--white);
  height: 42px;
  min-height: 42px;
  max-height: 160px;
  overflow-y: auto;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.inputField textarea:focus {
  outline: none;
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}

.commentInput .inputField div select {
  border-radius: 8px;
  font-weight: 500;
}

.inputField button {
  width: 88px;
  height: 42px;
  background: linear-gradient(45deg, var(--orange-500), #ffb347);
  border-radius: 10px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.inputField button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(255, 106, 0, 0.35);
}

/* Character counter under the review input */
.comment-counter {
  align-self: flex-end;
  font-size: 1.1001rem;
  font-weight: 600;
  color: var(--neutral-400, var(--neutral-400));
  background: rgba(15, 39, 66, 0.05);
  border-radius: 999px;
  padding: 2px 10px;
  line-height: 1.6;
  transition: color 0.2s ease, background 0.2s ease;
}

.comment-counter.comment-counter-full {
  color: #e11d48;
  background: rgba(225, 29, 72, 0.1);
}

/* Live blocked-word warning under the review/report inputs */
.report-block-warn {
  font-size: 1.1500rem;
  font-weight: 600;
  color: #b42318;
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid rgba(229, 72, 77, 0.35);
  padding: 4px 12px;
  border-radius: 8px;
  animation: warn-pop 0.18s ease-out;
}

.comment-block-warn {
  align-self: flex-start;
  font-size: 1.1500rem;
  font-weight: 600;
  color: #b42318;
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid rgba(229, 72, 77, 0.35);
  padding: 4px 12px;
  border-radius: 8px;
  animation: warn-pop 0.18s ease-out;
}

@keyframes warn-pop {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Responsive tweaks for the redesigned sections --- */
@media (max-width: 900px) {
  .CommentsCont {
    grid-template-columns: 1fr;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .productComments .userContainer {
    padding: 16px;
  }

  .productComments .comments {
    padding: 14px 12px;
  }

  .productOwner .uDetails.owner-avatar {
    width: 56px;
    height: 56px;
  }

  .owner-actions {
    gap: 8px;
  }

  .commentInput .inputField {
    flex-direction: column;
    align-items: stretch;
  }

  .inputField textarea {
    height: 60px;
  }

  .commentInput .inputField div select {
    width: 100%;
    height: 40px;
  }

  .inputField button {
    width: 100%;
  }
}

/* Neutralize the legacy per-id hover rules that fought the new button styles */
#reportSellerBtn:hover,
#reportProductBtn:hover,
#reportServiceBtn:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

/* ============================================================
   Report modal (replaces the browser prompt on detail pages)
   ============================================================ */
.report-modal-open {
  overflow: hidden;
}

.report-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 20, 36, 0.6);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.report-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.report-modal {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(2, 20, 36, 0.35);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.report-modal-overlay.active .report-modal {
  transform: translateY(0) scale(1);
}

.report-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 39, 66, 0.08);
  color: var(--blue-800);
  font-size: 2.0000rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.report-modal-close:hover {
  background: rgba(225, 29, 72, 0.12);
  color: #e11d48;
  transform: rotate(90deg);
}

.report-modal h3 {
  font-size: 1.8000rem;
  font-weight: 700;
  color: var(--blue-900);
  margin-bottom: 4px;
}

.report-modal-sub {
  font-size: 1.2500rem;
  color: #718096;
  margin-bottom: 14px;
}

.report-reasons {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.report-reason {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 39, 66, 0.14);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  font-size: 1.3500rem;
  font-weight: 500;
  color: var(--blue-900);
}

.report-reason:hover {
  border-color: rgba(255, 106, 0, 0.5);
  background: rgba(255, 106, 0, 0.05);
}

.report-reason:has(input:checked) {
  border-color: var(--orange-500);
  background: rgba(255, 106, 0, 0.1);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.12);
}

.report-reason input {
  accent-color: var(--orange-500);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
}

.report-details {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid rgba(15, 39, 66, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1.3001rem;
  font-family: "Poppins", sans-serif;
  color: var(--blue-900);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.report-details:focus {
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.14);
}

.report-details.report-error {
  border-color: #e11d48;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
  animation: reportShake 0.3s ease;
}

@keyframes reportShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.report-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.report-cancel,
.report-submit {
  flex: 1;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  font-size: 1.3500rem;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.report-cancel {
  background: rgba(15, 39, 66, 0.08);
  color: var(--blue-800);
}

.report-cancel:hover {
  background: rgba(15, 39, 66, 0.14);
}

.report-submit {
  background: linear-gradient(45deg, #e11d48, var(--orange-500));
  color: var(--white);
}

.report-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.3);
  filter: brightness(1.05);
}

.report-submit:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

@media (max-width: 480px) {
  .report-modal {
    padding: 18px;
  }

  .report-modal-actions {
    flex-direction: column-reverse;
  }
}

/* ===== Chips + delivery modal readability polish ===== */
.del-badge {
  font-size: 0.9200rem;
  padding: 5px 13px;
  margin-right: 8px;
}

.attr-chips {
  gap: 12px;
}

.attr-chip {
  gap: 8px;
  padding: 9px 16px;
  border-radius: 12px;
  font-size: 1.0000rem;
}

.attr-chip b,
.attr-chip i {
  font-size: 0.9500rem;
}

.delivery-modal {
  width: min(560px, 94vw);
  padding: 30px 28px 26px;
}

.delivery-modal-head h3 {
  font-size: 1.5500rem;
}

.delivery-modal-sub {
  font-size: 1.0201rem;
}

.delivery-status {
  font-size: 1.0500rem;
}

.delivery-yango-note {
  font-size: 0.9799rem;
}

.delivery-form label {
  font-size: 0.9500rem;
}

.delivery-form input {
  font-size: 1.0500rem;
  padding: 12px 14px;
}

.delivery-modal-actions button {
  font-size: 1.0500rem;
  padding: 13px 18px;
}

.delivery-modal-foot {
  font-size: 0.8800rem;
}

.delivery-details {
  font-size: 1.0000rem;
}

.dchip {
  font-size: 0.9001rem;
  padding: 4px 12px;
}

/* ============================================================
   Detail-page cohesion restyle (summary panel, info pills,
   owner strip, comment cards) — appended so it wins ties.
   ============================================================ */
main .layer1 {
  background: linear-gradient(180deg, var(--white), #fbfdff);
  border-radius: 20px;
  padding: 14px;
}

.layer1 .imageContainer {
  background: #f5f8fb;
  border-radius: 16px;
  padding: 12px;
}

.imageContainer .mainImage {
  border: none;
  border-radius: 14px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px rgba(15, 39, 66, 0.08);
}

/* --- Summary panel --- */
.layer1 .productSummary {
  background: linear-gradient(180deg, var(--white), #f3f8fc);
  border: 1px solid rgba(15, 39, 66, 0.08);
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 6px 22px rgba(2, 42, 70, 0.06);
}

.productSummary .productName span {
  font-size: 2.6000rem;
  line-height: 1.18;
}

.productSummary .productPrice {
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(15, 39, 66, 0.14);
  margin-bottom: 2px;
}


.productSummary .productDescription {
  font-size: 1.4999rem;
  line-height: 1.75;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 39, 66, 0.07);
  border-left: 3px solid var(--orange-500);
  border-radius: 10px;
  padding: 12px 14px;
}

/* --- Owner strip inside the summary --- */
.productSummary .productOwner {
  background: linear-gradient(135deg, var(--white), #edf4fa);
  border: 1px solid rgba(15, 39, 66, 0.1);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 4px 12px rgba(2, 42, 70, 0.07);
  width: fit-content;
  max-width: 100%;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.productSummary .productOwner .uDetails:nth-child(1) {
  border: 2px solid var(--orange-400);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.18);
}

.productSummary .uname span:nth-child(2) {
  font-size: 1.0500rem;
}

/* --- Info pills row --- */
.productInformation {
  background: rgba(15, 39, 66, 0.03);
  border: 1px solid rgba(15, 39, 66, 0.08);
  border-radius: 14px;
  padding: 8px 12px;
  margin-top: 4px;
}

.productInfo .info {
  background: var(--white);
  border: 1px solid rgba(15, 39, 66, 0.1);
  box-shadow: 0 2px 6px rgba(2, 42, 70, 0.05);
  padding: 7px 14px;
}

/* --- Review/comment cards --- */
.comment {
  background: var(--neutral-50, var(--neutral-50));
  border: 1px solid rgba(15, 39, 66, 0.08);
  border-radius: 12px;
  padding: 8px 10px;
}

.commentData .userImage {
  border: 2px solid var(--orange-400);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.14);
  flex-shrink: 0;
}

.commentData span.reviewComment {
  color: var(--blue-800);
  font-size: 1.3001rem;
  line-height: 1.6;
}

/* --- Posted row --- */
.posted {
  font-size: 1.2500rem;
  color: #5b7186;
}

.posted button {
  border-radius: 999px;
  padding: 8px 18px;
}

@media (max-width: 640px) {
  .layer1 .productSummary {
    padding: 14px 12px;
  }

  .productSummary .productName span {
    font-size: 2.0000rem;
  }

  .productSummary .productPrice .Pprice {
    font-size: 1.8000rem;
  }

  .productSummary .productDescription {
    font-size: 1.4000rem;
  }
}

/* ============================================================
   DETAIL PAGES — V2 COMPLETE REDESIGN
   (appended last so it wins ties; every JS hook untouched)
   ============================================================ */

/* --- Page shell --- */
main {
  max-width: 1240px;
  width: 100%;
  /* main is position:absolute in the base styles — both insets must be set
     for margin:auto to centre the capped-width column on wide screens. */
  left: 0;
  right: 0;
  margin: 0 auto;
  padding: 26px 22px 44px;
}

/* --- Layer 1: gallery + summary --- */
main .layer1 {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding: 18px 18px 32px;
  border-radius: 26px;
  border: 1px solid rgba(15, 39, 66, 0.1);
  background: var(--white);
  box-shadow: 0 24px 60px rgba(2, 42, 70, 0.12);
  position: relative;
  overflow: visible;
  min-height: auto;
  height: auto;
}

.layer1 .imageContainer,
.layer1 .productSummary {
  width: 100%;
  min-width: 0;
}

main .layer1::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--brand-orange-500, var(--brand-orange-500)), var(--brand-orange-300, #ff9d2e), #00c6ff, #2575fc);
}

/* --- Gallery --- */
.layer1 .imageContainer {
  background: #f2f6fa;
  border-radius: 18px;
  padding: 14px;
  height: auto;
  min-height: 460px;
}  .imageContainer .mainImage {
    border-radius: 14px;
    background: var(--white);
    box-shadow: inset 0 0 0 1px rgba(15, 39, 66, 0.08);
    height: 380px;
    min-height: 300px;
  }

.imageContainer .thumbnails {
  gap: 10px;
  height: 96px;
  margin-top: 2px;
}

.thumbnails .thumbnail {
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--white);
  box-shadow: 0 4px 12px rgba(2, 42, 70, 0.08);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.thumbnails .thumbnail:hover {
  transform: translateY(-2px);
  border-color: #ffb066;
}

.thumbnails .thumbnail.active {
  border-color: var(--brand-orange-500, var(--brand-orange-500));
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.22), 0 6px 16px rgba(2, 42, 70, 0.12);
}

/* --- Summary panel --- */
.layer1 .productSummary {
  padding: 16px 8px 10px;
  border-radius: 18px;
}

.productSummary .productName span {
  font-size: 2.7001rem;
  line-height: 1.2;
  font-weight: 700;
  color: #0b1f31;
  display: block;
}

.productSummary .productPrice {
  border-bottom: 1px dashed rgba(15, 39, 66, 0.16);
  padding-bottom: 14px;
  margin-bottom: 6px;
}

.productSummary .productPrice .Pprice span {
  font-weight: 800;
}

/* Wishlist = always-visible pill */
.productPrice .watchlist {
  width: auto;
  min-width: 46px;
  height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  background: #0b2b46;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 16px rgba(2, 42, 70, 0.25);
  overflow: hidden;
}

.productPrice .watchlist .text {
  display: inline-block;
  font-size: 1.2500rem;
  white-space: nowrap;
}

.productPrice .watchlist:hover {
  width: auto;
  background: var(--brand-orange-500, var(--brand-orange-500));
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(255, 122, 0, 0.4);
}

.productPrice .watchlist.wishlisted {
  background: linear-gradient(135deg, #ff4d6a, #ff7a9c);
}

.productSummary .productDescription {
  font-size: 1.4999rem;
  line-height: 1.75;
  color: #33475f;
  background: #f7fafc;
  border: 1px solid rgba(15, 39, 66, 0.08);
  border-left: 4px solid var(--brand-orange-500, var(--brand-orange-500));
  border-radius: 12px;
  padding: 14px 16px;
}

/* --- CTA row --- */
.ctaSection {
  gap: 14px;
}

.buyButton button {
  border-radius: 14px;
  font-size: 1.5500rem;
  padding: 14px 20px;
  background: var(--brand-orange-500, var(--brand-orange-500));
  box-shadow: 0 10px 24px rgba(255, 122, 0, 0.35);
  border: none;
}

.buyButton button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 122, 0, 0.45);
}

button.deliveryProduct {
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 1.4000rem;
  background: var(--white);
  border: 1.5px solid #ffcf9e;
  color: #b45309;
  box-shadow: 0 6px 16px rgba(255, 138, 43, 0.14);
}

button.deliveryProduct:hover {
  background: linear-gradient(135deg, #fff7ec, #ffeede);
  border-color: #ffb066;
}

/* --- Info pills row (emoji icons via CSS) --- */
.productInformation {
  gap: 8px;
  background: var(--skel-sheen, #f6f9fc);
  border: 1px solid rgba(15, 39, 66, 0.08);
  border-radius: 16px;
  padding: 12px;
}

.productInfo .info {
  border-radius: 999px;
  font-size: 1.3001rem;
  font-weight: 600;
  border: 1px solid rgba(15, 39, 66, 0.1);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(2, 42, 70, 0.05);
  padding: 8px 16px;
}

.productInfo .info span {
  font-weight: 700;
  color: var(--brand-orange-500, var(--brand-orange-500));
}

/* --- Attribute chips --- */
.attr-chip {
  border-radius: 12px;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid #e3edf6;
  box-shadow: 0 2px 8px rgba(2, 42, 70, 0.05);
  font-size: 1.1500rem;
  color: #24344a;
}

.attr-chip b {
  font-size: 1.0500rem;
  color: var(--brand-orange-500, var(--brand-orange-500));
}

/* --- Posted row --- */
.posted button {
  border-radius: 999px;
  padding: 9px 20px;
}

/* ============================================================
   Layer 1 — give the summary panel room to breathe (wider text
   column + flexible gallery, so the description and attribute
   chips are fully visible)
   ============================================================ */
main .layer1 {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.layer1 .productSummary {
  padding: 22px 24px 18px;
}

.imageContainer .mainImage {
  height: auto;
  aspect-ratio: 4 / 3;
  min-height: 300px;
}

.productSummary .productDescription {
  max-height: none;
  overflow: visible;
}

.detail-extra .attr-chips,
.productSummary .attr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================
   Similar / owner cards — marketplace-style look
   (matches the .mk-card used on the marketplace; the anchor is
   given an explicit width/height so the first card can never
   collapse to zero height)
   ============================================================ */
.sProducts a {
  display: flex;
  flex: 0 0 auto;
  width: 250px;
  max-width: 250px;
  height: auto;
  align-items: stretch;
}

.oAds a {
  display: flex;
  height: auto;
  align-items: stretch;
}

.list {
  width: 100%;
  height: auto;
  min-height: 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
  background: var(--white);
  border: 1px solid rgba(15, 39, 66, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(2, 42, 70, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.list:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(2, 42, 70, 0.2), 0 0 0 2px var(--brand-orange-500, var(--brand-orange-500));
}

.list .chip-cnt {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-start;
  color: var(--white);
  overflow: hidden;
}

.list .chip-cnt .chip {
  background: rgba(4, 16, 28, 0.6);
  color: var(--white);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 1.0000rem;
  font-weight: 600;
  flex-shrink: 0;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list .image-p {
  width: 100%;
  height: 150px;
  flex: none;
  background: #f5f8fb;
}

.list .image-p img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.list .product-data {
  width: 100%;
  height: auto;
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  background: var(--white);
}

.list .product-h {
  padding: 0;
  font-size: 1.4000rem;
  color: #0b1f31;
}

.list .product-h span {
  font-size: 1.4000rem;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.list .product-d {
  font-size: 1.0500rem;
  color: #5b7186;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list .product-f {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.list .view-btn {
  font-size: 1.0000rem;
  color: #5b7186;
}

.list .price {
  font-size: 1.4999rem;
  font-weight: 800;
  color: var(--brand-orange-500, var(--brand-orange-500));
}

/* ============================================================
   Layer 2 — reviews + owner card
   ============================================================ */
.layer2 {
  margin-top: 26px;
}

.productComments {
  gap: 20px;
  min-height: 480px;
}

.productComments .comments {
  border-radius: 20px;
  padding: 20px 22px 16px;
  border: 1px solid rgba(15, 39, 66, 0.09);
  box-shadow: 0 16px 40px rgba(2, 42, 70, 0.08);
}

.productComments .comments h1 {
  font-size: 2.0000rem;
}

/* Review cards */
.comment {
  background: var(--neutral-50, var(--neutral-50));
  border: 1px solid rgba(15, 39, 66, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(2, 42, 70, 0.04);
}

.comment:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(2, 42, 70, 0.12);
}

.commentData .userImage {
  border: 2px solid var(--brand-orange-500, var(--brand-orange-500));
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
  flex-shrink: 0;
}

.commentData span.reviewComment {
  font-size: 1.3500rem;
  color: #24344a;
  line-height: 1.65;
}

.comment .starRating .stars {
  font-size: 1.2500rem;
  letter-spacing: 1px;
}

.commentMeta {
  color: #8a99ab;
  font-size: 1.1500rem;
  margin-top: 6px;
}

/* Review input */
.commentInput {
  margin-top: auto;
  padding-top: 12px;
}

.inputField textarea {
  border-radius: 14px;
  border: 1.5px solid #dde8f2;
  padding: 12px 14px;
  font-size: 1.4000rem;
  background: var(--white);
  color: var(--blue-700);
}

.inputField textarea:focus {
  border-color: var(--brand-orange-500, var(--brand-orange-500));
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}

.commentInput .inputField div select {
  border-radius: 10px;
  border: 1.5px solid #dde8f2;
  font-size: 1.4000rem;
}

.inputField button {
  border-radius: 12px;
  background: var(--brand-orange-500, var(--brand-orange-500));
  font-size: 1.4999rem;
  width: auto;
  min-width: 110px;
  height: 46px;
  padding: 0 18px;
  box-shadow: 0 8px 18px rgba(255, 122, 0, 0.3);
}

/* --- Owner card --- */
.productComments .userContainer {
  border-radius: 20px;
  border: 1px solid rgba(15, 39, 66, 0.09);
  box-shadow: 0 16px 40px rgba(2, 42, 70, 0.08);
  padding: 22px 18px 20px;
}

.productOwner .uDetails.owner-avatar {
  width: 68px;
  height: 68px;
  border: 3px solid var(--brand-orange-500, var(--brand-orange-500));
  box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.18), 0 8px 20px rgba(255, 106, 0, 0.3);
}

.owner-id .uname {
  font-size: 1.8000rem;
}

.owner-stars {
  font-size: 1.4500rem;
}

.owner-stars-fill {
  font-size: 1.4500rem;
}

.owner-rating-text {
  color: #6b7280;
  font-size: 1.2000rem;
}

.owner-actions {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.owner-action {
  border-radius: 12px;
  padding: 11px 8px;
  font-size: 1.3001rem;
}

.owner-action:hover {
  transform: translateY(-2px);
}

.owner-action.danger {
  background: linear-gradient(135deg, #ff4d5e, #e11d48);
}

.owner-action.danger-alt {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

/* ============================================================
   Report section
   ============================================================ */
.productReport {
  margin-top: 26px;
  border-radius: 20px;
  padding: 22px 24px;
  border: 1px solid rgba(15, 39, 66, 0.09);
  box-shadow: 0 16px 40px rgba(2, 42, 70, 0.08);
}

.productReport .header span {
  font-size: 2.2000rem;
}

/* Service-not-found fallback (injected by serviceDetail.js) */
.detail-notfound {
  color: #14395d;
  font-size: 2.0000rem;
  font-weight: 600;
  padding: 24px 12px;
}

.reportContent form textarea {
  border-radius: 12px;
  border: 1.5px solid #dde8f2;
  padding: 12px 14px;
  font-size: 1.4000rem;
  background: var(--white);
  color: var(--blue-700);
}

.reportContent form textarea:focus {
  border-color: var(--brand-orange-500, var(--brand-orange-500));
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}

.reportContent form button {
  border-radius: 12px;
  width: auto;
  min-width: 150px;
  background: linear-gradient(135deg, #0b2b46, #2575fc);
  box-shadow: 0 8px 18px rgba(37, 117, 252, 0.25);
}

/* ============================================================
   Similar products / owner ads cards (.list)
   ============================================================ */
.layer3,
.layer4 {
  margin-top: 26px;
  border-radius: 20px;
  padding: 0;
  border: 1px solid rgba(15, 39, 66, 0.09);
  box-shadow: 0 16px 40px rgba(2, 42, 70, 0.08);
  background: var(--white);
}

.layer3 .detail-sec h1,
.layer4 .ownersAds h1 {
  font-size: 2.4000rem;
}

.list {
  border-radius: 16px;
  border: none;
  box-shadow: 0 12px 26px rgba(2, 42, 70, 0.14);
}

.list:hover {
  box-shadow: 0 16px 34px rgba(2, 42, 70, 0.2), 0 0 0 2px var(--brand-orange-500, var(--brand-orange-500));
}

.list .chip {
  background: rgba(4, 16, 28, 0.45);
  color: #ffd9ac;
  font-size: 1.0500rem;
  padding: 4px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 100px;
}

.list .image-p {
  background: linear-gradient(135deg, #0f2742, #14395d);
}

.list .product-h span {
  font-size: 1.6000rem;
}

.list .product-f .price {
  font-size: 1.6000rem;
  color: var(--brand-orange-300, #ff9d2e);
}

/* ============================================================
   Responsive refinements (V2)
   ============================================================ */
@media (max-width: 900px) {
  main {
    padding: 18px 14px 36px;
  }

  main .layer1 {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .layer1 .imageContainer {
    min-height: 0;
  }

  .productComments {
    grid-template-areas: "u" "c";
  }
}

@media (max-width: 640px) {
  main {
    padding: 12px 10px 30px;
  }

  main .layer1 {
    border-radius: 18px;
    gap: 14px;
  }

  .layer1 .imageContainer {
    border-radius: 14px;
    padding: 10px;
  }

  .imageContainer .mainImage {
    min-height: 240px;
  }

  .productSummary .productName span {
    font-size: 2.1001rem;
  }

  .productSummary .productPrice .Pprice span {
    font-size: 2.1001rem;
  }

  .productInformation {
    flex-direction: column;
    align-items: stretch;
  }

  .productInfo .info {
    display: flex;
    justify-content: space-between;
  }

  .productComments .comments,
  .productComments .userContainer {
    padding: 16px 14px;
  }

  .inputField button {
    width: 100%;
  }

  .reportContent form button {
    width: 100%;
  }
}

/* ============================================================
   Make-an-offer modal (negotiable listings) — matches the
   report modal pattern with dark-mode support.
   ============================================================ */
.offer-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 21000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 20, 36, 0.6);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.offer-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.offer-modal {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(2, 20, 36, 0.35);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.offer-modal-overlay.active .offer-modal {
  transform: translateY(0) scale(1);
}

.offer-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 39, 66, 0.08);
  color: var(--blue-800);
  font-size: 2.0000rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.offer-modal-close:hover {
  background: rgba(14, 122, 62, 0.12);
  color: #0e7a3e;
  transform: rotate(90deg);
}

.offer-modal h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.8000rem;
  font-weight: 700;
  color: var(--blue-900);
  margin-bottom: 4px;
}

.offer-modal-sub {
  font-size: 1.2500rem;
  color: #718096;
  margin-bottom: 6px;
  word-break: break-word;
}

.offer-modal-hint {
  font-size: 1.2000rem;
  line-height: 1.55;
  color: #8a94a6;
  margin-bottom: 14px;
}

.offer-field {
  display: block;
  margin-bottom: 12px;
}

.offer-field > span {
  display: block;
  font-size: 1.2500rem;
  font-weight: 600;
  color: var(--blue-800);
  margin-bottom: 6px;
}

.offer-field > span small {
  font-weight: 400;
  color: #8a94a6;
}

.offer-amount,
.offer-note {
  width: 100%;
  border: 1px solid rgba(15, 39, 66, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1.3001rem;
  font-family: "Poppins", sans-serif;
  color: var(--blue-900);
  background: var(--white);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.offer-amount {
  font-weight: 600;
}

.offer-amount:focus,
.offer-note:focus {
  border-color: #0e7a3e;
  box-shadow: 0 0 0 3px rgba(14, 122, 62, 0.14);
}

.offer-note {
  resize: vertical;
  min-height: 72px;
}

.offer-amount-hint {
  font-size: 1.1500rem;
  color: #e11d48;
  margin: -4px 0 10px;
}

.offer-block-warn {
  font-size: 1.1500rem;
  color: #e11d48;
  margin: -4px 0 10px;
}

.offer-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.offer-cancel,
.offer-submit {
  flex: 1;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  font-size: 1.3500rem;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.offer-cancel {
  background: rgba(15, 39, 66, 0.08);
  color: var(--blue-800);
}

.offer-cancel:hover {
  background: rgba(15, 39, 66, 0.14);
}

.offer-submit {
  background: linear-gradient(45deg, #0e7a3e, #22b05f);
  color: var(--white);
}

.offer-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(14, 122, 62, 0.3);
  filter: brightness(1.05);
}

.offer-submit:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

[data-theme="dark"] .offer-modal {
  background: #131c2e;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .offer-modal h3,
[data-theme="dark"] .offer-field > span {
  color: #eef4fb;
}

[data-theme="dark"] .offer-modal-close {
  background: rgba(238, 244, 251, 0.08);
  color: #dbe6f3;
}

[data-theme="dark"] .offer-amount,
[data-theme="dark"] .offer-note {
  background: #0a101d;
  border-color: rgba(238, 244, 251, 0.16);
  color: #eef4fb;
}

[data-theme="dark"] .offer-cancel {
  background: rgba(238, 244, 251, 0.08);
  color: #dbe6f3;
}

[data-theme="dark"] .offer-cancel:hover {
  background: rgba(238, 244, 251, 0.14);
}

@media (max-width: 480px) {
  .offer-modal {
    padding: 18px;
  }

  .offer-modal-actions {
    flex-direction: column-reverse;
  }
}

/* ============================================================
   Similar / owner cards — compact 3-column grid on phones
   The strips scroll horizontally with fixed 250px cards on
   desktop/tablet. Below 640px they wrap into a small grid so
   the cards are tiny like the marketplace (3 per row) and can
   never overflow the parent.
   ============================================================ */
@media (max-width: 640px) {
  .detail-sec .sProducts,
  .layer4 .oAds {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    flex-wrap: wrap;
    padding: 4px 2px 12px;
    scroll-snap-type: none;
  }

  /* Beat the inline max-width:250px on each card anchor. */
  .sProducts a {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    flex: none;
    display: flex;
  }

  .sProducts .list {
    flex: 0 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    border-radius: 10px;
  }

  .sProducts .list .image-p {
    height: 70px;
  }

  .sProducts .list .product-data {
    gap: 3px;
    padding: 5px 6px 7px;
  }

  .sProducts .list .product-h {
    font-size: 0.7200rem;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .sProducts .list .product-h span {
    font-size: 0.6800rem;
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .sProducts .list .product-h svg {
    display: none;
  }

  .sProducts .list .product-d {
    display: none;
  }

  .sProducts .list .product-f {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .sProducts .list .view-btn span {
    font-size: 0.5001rem !important;
  }

  .sProducts .list .price {
    font-size: 0.7200rem;
    line-height: 1;
  }

  .sProducts .list .chip-cnt {
    gap: 2px;
    padding: 4px 5px;
  }

  .sProducts .list .chip-cnt .chip {
    font-size: 0.4500rem;
    padding: 1px 4px;
  }

  /* Ads By Username — new card grid */
  .layer4 .oAds {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px 12px 14px;
  }
  .oa-card-img {
    height: 120px;
  }
  .oa-card-body {
    padding: 10px 10px 12px;
    gap: 6px;
  }
  .oa-card-title {
    font-size: 0.8199rem;
  }
  .oa-card-desc {
    font-size: 0.7200rem;
    -webkit-line-clamp: 1;
  }
  .oa-card-meta {
    padding-top: 8px;
  }
  .oa-card-condition,
  .oa-card-region {
    font-size: 0.6500rem;
    padding: 2px 7px;
  }
  .oa-card-price {
    font-size: 0.7500rem;
    padding: 4px 10px;
  }
}

/* Very narrow phones: 2 columns so the cards stay readable. */
@media (max-width: 340px) {
  .detail-sec .sProducts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layer4 .oAds {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Mobile polish — productDetail / serviceDetail
   Appended last so these win over the cohesion restyle and the
   earlier mobile media queries. Goals: no horizontal page
   overflow, a draggable thumbnail strip, compact-but-readable
   text, and a user-nav pill that never crowds the title.
   ============================================================ */
@media (max-width: 640px) {
  /* Safety net: never allow a horizontal page scroll on phones. */
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  /* --- Watchlist button: the :hover "expand to 180px" rule
       sticks on touch screens (tap fires hover and holds it),
       which pushed the page ~46px wide. Pin it small on phones
       and never let it grow. --- */
  .productPrice .watchlist,
  .productPrice .watchlist:hover,
  .productPrice .watchlist:focus {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px;
    flex: 0 0 34px;
    overflow: hidden;
    border-radius: 10px;
    box-sizing: border-box;
    padding: 0;
  }
  .productPrice .watchlist .text,
  .productPrice .watchlist:hover .text,
  .productPrice .watchlist:focus .text {
    display: none !important;
  }
  .productPrice .watchlist svg {
    width: 22px;
    height: 22px;
  }

  /* --- Thumbnail strip: horizontally draggable / scrollable --- */
  .imageContainer .thumbnails {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    justify-content: flex-start;
    scroll-snap-type: x proximity;
    scroll-padding-left: 2px;
    padding-bottom: 2px;
  }
  .thumbnails .thumbnail {
    flex: 0 0 78px;
    width: 78px;
    height: 100%;
    scroll-snap-align: start;
  }

  /* --- Compact text: smaller but still readable --- */
  .productSummary .productName span {
    font-size: 1.6999rem;
    line-height: 1.25;
  }
  .productSummary .productPrice .Pprice {
    font-size: 1.6000rem;
  }
  .productSummary .productPrice .Pprice span {
    font-size: 1.6999rem;
  }
  .productSummary .productPrice .neg-tag {
    font-size: 0.9001rem;
    padding: 3px 8px;
    margin-left: 8px;
  }
  .productSummary .productDescription {
    font-size: 1.2500rem;
    line-height: 1.6;
    padding: 10px 12px;
  }
  .productSummary .uname span:nth-child(2) {
    font-size: 1.1500rem;
  }
  .productInformation .productInfo .info {
    font-size: 1.1500rem;
    padding: 6px 10px;
  }
  .commentData span.reviewComment {
    font-size: 1.2000rem;
    line-height: 1.55;
  }
  .layer3 .detail-sec h1,
  .layer4 .ownersAds h1 {
    font-size: 1.6999rem;
  }
}

/* --- Floating user-nav pill: compact on phones so it never
     crowds the product title or the right edge. --- */
@media (max-width: 640px) {
  #user-nav-js {
    top: 10px;
    right: 10px;
    gap: 5px;
    padding: 5px 8px;
  }
  #user-nav-js img.userIcon {
    width: 26px !important;
    height: 26px !important;
    border-width: 1.5px;
  }
  #user-nav-js a svg {
    width: 20px !important;
    height: 20px !important;
  }
  #user-nav-js a.login-btn {
    padding: 0.4500rem 0.9001rem;
    font-size: 1.2000rem;
  }
}

/* ============================================================
   Detail sections — Recently Viewed / Similar / Saved For Later
   each get their OWN container box, stacked inside .layer3.
   Appended last so these win over the legacy rules that referenced
   the old .similarProducts wrapper (replaced by .detail-sec).
   ============================================================ */
.layer3 {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 16px;
  padding: 14px;
}

.detail-sec {
  width: 100%;
  min-width: 0;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid rgba(15, 39, 66, 0.14);
  box-shadow: 0 12px 32px rgba(2, 42, 70, 0.12);
  padding: 12px 12px 8px;
}

.detail-sec[hidden] {
  display: none;
}

.detail-sec h1 {
  font-size: var(--h1);
  color: var(--blue-900);
  padding: 6px 10px 10px;
  margin: 0;
  border-bottom: 1px solid rgba(15, 39, 66, 0.1);
}

/* Recently-viewed and Saved-for-later get a tinted separator edge so they
   read as distinct sections from "Similar". */
.detail-sec[data-sec="recently-viewed-detail"] {
  border-bottom: 3px solid rgba(255, 138, 43, 0.85);
}

.detail-sec[data-sec="wishlist-detail"] {
  border-bottom: 3px solid rgba(37, 117, 252, 0.75);
}

/* ---- Recently-viewed / Saved-for-later mk-cards (same width as the
   .list similar cards so all three strips line up). ---- */
/* The strip cards show up to four chips (region, category, condition,
   Negotiable) — let the band wrap so every chip is visible instead of
   truncating the row, and keep the chips compact so two rows fit neatly. */
.js-recent-detail .mk-card-chips,
.js-wishlist-detail .mk-card-chips {
  flex-wrap: nowrap;
  gap: 4px 5px;
  padding: 7px 9px;
  overflow: hidden;
}

.js-recent-detail .mk-card-chips .mk-chip,
.js-wishlist-detail .mk-card-chips .mk-chip {
  font-size: 0.6201rem;
  padding: 3px 8px;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.js-recent-detail .mk-card,
.js-wishlist-detail .mk-card {
  /* Same width as the .list similar cards (the strip anchors are 250px) so
     the square image fills the card exactly — no off-centre clipping. */
  flex: 0 0 250px;
  width: 250px;
  min-width: 250px;
  background: var(--white);
  border-color: var(--line);
}

.js-recent-detail .mk-card:hover,
.js-wishlist-detail .mk-card:hover {
  border-color: var(--brand-orange-200, #ffb463);
}

/* ---- mk-card component (replicated from marketplace.css) — the detail
   pages don't load marketplace.css, so the recently-viewed / saved-for-later
   strips render these classes with no base styles. Colors are inlined (no
   --mk-* variables exist on these pages); dark mode is handled by theme.css. ---- */
.mk-card {
  position: relative;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(11, 31, 49, 0.1);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.mk-card-media {
  position: relative;
}

.mk-card:hover {
  transform: translateY(-8px);
  border-color: var(--brand-orange-200, #ffb463);
  box-shadow:
    0 26px 52px rgba(11, 31, 49, 0.2),
    0 0 0 1.5px rgba(255, 138, 43, 0.4),
    0 12px 34px rgba(255, 138, 43, 0.2);
}

.mk-featured {
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.12);
}

.mk-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.mk-card-img {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #eef3f9;
}

.mk-card-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.mk-card:hover .mk-card-img img {
  transform: scale(1.06);
}

.mk-card-chips {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 8px 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fbfe, #eef3f9);
  border-bottom: 1px solid var(--line);
}

.mk-chip {
  font-size: 0.6800rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--white);
  color: var(--brand-navy-700, var(--brand-navy-700));
  border: 1px solid #14395d;
  padding: 4px 10px;
  border-radius: 999px;
  min-width: 0;
  max-width: 100%;
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mk-chip.deal {
  background: linear-gradient(135deg, #ff5f6d, #ff2d55);
  border-color: #e11d48;
  color: var(--white);
}

.mk-chip.feat {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-color: #d97706;
  color: #1c1917;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mk-card-body {
  padding: 15px 16px 18px;
}

.mk-card-title {
  font-weight: 600;
  font-size: 1.1200rem;
  color: #0b1f31;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mk-card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}

.mk-card-price {
  font-weight: 700;
  font-size: 1.2500rem;
  color: var(--brand-orange-400, var(--brand-orange-400));
  flex-shrink: 0;
}

/* ---- Similar/owner cards: chips move into a band at the top of the card
   (matching the mk-card chip band) instead of floating over the image. ---- */
.list .chip-cnt {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  z-index: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  background: linear-gradient(180deg, #f8fbfe, #eef3f9);
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--brand-navy-700, var(--brand-navy-700));
  overflow: hidden;
}

.chip-cnt .chip,
.list .chip-cnt .chip,
.list .chip {
  background: var(--white);
  color: var(--brand-navy-700, var(--brand-navy-700));
  border: 1px solid #14395d;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.6800rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: default;
  transition: 0.2s ease;
  min-width: 0;
  flex-shrink: 0;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-cnt .chip:hover {
  background: #eef6fd;
  border-color: #2575fc;
  color: #08395f;
}

/* ---- Detail CTAs: Contact Seller is the secondary outline option, Buy
   Securely is the primary navy button. Overrides the legacy gradient
   versions defined earlier in this file (matches theme.css dark palette). ---- */
.buyButton button {
  background: var(--white);
  border: 1.5px solid #a8d0f5;
  color: #0b4f8a;
  box-shadow: 0 4px 10px rgba(11, 79, 138, 0.08);
}

.buyButton button:hover {
  background: #f0f8ff;
  border-color: #4f76ad;
  color: #08395f;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(11, 79, 138, 0.16);
}

button.escrowProduct {
  background: linear-gradient(135deg, #144a72, #0e6b9c);
  border: none;
  color: var(--white);
  box-shadow: 0 10px 22px rgba(11, 79, 138, 0.28);
}

button.escrowProduct:hover {
  background: linear-gradient(135deg, #1a5a86, #0f7fb8);
  box-shadow: 0 14px 28px rgba(11, 79, 138, 0.35);
}

/* ---- Mobile: strips collapse into the same compact grid as before ---- */
@media (max-width: 640px) {
  .detail-sec .sProducts .mk-card {
    flex: 0 1 auto;
    width: 100%;
    min-width: 0;
  }

  .detail-sec .mk-card-body {
    padding: 8px 9px 10px;
  }

  .detail-sec .mk-card-title {
    font-size: 0.7401rem;
    margin-bottom: 4px;
  }

  .detail-sec .mk-card-price {
    font-size: 0.8000rem;
  }

  .detail-sec .mk-card-chips {
    padding: 5px 6px;
    gap: 4px;
  }

  .detail-sec .mk-chip {
    font-size: 0.5401rem;
    padding: 3px 7px;
  }

  .detail-sec .mk-card-chips .mk-chip {
    font-size: 0.5001rem;
    padding: 2px 6px;
  }

  .layer3 .detail-sec h1 {
    font-size: 1.6999rem;
  }
}

/* ---- Similar/owner cards: normalize the tiny inline font sizes the JS
   emits (8px/5px) so the card footer is actually readable. ---- */
.sProducts .list .view-btn span {
  font-size: 0.6000rem !important;
  line-height: 1.4;
  color: #6b7d95 !important;
}

.sProducts .list .view-btn span span {
  color: #6b7d95 !important;
}

/* ---- Review gate: hide the form until the visitor can actually review
   (purchase complete + funds released). ---- */
#reviewFormBox.gated .inputField,
#reviewFormBox.gated .comment-photo-picker {
  display: none;
}

.review-gate-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 39, 66, 0.06);
  border: 1px dashed rgba(15, 39, 66, 0.28);
  color: var(--blue-900);
  font-size: 0.9001rem;
  line-height: 1.55;
}

.review-gate-note a {
  color: #2575fc;
  font-weight: 600;
}

.review-gate-note svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

/* ===== Dark mode: floating user-nav ===== */
[data-theme="dark"] .user-nav-handle {
  background: linear-gradient(135deg, #162d47, #0e4e78);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .user-nav-expanded {
  background: rgba(14, 20, 35, 0.97);
  border-color: rgba(238, 244, 251, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .user-nav-expanded .user-nav-close {
  background: rgba(238, 244, 251, 0.08);
  color: #dbe6f3;
}

[data-theme="dark"] .user-nav-expanded .user-nav-close:hover {
  background: rgba(238, 244, 251, 0.18);
  color: var(--white);
}

[data-theme="dark"] .user-nav-expanded .user-nav-link {
  color: #dbe6f3;
}

[data-theme="dark"] .user-nav-expanded .user-nav-link:hover {
  background: rgba(238, 244, 251, 0.08);
  color: #5cb8ff;
}

[data-theme="dark"] .user-nav-expanded .user-nav-link.login-btn {
  background: linear-gradient(135deg, #ff8a00, #ffb15e);
  color: var(--white);
}

[data-theme="dark"] .user-nav-expanded .user-nav-link.logout-btn {
  color: #f87171;
}

[data-theme="dark"] .user-nav-expanded .user-nav-link.logout-btn:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

/* ===== Dark mode: discount pricing ===== */
[data-theme="dark"] .price-orig {
  color: #6b7280;
  text-decoration-color: #4b5563;
  opacity: 0.55;
}

[data-theme="dark"] .Pprice span:not(.price-orig):not(.discount-tag):not(.neg-tag) {
  color: var(--orange-400);
}

[data-theme="dark"] .discount-tag {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

/* ===== Mobile: user-nav refinements ===== */
@media (max-width: 640px) {
  #user-nav-js {
    top: auto;
    bottom: 80px;
    right: 14px;
  }

  /* Keep the expanded panel roomy and well aligned on phones. The global
     .login-btn mobile compaction above must NOT crush the in-panel links —
     give them comfortable tap sizes and full-width alignment so the
     logged-out "Log In / Sign Up" view looks clean, never cramped. */
  .user-nav-expanded {
    min-width: 200px;
    max-width: calc(100vw - 28px);
  }
  .user-nav-expanded .user-nav-links {
    width: 100%;
    gap: 6px;
  }
  .user-nav-expanded .user-nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
    font-size: 1.0000rem;
  }
  .user-nav-expanded .user-nav-link.login-btn,
  .user-nav-expanded .user-nav-link.logout-btn {
    padding: 12px 16px;
    font-size: 1.0000rem;
    justify-content: center;
    text-align: center;
  }
}

/* ============================================================
   Share Modal
   ============================================================ */

.share-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(15, 39, 66, 0.06);
  color: var(--blue-800, #1e3a5f);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.share-trigger:hover {
  background: rgba(255, 127, 17, 0.12);
  color: var(--brand-orange-500, var(--brand-orange-500));
  transform: scale(1.06);
}
.share-trigger:active {
  transform: scale(0.95);
}

.share-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 20, 36, 0.6);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.share-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.share-modal {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(2, 20, 36, 0.35);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.share-modal-overlay.active .share-modal {
  transform: translateY(0) scale(1);
}

.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}

.share-modal-header h3 {
  margin: 0;
  font-size: 1.1500rem;
  font-weight: 700;
  color: var(--neutral-800, var(--neutral-800));
}

.share-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 39, 66, 0.07);
  color: var(--neutral-500, var(--neutral-500));
  font-size: 1.4000rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.share-modal-close:hover {
  background: rgba(229, 72, 77, 0.1);
  color: #e5484d;
}

.share-modal-preview {
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--neutral-200);
}

.share-modal-item-name {
  margin: 0 0 4px;
  font-size: 0.9500rem;
  font-weight: 600;
  color: var(--neutral-800, var(--neutral-800));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-modal-item-price {
  margin: 0;
  font-size: 1.1001rem;
  font-weight: 700;
  color: var(--brand-orange-500, var(--brand-orange-500));
}

.share-modal-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 18px 22px;
}

.share-modal-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--neutral-200);
  border-radius: 12px;
  background: var(--neutral-50, var(--neutral-50));
  color: var(--neutral-800, var(--neutral-800));
  font-size: 0.8800rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-modal-btn:hover {
  border-color: var(--share-color, var(--brand-orange-500, var(--brand-orange-500)));
  background: var(--share-color, var(--brand-orange-500, var(--brand-orange-500)));
  color: #1a0d00;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.share-modal-btn:active {
  transform: translateY(0);
}

.share-modal-btn:hover .share-modal-btn-icon {
  background: rgba(255, 255, 255, 0.2) !important;
  color: var(--white) !important;
}

.share-modal-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.share-modal-btn-label {
  white-space: nowrap;
}

.share-modal-footer {
  padding: 0 22px 18px;
}

.share-modal-url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--neutral-100, var(--neutral-100));
  color: var(--neutral-500, var(--neutral-500));
  font-size: 0.7801rem;
  overflow: hidden;
}

.share-modal-url-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Dark mode --- */
[data-theme="dark"] .share-trigger {
  background: rgba(255, 255, 255, 0.08);
  color: var(--neutral-400, var(--neutral-400));
}
[data-theme="dark"] .share-trigger:hover {
  background: rgba(255, 127, 17, 0.15);
  color: var(--brand-orange-500, var(--brand-orange-500));
}
[data-theme="dark"] .share-modal {
  background: #16233a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .share-modal-header h3 {
  color: #e0e8f3;
}
[data-theme="dark"] .share-modal-close {
  background: rgba(255, 255, 255, 0.08);
  color: var(--neutral-400, var(--neutral-400));
}
[data-theme="dark"] .share-modal-close:hover {
  background: rgba(229, 72, 77, 0.15);
  color: #fca5a5;
}
[data-theme="dark"] .share-modal-preview {
  border-bottom-color: #24324f;
}
[data-theme="dark"] .share-modal-item-name {
  color: #e0e8f3;
}
[data-theme="dark"] .share-modal-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: #e0e8f3;
}
[data-theme="dark"] .share-modal-btn:hover {
  background: var(--share-color, var(--brand-orange-500, var(--brand-orange-500)));
  border-color: var(--share-color, var(--brand-orange-500, var(--brand-orange-500)));
  color: #1a0d00;
}
[data-theme="dark"] .share-modal-url {
  background: rgba(255, 255, 255, 0.06);
  color: var(--neutral-400, var(--neutral-400));
}

/* --- Mobile --- */
@media (max-width: 480px) {
  .share-modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }
  .share-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .share-modal-options {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 14px 16px;
  }
  .share-modal-btn {
    padding: 10px 12px;
    font-size: 0.8199rem;
  }
}

/* ============================================================
   Mobile responsive: similar products, group deals, chips
   ============================================================ */
@media (max-width: 768px) {
  .layer-group-deals {
    margin-top: 14px;
    border-radius: 14px;
  }
  .group-deals-header {
    padding: 14px 16px;
  }
  .group-deals-header span {
    font-size: 1.4999rem;
  }
  .group-deals-body {
    padding: 16px;
  }
  .gb-wrap .gb-form-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .gb-wrap .gb-form-row input {
    max-width: 100%;
    width: 100%;
  }
  .gb-wrap .gb-form-row label {
    min-width: auto;
  }
}

@media (max-width: 640px) {
  .list .chip-cnt {
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
  }
  .chip-cnt .chip,
  .list .chip-cnt .chip,
  .list .chip {
    font-size: 0.5799rem;
    padding: 3px 8px;
    max-width: none;
  }
  .layer-group-deals {
    margin-top: 10px;
    border-radius: 12px;
  }
  .group-deals-header {
    padding: 12px 14px;
  }
  .group-deals-header span {
    font-size: 1.3001rem;
  }
  .group-deals-body {
    padding: 12px 14px;
  }
  .detail-sec .sProducts .list .chip-cnt {
    flex-wrap: wrap;
    gap: 3px;
    padding: 5px 7px;
  }
  .detail-sec .sProducts .list .chip-cnt .chip,
  .detail-sec .sProducts .list .chip {
    font-size: 0.5200rem;
    padding: 2px 6px;
  }
  /* Ensure similar products text wraps properly */
  .sProducts .list .product-data {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .sProducts .list .product-h span {
    white-space: normal;
    font-size: 0.9001rem;
  }
  .sProducts .list .product-d {
    font-size: 0.6999rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .layer-group-deals {
    border-radius: 10px;
  }
  .group-deals-header span {
    font-size: 1.2000rem;
  }
  .group-deals-body {
    padding: 10px 12px;
  }
  .list .chip-cnt {
    gap: 3px;
    padding: 5px 6px;
  }
  .chip-cnt .chip,
  .list .chip-cnt .chip,
  .list .chip {
    font-size: 0.5001rem;
    padding: 2px 6px;
  }
  /* Similar product cards stack vertically on small phones */
  .detail-sec .sProducts .list {
    max-width: 100%;
  }
  .sProducts .list .product-h span {
    font-size: 0.8000rem;
  }
}

/* Dark mode: group deals layer */
[data-theme="dark"] .layer-group-deals {
  background: #121a2b;
  border-color: #263449;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .group-deals-header {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.06));
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .group-deals-header svg {
  color: #4ade80;
}
[data-theme="dark"] .group-deals-header span {
  color: #e8eef7;
}

/* ============================================================
   Breadcrumb navigation (detail pages)
   ============================================================ */
.dt-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  margin-bottom: 8px;
  font-size: 0.8500rem;
  color: #6b7d95;
  flex-wrap: wrap;
}
.dt-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--blue-700, #14395d);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.dt-breadcrumb a:hover {
  color: var(--orange-500, var(--brand-orange-500, var(--brand-orange-500)));
}
.dt-crumb-sep {
  display: inline-flex;
  align-items: center;
  color: #b0c4d8;
  flex-shrink: 0;
}
.dt-crumb-current {
  color: var(--blue-900, #0b1f3a);
  font-weight: 600;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   Restyled section headers — Similar Products / Ads By Username
   ============================================================ */
.layer3 .detail-sec h1,
.layer4 .ownersAds h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.6000rem;
  font-weight: 700;
  color: var(--blue-900, #0b1f3a);
  padding: 14px 18px 12px;
  margin: 0;
  border-bottom: 2px solid rgba(15, 39, 66, 0.08);
  position: relative;
}
.layer3 .detail-sec h1::before,
.layer4 .ownersAds h1::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--orange-500, var(--brand-orange-500, var(--brand-orange-500))), var(--indigo-500, #2575fc));
  flex-shrink: 0;
}

/* Empty states */
.no-similar,
.no-ads {
  text-align: center;
  padding: 32px 20px;
  color: #8fa4b8;
  font-size: 0.9500rem;
  font-weight: 500;
}
.no-similar::before,
.no-ads::before {
  content: '';
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.08), rgba(37, 117, 252, 0.08));
}

/* Owner ads section — slightly different accent */
.layer4 .ownersAds h1::before {
  background: linear-gradient(180deg, var(--indigo-500, #2575fc), var(--cyan-500, #00c6ff));
}

@media (max-width: 640px) {
  .dt-breadcrumb {
    font-size: 0.7801rem;
    padding: 8px 2px;
    gap: 4px;
  }
  .dt-crumb-current {
    max-width: 140px;
  }
  .layer3 .detail-sec h1,
  .layer4 .ownersAds h1 {
    font-size: 1.2500rem;
    padding: 12px 14px 10px;
    gap: 8px;
  }
  .layer3 .detail-sec h1::before,
  .layer4 .ownersAds h1::before {
    height: 18px;
  }
  .no-similar,
  .no-ads {
    padding: 24px 16px;
    font-size: 0.8500rem;
  }
}

[data-theme="dark"] .dt-crumb-current {
  color: #cfe3f7;
}
[data-theme="dark"] .dt-breadcrumb a {
  color: #7eb8e0;
}
[data-theme="dark"] .dt-crumb-sep {
  color: #3a5270;
}

/* ============================================================
   Dark mode — Ads By Username cards
   ============================================================ */
[data-theme="dark"] .oa-card {
  background: #121a2b;
  border-color: #24314b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .oa-card:hover {
  border-color: rgba(255, 138, 43, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(255, 138, 43, 0.12);
}
[data-theme="dark"] .oa-card-img {
  background: linear-gradient(135deg, #0a101d, #111b2e);
}
[data-theme="dark"] .oa-card-price {
  background: linear-gradient(135deg, #0a101d, #1a2a44);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .oa-card-body {
  background: #121a2b;
}
[data-theme="dark"] .oa-card-title {
  color: #eef4fb;
}
[data-theme="dark"] .oa-card-desc {
  color: #7b8fa5;
}
[data-theme="dark"] .oa-card-meta {
  border-top-color: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .oa-card-condition,
[data-theme="dark"] .oa-card-region {
  color: #8ba3b9;
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================================
   Wholesale terms (is_wholesale listings). Filled by
   renderWholesaleTerms() in assets/js/productDetail.js — hidden for
   every listing that is not wholesale.
   ============================================================ */
.ws-terms {
  margin: 18px 0 4px;
  padding: 16px 18px;
  border: 1px solid rgba(15, 118, 110, 0.3);
  border-left: 4px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.06);
}

.ws-terms-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ws-terms-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #0f766e;
  color: var(--white);
  font-size: 0.6601rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ws-terms-title {
  margin: 0;
  font-size: 1.0500rem;
  color: var(--brand-navy-700, var(--brand-navy-700));
}

.ws-terms-facts {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.ws-terms-facts li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.9001rem;
}

.ws-terms-facts b { color: var(--brand-navy-700, var(--brand-navy-700)); }
.ws-terms-facts span { color: #0b5f59; font-weight: 700; }

.ws-terms-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 10px;
}

.ws-terms-table caption {
  padding-bottom: 6px;
  text-align: left;
  font-size: 0.7200rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7a8d;
}

.ws-terms-table td {
  padding: 7px 10px;
  border-top: 1px solid rgba(11, 60, 93, 0.12);
  font-size: 0.9001rem;
  color: var(--brand-navy-700, var(--brand-navy-700));
}

.ws-terms-table td:last-child {
  text-align: right;
  font-weight: 700;
}

.ws-terms-note {
  margin: 0;
  font-size: 0.8500rem;
  line-height: 1.55;
  color: #4a5a6a;
}

[data-theme="dark"] .ws-terms {
  background: rgba(13, 148, 136, 0.12);
  border-color: rgba(13, 148, 136, 0.4);
}

[data-theme="dark"] .ws-terms-title,
[data-theme="dark"] .ws-terms-facts b,
[data-theme="dark"] .ws-terms-table td {
  color: #eef4fb;
}

[data-theme="dark"] .ws-terms-facts span { color: #7fd8cf; }
[data-theme="dark"] .ws-terms-note { color: #9fb2c6; }
[data-theme="dark"] .ws-terms-table td { border-top-color: rgba(255, 255, 255, 0.08); }

@media (max-width: 560px) {
  .ws-terms { padding: 14px 12px; }
  .ws-terms-facts { gap: 6px 12px; }
  .ws-terms-table td { padding: 6px 4px; font-size: 0.8500rem; }
}
/* Available-stock slider (renderWholesaleTerms in productDetail.js). */
.ws-stock {
  margin: 2px 0 12px;
}

.ws-stock-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
  font-size: 0.8500rem;
}

.ws-stock-head b { color: var(--brand-navy-700, var(--brand-navy-700)); }

.ws-stock-head span {
  font-weight: 700;
  color: #0f766e;
}

.ws-stock-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(11, 60, 93, 0.14);
  overflow: hidden;
}

.ws-stock-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.ws-stock--mid .ws-stock-fill {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.ws-stock--low .ws-stock-fill {
  background: linear-gradient(90deg, var(--danger-600, var(--danger-600)), #ef4444);
}

.ws-stock--empty .ws-stock-fill {
  background: var(--neutral-400, var(--neutral-400));
}

[data-theme="dark"] .ws-stock-head b { color: #eef4fb; }
[data-theme="dark"] .ws-stock-head span { color: #7fd8cf; }
[data-theme="dark"] .ws-stock-track { background: rgba(255, 255, 255, 0.14); }

/* ============================================================
   Wholesale quantity stepper
   ------------------------------------------------------------
   Replaces the old "arrange bulk orders with the seller" note.
   The buyer picks a real quantity here; Secure Buy carries it to
   checkout and the server re-prices the line from the listing's
   own tiers, minimum order and stock ceiling.
   ============================================================ */
.ws-qty {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--md-outline-variant, #d6e2ee);
}
.ws-qty-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9001rem;
}
.ws-qty-head span { color: var(--md-on-surface-variant, #5c6b7a); font-size: 0.8000rem; }
.ws-qty-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ws-qty-btn {
  width: 44px; height: 44px;
  border: 1px solid #d6e2ee; background: var(--white); border-radius: 10px;
  font-size: 1.2000rem; line-height: 1; cursor: pointer; color: #14395d;
}
.ws-qty-btn:hover:not(:disabled) { border-color: #14395d; }
.ws-qty-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ws-qty-input {
  width: 96px; height: 44px; text-align: center;
  font-size: 1.0000rem; font-weight: 600; color: inherit;
  border: 1px solid #d6e2ee; border-radius: 10px; padding: 0 8px;
  background: transparent;
}
.ws-qty-total {
  margin: 10px 0 0;
  display: flex; justify-content: space-between;
  font-size: 0.9001rem; color: var(--md-on-surface-variant, #5c6b7a);
}
.ws-qty-total b { color: #14395d; font-size: 1.0000rem; }
[data-theme="dark"] .ws-qty-btn,
[data-theme="dark"] .ws-qty-input { background: #121a2b; border-color: #33455e; color: #e8eef7; }
[data-theme="dark"] .ws-qty-total b { color: #ffb26b; }

/* ------------------------------------------------------------------
   Layers between the product card and Customer Reviews were collapsing
   to zero height: `main` is an absolutely positioned flex column with
   height:100%, so every layer became a shrinking flex item. Keep their
   natural height instead of squeezing them into the viewport.
   ------------------------------------------------------------------ */
main {
  height: auto;
  min-height: 100vh;
}

main > .layer1,
main > .layer-market,
main > .layer-group-deals,
main > .layer-auction,
main > .layer2,
main > .layer3,
main > .layer4 {
  flex: 0 0 auto;
  align-self: stretch;
}

main > .layer-market[hidden],
main > .layer-group-deals[hidden],
main > .layer-auction[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------
   The product column had no definite height: `main`/`.layer1` are
   auto-height flex rows, so `.mainImage { height: 80% }` resolved
   against an indefinite height and collapsed the image (and with it,
   the visual weight of the whole first layer). Give the media column a
   real height instead of a percentage of nothing.
   ------------------------------------------------------------------ */
main .layer1 .imageContainer {
  height: auto;
  min-height: 520px;
}

main .layer1 .imageContainer .mainImage {
  height: clamp(320px, 46vw, 560px);
}

main .layer1 .imageContainer .mainImage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

main .layer1 .productSummary {
  height: auto;
  min-height: 0;
  overflow: visible;
}

@media (max-width: 900px) {
  main .layer1 .imageContainer { min-height: 0; }
  main .layer1 .imageContainer .mainImage { height: clamp(240px, 62vw, 420px); }
}

/* ==================================================================
   Page-scroll architecture fix (permanent)
   ------------------------------------------------------------------
   `main` used to be `position: absolute; height: 100%` inside a fixed
   shell, while individual sections kept their own fixed heights
   (reviews = 410px, inner comment list scrollable). With the auction,
   market and group-deal layers now above the reviews, the document
   scroller and those nested scrollers disagreed: the window stayed at
   scrollY 0 while content was visually offset, and the wheel got
   captured by the review list, so the page could not scroll back up.

   Normal document flow only: one scroller (the document), no nested
   scroll traps, no absolute main.
   ================================================================== */
html,
body {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
  overflow-x: clip;
}

main {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  height: auto;
  min-height: 0;
  z-index: 2;
}

/* One scroller: the page. Nothing inside may trap the wheel. */
main > .layer1,
main > .layer-market,
main > .layer-group-deals,
main > .layer-auction,
main > .layer2,
main > .layer3,
main > .layer4 {
  flex: none;
  height: auto;
  max-height: none;
  overflow: visible;
}

.layer2,
.productComments,
.productComments .comments,
.productComments .userContainer {
  height: auto;
  max-height: none;
  overflow: visible;
}

/* Keep the product card's own image height, but let it shrink on phones. */
@media (max-width: 900px) {
  main { padding: 12px; }
}

/* ============================================================
   CHIP ROWS: ONE LINE EVERYWHERE ON DETAIL PAGES
   The user asked for the product tags/chips on detail pages to
   stay on a single row and never wrap to a second line.
   Applies to the existing `.chip-cnt`, `.attr-chips` and `.list .chip`
   patterns found across the detail sheets, without renaming classes
   or changing JS/PHP hooks.
   ============================================================ */

/* 1) The absolute overlay chip band on listing cards live on detail pages.
   It is already nowrap per chip; make the band itself never wrap so the
   whole row stays on one line. Shrink chips to fit, then truncate, never
   drop to a second line. */
.list .chip-cnt,
.sProducts .list .chip-cnt,
.detail-sec .sProducts .list .chip-cnt,
.detail-extra .chip-cnt,
.productSummary .chip-cnt {
  flex-wrap: nowrap !important;
  gap: 6px;
  overflow: visible;
}
.list .chip-cnt .chip,
.sProducts .list .chip-cnt .chip,
.detail-sec .sProducts .list .chip-cnt .chip,
.detail-extra .chip-cnt .chip,
.productSummary .chip-cnt .chip {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 2) Attribute / detail chips: keep on one line where the container is
   wide enough, but do NOT force overflow:hidden on the whole row if the
   page would then clip real content. Chips themselves stay nowrap so each
   chip is one line; the row wraps only as a last resort and each chip
   still fits on one line. */
.attr-chips,
.detail-extra .attr-chips,
.productSummary .attr-chips,
.productDescription + .attr-chips {
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
[data-theme="dark"] .attr-chips {
  overflow-x: auto;
}
.attr-chip,
a.attr-chip,
.detail-extra .attr-chip,
.productSummary .attr-chip,
.detail-extra a.attr-chip,
.productSummary a.attr-chip {
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* 3) Product page secondary/related listing chips (the marketplace-style
   `.list .chip` overlay on the small cards on detail pages) — one line. */
.list .chip,
.sProducts .list .chip,
.detail-sec .sProducts .list .chip,
.layer3 .list .chip,
.layer4 .list .chip {
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Visibility safety net: readable base text in both themes
   ============================================================ */
[data-theme="light"] .layer-market,
[data-theme="light"] .product-detail,
[data-theme="light"] .layer-auction {
  color: #0b1f3a;
}
[data-theme="dark"] .layer-market,
[data-theme="dark"] .product-detail,
[data-theme="dark"] .layer-auction {
  color: #e8eef7;
}
