/* BALELE v3 Phase 8 Step 9G — Single Pin SEO Page + Market-first Detail Refactor */
body.balele-body.balele-page-single-pin,
body.balele-ui-v56.balele-page-single-pin,
body.balele-page-single-pin {
  height: auto !important;
  min-height: 100vh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: #f7f7fa !important;
  color: #1a1a2e !important;
}

.balele-single-pin-page {
  --purple:#6C5CE7;
  --purple-dark:#5A4BD1;
  --purple-pale:#EDE9FE;
  --purple-bg:#F5F3FF;
  --orange:#FF8C42;
  --orange-pale:#FFF3EB;
  --green:#00B894;
  --green-pale:#E6FBF5;
  --red:#FF6B6B;
  --red-pale:#FFE8E8;
  --blue:#0984E3;
  --blue-pale:#E8F4FD;
  --black:#1A1A2E;
  --dark:#2D2D44;
  --gray-800:#4A4A5A;
  --gray-600:#6B6B80;
  --gray-400:#9898A8;
  --gray-200:#D1D1DA;
  --gray-100:#ECECF0;
  --gray-50:#F7F7FA;
  --white:#FFFFFF;
  --radius-xs:6px;
  --radius-sm:10px;
  --radius-md:14px;
  --radius-lg:18px;
  --shadow-sm:0 1px 3px rgba(0,0,0,.06);
  --shadow-md:0 4px 12px rgba(0,0,0,.08);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 1200px;
  width: calc(100% - 48px);
  margin: 0 auto;
  padding: 24px 0 96px;
}

.balele-single-pin-shell {
  display: grid;
  grid-template-columns: minmax(380px, 0.95fr) minmax(420px, 1.05fr);
  gap: 20px;
  align-items: start;
}

