/* ============================================================
   ONCE & EVER — SAVED DESIGNS DRAWER
   A shortlist of invitations, not a cart. Built by js/shop.js on
   every page, so the styles live on their own.
   ============================================================ */

.saved-drawer {
  position: fixed;
  inset: 0;
  z-index: 950;
  visibility: hidden;
  pointer-events: none;
}

.saved-drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}

.saved-backdrop {
  position: absolute;
  inset: 0;
  /* enough to settle the page back, not enough to hide it */
  background: rgba(37, 35, 35, .42);
  opacity: 0;
  transition: opacity .4s var(--ease);
}

.saved-drawer.is-open .saved-backdrop {
  opacity: 1;
}

.saved-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--ivory);
  border-left: 1px solid var(--gold-border);
  box-shadow: -30px 0 70px -40px rgba(0, 0, 0, .5);
  transform: translateX(100%);
  transition: transform .42s var(--ease);
}

.saved-drawer.is-open .saved-panel {
  transform: translateX(0);
}

.saved-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--charcoal);
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}

.saved-close svg {
  width: 15px;
  height: 15px;
}

.saved-close:hover {
  background: var(--burgundy);
  border-color: var(--gold);
  color: var(--gold-light);
}

.saved-head {
  padding: clamp(2.2rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.2rem) 1.4rem;
  border-bottom: 1px solid var(--gold-border);
}

.saved-head .eyebrow {
  margin-bottom: .7rem;
}

.saved-title {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: clamp(1.6rem, 4vw, 2rem);
  line-height: 1.15;
  color: var(--charcoal);
}

.saved-count {
  margin-top: .6rem;
  font-family: var(--ff-sub);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- SAVED ITEMS ---------- */
.saved-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 clamp(1.5rem, 4vw, 2.2rem);
}

.saved-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 1.1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.saved-item:last-child {
  border-bottom: none;
}

.saved-thumb {
  display: block;
  border: 1px solid var(--gold-border);
  overflow: hidden;
  background: var(--warm-white);
}

.saved-thumb img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

.saved-item-name {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--charcoal);
}

.saved-item-cat {
  margin-top: .3rem;
  font-family: var(--ff-sub);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}

.saved-item-actions {
  /* the padding on the actions themselves supplies the gap */
  margin-top: .35rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 1.2rem;
}

/* Both actions carry .7rem of vertical padding so the tap area clears
   40px — at their type size the text alone is only 18px tall. */
.saved-item-actions .link-arrow,
.saved-remove {
  padding: .7rem 0;
}

.saved-item-actions .link-arrow {
  font-size: .68rem;
}

.saved-remove {
  position: relative;
  font-family: var(--ff-sub);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .3s var(--ease);
}

/* the rule sits under the word, not under the tap area */
.saved-remove::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(.7rem - 3px);
  height: 1px;
  background: currentColor;
  opacity: 0;
  transition: opacity .3s var(--ease);
}

.saved-remove:hover {
  color: var(--burgundy);
}

.saved-remove:hover::after {
  opacity: .45;
}

/* ---------- EMPTY STATE ---------- */
.saved-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1.8rem;
  padding: clamp(1.5rem, 4vw, 2.2rem);
}

.saved-empty p {
  font-size: .95rem;
  line-height: 1.8;
  color: var(--muted);
  max-width: 34ch;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 520px) {
  .saved-panel {
    width: 100%;
    border-left: 0;
  }

  .saved-item {
    grid-template-columns: 64px 1fr;
    gap: .9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* the drawer still opens, it just does not travel */
  .saved-panel {
    transform: none;
    opacity: 0;
  }

  .saved-drawer.is-open .saved-panel {
    opacity: 1;
  }
}
