/**
 * lw-wishlist — list UI (wishlist page, account tab, share page).
 * Uses em units like the rest of the LW stack; no global tokens leaked.
 */

.lw-wl {
  margin: 0 0 2em;
}

/* ---- top bar: count + share controls ---- */

.lw-wl__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  flex-wrap: wrap;
  margin-bottom: 1.25em;
}

.lw-wl__count {
  font-weight: 600;
}

.lw-wl__bar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  flex-wrap: wrap;
}

.lw-wl__share-reset {
  background: none;
  border: none;
  padding: 0;
  color: #6b7280;
  font-size: 0.85em;
  text-decoration: underline;
  cursor: pointer;
}

.lw-wl__share-status {
  font-size: 0.85em;
  color: #15803d;
}

.lw-wl__share-status.is-error {
  color: #b91c1c;
}

/* ---- rows ---- */

.lw-wl__items {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

/* Grid: drag | media | body | remove, with the note spanning a 5th row.
   On desktop the note aligns under the body column; on mobile it spans the
   full card width (see the mobile block). */
.lw-wl-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    "drag media body  remove"
    "drag media note  note";
  align-items: center;
  column-gap: 0.9em;
  row-gap: 0.6em;
  padding: 0.9em;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

/* Rows without a drag handle (shared view) drop the first column. */
.lw-wl-row:not(:has(.lw-wl-row__drag)) {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "media body  remove"
    "media note  note";
}

.lw-wl-row--ghost {
  opacity: 0.4;
}

.lw-wl-row__drag {
  grid-area: drag;
  align-self: center;
  border: none;
  background: none;
  padding: 0.25em;
  color: #9ca3af;
  cursor: grab;
  touch-action: none; /* let SortableJS own touch gestures on the handle */
}

.lw-wl-row__drag:active {
  cursor: grabbing;
}

.lw-wl-row__media {
  grid-area: media;
  align-self: center; /* desktop: image vertically centered in the card */
}

.lw-wl-row__media img {
  display: block;
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.lw-wl-row__body {
  grid-area: body;
  align-self: center;
  min-width: 0;
}

.lw-wl-row__title {
  display: block;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
  margin-bottom: 0.2em;
  overflow-wrap: anywhere;
}

.lw-wl-row__title:hover {
  text-decoration: underline;
}

.lw-wl-row__sku {
  font-size: 0.8em;
  color: #6b7280;
  margin-bottom: 0.3em;
}

.lw-wl-row__price {
  font-size: 0.95em;
  margin-bottom: 0.4em;
}

.lw-wl-row__price del {
  color: #9ca3af;
  margin-right: 0.4em;
}

/* ---- stock badge ---- */

.lw-wl-stock {
  display: inline-block;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1.4;
  padding: 0.1em 0.6em;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.lw-wl-row__stock {
  margin-bottom: 0.5em;
}

.lw-wl-stock--instock {
  color: #15803d;
  background: #f0fdf4;
}

.lw-wl-stock--outofstock {
  color: #b91c1c;
  background: #fef2f2;
}

.lw-wl-stock--onbackorder {
  color: #b45309;
  background: #fffbeb;
}

.lw-wl-row__note-wrap {
  grid-area: note;
  min-width: 0;
}

.lw-wl-row__note-label {
  display: none; /* visually hidden — the placeholder carries the affordance */
}

.lw-wl-row__note {
  width: 100%;
  max-width: 32em;
  min-height: 2.6em; /* a touch shorter than before */
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.4em 0.6em;
  font-size: 0.85em;
  font-family: inherit;
  resize: none;
  overflow: hidden;
  background: #f9fafb;
}

.lw-wl-row__note:focus {
  background: #fff;
  outline: 2px solid #cbd5e1;
  outline-offset: 0;
}

.lw-wl-row__note-status {
  display: block;
  font-size: 0.8em;
  color: #15803d;
  min-height: 1.2em;
}

.lw-wl-row__note-status.is-error {
  color: #b91c1c;
}

.lw-wl-row__note-static {
  font-size: 0.9em;
  color: #4b5563;
  font-style: italic;
}

/* ---- row actions (Add to cart, bottom-right of the content column) ---- */

.lw-wl-row__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5em;
}

.lw-wl-row__atc.button {
  white-space: nowrap;
}

/* ---- remove (X, top-right corner of the card) ---- */

.lw-wl-row__remove {
  grid-area: remove;
  align-self: start;
  justify-self: end;
  border: none;
  background: none;
  padding: 0.3em;
  color: #9ca3af;
  cursor: pointer;
}

.lw-wl-row__remove:hover {
  color: #b91c1c;
}

/* ---- empty / hints ---- */

.lw-wl__empty {
  padding: 2em 0;
  text-align: center;
  color: #4b5563;
}

.lw-wl__guest-hint {
  margin-top: 1.25em;
  font-size: 0.9em;
  color: #6b7280;
}

/* ---- share page wrapper ---- */

.lw-wl-share-page__inner {
  max-width: 56em;
  margin: 0 auto;
  padding: 2em 1em 3em;
}

.lw-wl-share-page__title {
  margin-bottom: 1em;
}

/* ---- mobile: drag | image | content, with note + X riding the content column,
       and the note spanning the full card width along the bottom ---- */

@media (max-width: 600px) {
  .lw-wl-row {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "drag media body"
      "note note  note";
    align-items: start;
  }

  .lw-wl-row:not(:has(.lw-wl-row__drag)) {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "media body"
      "note  note";
  }

  /* No dedicated remove column on mobile — float it into the body's top-right
     so the content stays a clean three-column row. */
  .lw-wl-row__remove {
    grid-area: body;
    align-self: start;
    justify-self: end;
    margin: -0.2em -0.2em 0 0;
  }

  .lw-wl-row__media {
    align-self: start;
  }

  .lw-wl-row__media img {
    width: 72px;
    height: 72px;
  }

  /* Keep the title clear of the floated X. */
  .lw-wl-row__title {
    padding-right: 1.75em;
  }

  .lw-wl-row__note {
    max-width: none; /* full card width on mobile */
  }
}