.balele-single-gallery,
.balele-single-info,
.balele-single-comments-section,
.balele-single-related {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.balele-single-gallery {
  overflow: hidden;
  position: sticky;
  top: 76px;
}

.balele-single-gallery-main {
  min-height: 520px;
  background: linear-gradient(135deg, var(--purple-bg), #fff7fb);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.balele-single-gallery-main img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--white);
}

.balele-single-gallery-empty {
  color: var(--gray-400);
  font-weight: 700;
}

.balele-single-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px;
  border-top: 1px solid var(--gray-100);
  background: var(--white);
}

.balele-single-thumb {
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  border: 2px solid var(--gray-100);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  padding: 4px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}

.balele-single-thumb:hover,
.balele-single-thumb.is-active {
  border-color: var(--purple);
  transform: translateY(-1px);
}

.balele-single-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.balele-single-info {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.balele-single-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.balele-single-kicker,
.balele-single-market-kicker {
  display: inline-flex;
  align-self: flex-start;
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.balele-single-title {
  margin: 0;
  color: var(--black);
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 800;
}

.balele-single-description {
  margin: 0;
  color: var(--gray-600);
  font-size: 14px;
  line-height: 1.7;
}

.balele-single-details-card,
.balele-single-market-card,
.balele-single-interaction-card,
.balele-single-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.balele-single-details-card h2,
.balele-single-comments-section h2,
.balele-single-related h2 {
  margin: 0;
  color: var(--black);
  font-size: 16px;
  font-weight: 800;
}

.balele-single-detail-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.balele-single-detail-list div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: start;
}

.balele-single-detail-list dt {
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.balele-single-detail-list dd {
  margin: 0;
  color: var(--dark);
  font-size: 13px;
  font-weight: 700;
}

.balele-single-detail-list a,
.balele-single-detail-list span {
  color: var(--purple);
  text-decoration: none;
}

.balele-single-market-card {
  background: linear-gradient(135deg, #fff, var(--purple-bg));
}

.balele-single-market-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.balele-single-market-price {
  display: block;
  margin-top: 3px;
  color: var(--black);
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
}

.balele-single-stock {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.balele-single-stock[data-tone="active"] { background: var(--green-pale); color: var(--green); }
.balele-single-stock[data-tone="soldout"] { background: var(--red-pale); color: var(--red); }
.balele-single-stock[data-tone="muted"],
.balele-single-stock[data-tone="neutral"] { background: var(--gray-100); color: var(--gray-600); }

.balele-single-market-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.balele-single-market-meta span {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 700;
}

.balele-single-market-note {
  margin: 12px 0 0;
  color: var(--gray-600);
  font-size: 12px;
  line-height: 1.6;
}

.balele-single-market-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.balele-single-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
}

.balele-single-btn-primary {
  background: var(--purple);
  border-color: var(--purple);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(108,92,231,.22);
}

.balele-single-btn-primary:hover { background: var(--purple-dark); }
.balele-single-btn-secondary:hover { border-color: var(--purple); color: var(--purple); }
.balele-single-btn-disabled { opacity: .6; cursor: not-allowed; }

.balele-single-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}
.balele-single-status[data-tone="success"] { background: var(--green-pale); color: var(--green); }
.balele-single-status[data-tone="error"] { background: var(--red-pale); color: var(--red); }

.balele-single-interaction-card {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  background: var(--white);
}

.balele-single-interaction {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--gray-100);
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s;
}

.balele-single-interaction b {
  margin-top: 2px;
  color: var(--black);
  font-size: 13px;
}

.balele-single-interaction:hover,
.balele-single-interaction.is-active {
  color: var(--purple);
  background: var(--purple-bg);
  border-color: var(--purple-light);
}

.balele-single-owner {
  display: flex;
  gap: 14px;
  align-items: center;
  overflow: visible;
}

.balele-single-owner-avatar {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  border-radius: 50%;
  border: 3px solid var(--balele-level-color, #7c3aed);
  background: var(--white);
  overflow: visible;
  position: relative;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--balele-level-color, #7c3aed) 20%, transparent);
}

.balele-single-owner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.balele-single-owner-avatar span,
.balele-single-comment-level-badge {
  position: absolute;
  right: -8px;
  bottom: -7px;
  z-index: 5;
  min-width: 28px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.94);
  background: var(--balele-level-color, #7c3aed);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.balele-single-owner strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--balele-nickname-color, #7c3aed);
  font-size: 15px;
  font-weight: 800;
}

.balele-single-owner small {
  display: block;
  margin-top: 3px;
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 700;
}

.balele-single-comments-section,
.balele-single-related {
  margin-top: 20px;
  padding: 18px;
}

.balele-single-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.balele-single-section-head p {
  margin: 0;
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 600;
}

.balele-single-comment-list {
  display: grid;
  gap: 12px;
}

.balele-single-comment {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  padding: 12px;
}

.balele-single-comment-avatar-wrap {
  position: relative;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 2px solid var(--balele-level-color, #7c3aed);
  border-radius: 999px;
  overflow: visible;
  background: #fff;
}

.balele-single-comment-avatar-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}

.balele-single-comment-body {
  min-width: 0;
}

.balele-single-comment-name-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.balele-single-comment-name-row strong {
  color: var(--balele-nickname-color, #7c3aed);
  font-size: 13px;
  font-weight: 900;
}

.balele-single-comment p {
  margin: 3px 0 0;
  color: var(--gray-600);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
}

.balele-single-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.balele-single-related-card {
  text-decoration: none;
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 10px;
  transition: all .15s;
}

.balele-single-related-card:hover {
  border-color: var(--purple-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.balele-single-related-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  border-radius: var(--radius-xs);
  background: var(--gray-50);
  margin-bottom: 8px;
}

.balele-single-related-card strong {
  display: block;
  color: var(--black);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
}

.balele-single-empty-line {
  color: var(--gray-400);
  font-size: 13px;
  margin: 0;
}

@media (max-width: 820px) {
  .balele-single-pin-page {
    width: 100%;
    padding: 0 0 88px;
  }

  .balele-single-pin-shell {
    display: block;
  }

  .balele-single-gallery {
    position: static;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .balele-single-gallery-main {
    min-height: 330px;
    padding: 16px;
  }

  .balele-single-gallery-main img {
    max-height: 350px;
  }

  .balele-single-info {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 18px 14px;
    box-shadow: none;
  }

  .balele-single-title {
    font-size: 24px;
  }

  .balele-single-description {
    font-size: 13px;
  }

  .balele-single-detail-list div {
    grid-template-columns: 86px 1fr;
    gap: 8px;
  }

  .balele-single-market-top {
    align-items: center;
  }

  .balele-single-market-price {
    font-size: 26px;
  }

  .balele-single-market-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .balele-single-btn {
    width: 100%;
  }

  .balele-single-interaction-card {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 10px;
  }

  .balele-single-interaction {
    min-height: 52px;
    font-size: 10px;
  }

  .balele-single-comments-section,
  .balele-single-related {
    margin-top: 12px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
    padding: 16px 14px;
  }

  .balele-single-section-head {
    display: block;
  }

  .balele-single-section-head p {
    margin-top: 3px;
  }

  .balele-single-related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* Phase 8 Step 9G1: restore Single Pin interaction icons and comment composer */
.balele-single-interaction-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-bottom: 3px;
  border-radius: 999px;
  background: var(--white);
  color: var(--purple);
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.balele-single-interaction-label {
  display: block;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
}

.balele-single-interaction.is-active .balele-single-interaction-icon,
.balele-single-interaction:hover .balele-single-interaction-icon {
  background: var(--purple);
  color: var(--white);
}

.balele-single-comment-form,
.balele-single-comment-login {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
}

.balele-single-comment-form label {
  display: block;
  margin: 0 0 8px;
  color: var(--black);
  font-size: 13px;
  font-weight: 800;
}

.balele-single-comment-form textarea {
  display: block;
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xs);
  background: var(--white);
  color: var(--black);
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  box-shadow: none;
}

.balele-single-comment-form textarea::placeholder {
  color: var(--gray-400);
}

.balele-single-comment-form textarea:focus {
  border-color: var(--purple-light);
  box-shadow: 0 0 0 3px var(--purple-pale);
}

.balele-single-comment-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.balele-single-comment-form-foot span {
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 700;
}

.balele-single-comment-form-foot span[data-tone="error"] { color: var(--red); }
.balele-single-comment-form-foot span[data-tone="success"] { color: var(--green); }

.balele-single-comment-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 16px;
  border: 1px solid var(--purple);
  border-radius: var(--radius-xs);
  background: var(--purple);
  color: var(--white);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s;
}

.balele-single-comment-submit:hover {
  background: var(--purple-dark);
  border-color: var(--purple-dark);
}

.balele-single-comment-submit:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.balele-single-comment-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 700;
}

.balele-single-comment-login a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  background: var(--purple);
  color: var(--white);
  text-decoration: none;
  font-weight: 800;
}

@media (max-width: 820px) {
  .balele-single-interaction-icon {
    width: 22px;
    height: 22px;
    font-size: 14px;
  }
  .balele-single-interaction-label {
    font-size: 10px;
  }
  .balele-single-comment-form,
  .balele-single-comment-login {
    margin-bottom: 12px;
    padding: 12px;
  }
  .balele-single-comment-form-foot {
    align-items: stretch;
    flex-direction: column;
  }
  .balele-single-comment-submit {
    width: 100%;
  }
}

/* Phase 8 Step 10B1: Make Offer dialog for Single Pin page */
.balele-offer-modal[hidden]{display:none!important}.balele-offer-modal{position:fixed;inset:0;z-index:99999;background:rgba(16,12,35,.48);display:flex;align-items:center;justify-content:center;padding:20px}.balele-offer-dialog{position:relative;width:min(440px,100%);background:#fff;border-radius:22px;box-shadow:0 30px 80px rgba(20,15,45,.28);padding:24px;color:#1f1b35}.balele-offer-dialog h3{margin:0 0 6px;font-size:24px}.balele-offer-desc{margin:0 0 18px;color:#746f88;font-size:14px;line-height:1.5}.balele-offer-close{position:absolute;top:12px;right:14px;border:0;background:#f5f3ff;color:#6c5ce7;border-radius:999px;width:34px;height:34px;font-size:24px;line-height:1;cursor:pointer}.balele-offer-dialog label{display:block;margin:12px 0 6px;color:#4b465f;font-weight:800;font-size:13px}.balele-offer-dialog input,.balele-offer-dialog textarea{width:100%;border:1px solid #ded9f5;border-radius:12px;background:#fff;color:#1f1b35;padding:11px 12px;font:inherit;outline:none}.balele-offer-dialog input:focus,.balele-offer-dialog textarea:focus{border-color:#6c5ce7;box-shadow:0 0 0 3px rgba(108,92,231,.12)}.balele-offer-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}.balele-offer-cancel,.balele-offer-submit{border-radius:12px;padding:10px 16px;border:1px solid #ded9f5;font-weight:800;cursor:pointer}.balele-offer-cancel{background:#fff;color:#6b6680}.balele-offer-submit{background:#6c5ce7;color:#fff;border-color:#6c5ce7}.balele-offer-submit:disabled{opacity:.65;cursor:wait}.balele-offer-status{min-height:18px;margin:10px 0 0;font-size:13px;color:#746f88}.balele-offer-status[data-tone="success"]{color:#059669}.balele-offer-status[data-tone="error"]{color:#dc2626}@media(max-width:768px){.balele-offer-modal{align-items:flex-end;padding:0}.balele-offer-dialog{border-radius:22px 22px 0 0;padding:22px 18px 24px;max-height:88vh;overflow:auto}.balele-offer-actions{display:grid;grid-template-columns:1fr 1fr}}


/* =========================================================
   BALELE v3 Phase 8 Step 10B1A
   Make Offer top-layer hardening
   - Offer dialog is appended to <body>, so it must sit above the already
     hardened Pin Modal layer and every Pin Wall canvas/control layer.
   - No Pin Wall coordinates, zoom, animation, or modal layout logic changed.
   ========================================================= */
html body.balele-ui-v56 .balele-offer-modal,
html body .balele-offer-modal[data-balele-top-layer="offer"] {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483646 !important;
  isolation: isolate !important;
  pointer-events: auto !important;
}
html body.balele-ui-v56 .balele-offer-dialog,
html body .balele-offer-modal[data-balele-top-layer="offer"] .balele-offer-dialog {
  position: relative !important;
  z-index: 2 !important;
  pointer-events: auto !important;
}
body.balele-offer-open .balele-home-wall,
body.balele-offer-open .balele-market-wall,
body.balele-offer-open .balele-pin-wall,
body.balele-offer-open .balele-wall-viewport,
body.balele-offer-open .balele-wall-canvas,
body.balele-offer-open .balele-my-wall-viewport,
body.balele-offer-open .balele-my-wall-canvas {
  pointer-events: none !important;
}

/* Phase 8 Step 10D1B: Single Pin Add to Cart success feedback */
.balele-single-btn.is-view-cart,
.balele-single-btn.balele-view-cart-cta {
  background: linear-gradient(135deg, #f97316, #fb923c, #f59e0b) !important;
  color: #ffffff !important;
  border-color: rgba(249,115,22,.7) !important;
  box-shadow: 0 16px 34px rgba(249,115,22,.26) !important;
}
.balele-single-btn.balele-cart-success-pulse {
  animation: baleleCartSuccessPulseStrong 1.05s cubic-bezier(.2,.8,.2,1) both;
}

/* BALELE v3 Phase 8 Step 10D2: sold-out back-in-stock notification. */
.balele-single-btn-notify{background:#ffedd5!important;color:#9a3412!important;border-color:#fed7aa!important}
.balele-single-btn-notify:hover{background:#fed7aa!important;color:#7c2d12!important}
.balele-single-btn-notify:disabled{opacity:.7;cursor:wait}
