/* ============================================================================
   ALWYN — Shopping bag drawer (order request)
   ----------------------------------------------------------------------------
   Slides in from the right when:
     · the user clicks the header bag icon, OR
     · the user clicks "Add to Order" on a coat or bag detail page
   ALWYN does not take payment online — the drawer's primary CTA is
   "Submit Order Request". Confirmation + payment happen via email.
   ========================================================================= */

.cart-backdrop{
  position: fixed; inset: 0;
  background: rgba(28, 26, 20, 0.45);
  z-index: 199;
  opacity: 0; pointer-events: none;
  transition: opacity 280ms ease;
}
.cart-backdrop.is-open{
  opacity: 1; pointer-events: auto;
}

.cart-drawer{
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(480px, 100vw);
  background: #fff;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex; flex-direction: column;
  font-family: 'IBM Plex Serif', Georgia, serif;
  color: #1C1A14;
}
.cart-drawer.is-open{ transform: translateX(0); }

/* ─── Top bar — title + close ─── */
.cart-drawer__top{
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 28px 22px;
  border-bottom: 1px solid #f1ede5;
}
.cart-drawer__title{
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.cart-drawer__count{ color: #6b6055; font-weight: 400; }
.cart-drawer__close{
  background: transparent; border: 0; padding: 6px;
  cursor: pointer;
  color: #1C1A14;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.cart-drawer__close svg{ width: 18px; height: 18px; }

/* ─── Scrollable item list ─── */
.cart-drawer__body{
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}
.cart-drawer__empty{
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: #6b6055;
  text-align: center;
  padding: 32px 0;
}

.cart-item{
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid #f5f1e9;
}
.cart-item:first-child{ padding-top: 4px; }
.cart-item:last-child{ border-bottom: 0; }

.cart-item__img{
  width: 96px; height: 120px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cart-item__img img{
  max-width: 100%; max-height: 100%;
  object-fit: contain; display: block;
}

.cart-item__meta{ display: flex; flex-direction: column; }
.cart-item__name{
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: #1C1A14;
  margin-bottom: 8px;
}
.cart-item__opt{
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b6055;
  line-height: 1.55;
}
.cart-item__opt strong{ color: #1C1A14; font-weight: 500; margin-left: 4px; }
.cart-item__price{
  margin-top: 8px;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #1C1A14;
}
.cart-item__remove{
  margin-top: 10px;
  background: transparent; border: 0; padding: 0;
  cursor: pointer;
  align-self: flex-start;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6b6055;
  border-bottom: 1px solid #b5ad9f;
  padding-bottom: 2px;
  transition: color 180ms ease, border-color 180ms ease;
}
.cart-item__remove:hover{ color: #1C1A14; border-bottom-color: #1C1A14; }

/* ─── Footer — subtotal + CTAs ─── */
.cart-drawer__foot{
  padding: 22px 28px 28px;
  border-top: 1px solid #f1ede5;
}
.cart-drawer__subtotal{
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px;
}
.cart-drawer__subtotal-lbl{
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.cart-drawer__subtotal-amt{
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.04em;
}
.cart-drawer__btn{
  display: block;
  width: 100%;
  padding: 18px 20px;
  margin-top: 10px;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition: background-color 180ms ease, color 180ms ease;
}
.cart-drawer__btn--primary{
  background: #1C1A14; color: #fff;
}
.cart-drawer__btn--primary:hover{ background: #000; }
.cart-drawer__btn--primary:disabled{ background: #b5ad9f; cursor: not-allowed; }
.cart-drawer__btn--secondary{
  background: #fff; color: #1C1A14;
  border: 1px solid #1C1A14;
}
.cart-drawer__btn--secondary:hover{ background: #1C1A14; color: #fff; }
.cart-drawer__btn--disabled{
  pointer-events: none;
  border-color: #b5ad9f; color: #b5ad9f;
}
.cart-drawer__note{
  margin-top: 14px;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b6055;
  text-align: center;
  line-height: 1.55;
}

/* ─── Mobile ─── */
@media (max-width: 600px){
  .cart-drawer{ width: 100vw; }
  .cart-drawer__top{ padding: 20px 20px 16px; }
  .cart-drawer__body{ padding: 18px 20px; }
  .cart-drawer__foot{ padding: 18px 20px 24px; }
  .cart-item{ grid-template-columns: 80px 1fr; gap: 14px; }
  .cart-item__img{ width: 80px; height: 100px; }
}

/* ─── Brief flash on the bag icon after adding an item ─── */
@keyframes cart-pulse {
  0%, 100% { transform: scale(1); }
  40%      { transform: scale(1.15); }
}
.header__bag.is-pulsing{
  animation: cart-pulse 360ms ease;
}
