/* =========================================================
   related_sheet.css  —  "Added to cart" sheet with related products
   Works on any page (own tokens, no dependency on lb-base.css).
   Pair with /js/related_sheet.js
   ========================================================= */
.lb-related {
  --rs-leaf-900: #0b3d2c;
  --rs-leaf-700: #0f5c3f;
  --rs-leaf-600: #138556;
  --rs-leaf-100: #e3f3ea;
  --rs-mango: #ffb81c;
  --rs-ink: #17211c;
  --rs-ink-2: #4a5a52;
  --rs-ink-3: #7c8b83;
  --rs-line: #e3e9e5;
  font-family: var(--font-body, "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);

  position: fixed; inset: 0;
  z-index: 100010;                       /* above header, modals and the cart */
  display: none; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(8, 24, 18, .55);
  backdrop-filter: blur(3px);
}
.lb-related *, .lb-related *::before, .lb-related *::after { box-sizing: border-box; }
.lb-related.is-open { display: flex; animation: lbRelFade .2s ease; }
html.lb-sheet-open { overflow: hidden; }

.lb-related__sheet {
  width: min(100%, 520px);
  max-height: min(86vh, 680px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; color: var(--rs-ink);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(8, 24, 18, .3);
  animation: lbRelPop .3s cubic-bezier(.2, .9, .3, 1.15);
}

/* ---- header ---- */
.lb-related__head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 12px 20px;
}
.lb-related__tick {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--rs-leaf-700); color: #fff;
}
.lb-related__tick svg { width: 20px; height: 20px; }
.lb-related__titles { flex: 1; min-width: 0; }
.lb-related__title {
  margin: 0; font-family: var(--font-head, "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif);
  font-size: 19px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em;
}
.lb-related__sub {
  margin: 2px 0 0; font-size: 13px; color: var(--rs-ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-related__x {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: #f1f5f3; color: var(--rs-ink-2); border: 0; font-size: 15px;
}
.lb-related__x:hover { background: var(--rs-leaf-100); }

.lb-related__label {
  padding: 4px 20px 8px; font-size: 14px; font-weight: 700; color: var(--rs-ink-2);
  border-top: 1px solid var(--rs-line); padding-top: 14px;
}

/* ---- list ---- */
.lb-related__list {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 20px 14px; display: flex; flex-direction: column; gap: 10px;
}
.lb-related__row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border: 1.5px solid var(--rs-line); border-radius: 16px;
  transition: border-color .15s;
}
.lb-related__row:hover { border-color: var(--rs-leaf-600); }
.lb-related__img {
  flex: none; width: 64px; height: 64px; border-radius: 12px; overflow: hidden;
  background: var(--rs-leaf-100);
}
.lb-related__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-related__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lb-related__name {
  font-size: 14px; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lb-related__price { display: flex; align-items: baseline; gap: 8px; }
.lb-related__price b { font-size: 15px; font-weight: 800; }
.lb-related__price s { font-size: 12px; color: var(--rs-ink-3); }

.lb-related__add {
  flex: none; min-width: 78px; height: 36px; padding: 0 16px; cursor: pointer;
  border: 1.5px solid var(--rs-leaf-700); border-radius: 999px;
  background: #fff; color: var(--rs-leaf-700);
  font: inherit; font-size: 14px; font-weight: 700;
  transition: background .15s, color .15s, transform .15s;
}
.lb-related__add:hover { background: var(--rs-leaf-100); }
.lb-related__add:active { transform: scale(.96); }
.lb-related__add:disabled { opacity: .6; cursor: wait; }
.lb-related__add.is-done { background: var(--rs-leaf-700); color: #fff; }

.lb-related__price small { font-size: 11px; color: var(--rs-ink-3); font-weight: 600; }
.lb-related__back {
  align-self: flex-start; padding: 6px 4px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--rs-leaf-700);
}
.lb-related__vname { font-size: 16px; font-weight: 800; padding: 0 2px 4px; }
.lb-related__vload { padding: 18px 4px; font-size: 14px; color: var(--rs-ink-2); text-align: center; }

/* ---- footer ---- */
.lb-related__foot {
  display: flex; gap: 10px; padding: 12px 20px 18px;
  border-top: 1px solid var(--rs-line); background: #fff;
}
.lb-related__btn {
  flex: 1; height: 46px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 700; border: 0;
  background: var(--rs-mango); color: var(--rs-leaf-900);
  transition: filter .15s, transform .15s;
}
.lb-related__btn:hover { filter: brightness(1.05); }
.lb-related__btn:active { transform: scale(.98); }
.lb-related__btn--ghost { background: #f1f5f3; color: var(--rs-ink); }

.lb-related :focus-visible { outline: 3px solid var(--rs-leaf-600); outline-offset: 2px; }

@keyframes lbRelFade { from { opacity: 0; } }
@keyframes lbRelPop { from { transform: translateY(24px) scale(.97); opacity: 0; } }
@keyframes lbRelUp { from { transform: translateY(100%); } }

/* ---- mobile: bottom sheet ---- */
@media (max-width: 560px) {
  .lb-related { align-items: flex-end; padding: 0; }
  .lb-related__sheet {
    width: 100%; max-height: 88vh;
    border-radius: 24px 24px 0 0;
    animation: lbRelUp .3s ease;
  }
  .lb-related__head { padding: 16px 14px 10px 16px; }
  .lb-related__label, .lb-related__list, .lb-related__foot { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .lb-related.is-open, .lb-related__sheet { animation: none; }
}
