/* D'STUDIO shop cart (js/shop-cart.js) — matches shop.html's palette */

.cart-fab {
  position: fixed; right: 2rem; bottom: 2rem; z-index: 9990;
  display: none; align-items: center; gap: .55rem;
  padding: .8rem 1.2rem; border: 0; border-radius: 999px;
  background: var(--ink, #34322F); color: #fff; font: 500 .9rem Inter, system-ui, sans-serif;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .18); cursor: pointer;
  transition: transform .3s var(--ease, ease), background .3s;
}
.cart-fab.has-items { display: inline-flex; animation: cartPop .4s var(--ease, ease); }
.cart-fab:hover { background: var(--accent, #BDA171); transform: translateY(-2px); }
.cart-fab-count {
  min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px;
  background: var(--accent, #BDA171); color: #fff; font-size: .75rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-fab:hover .cart-fab-count { background: var(--ink, #34322F); }
@keyframes cartPop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.cart-overlay {
  position: fixed; inset: 0; z-index: 9995; background: rgba(52, 50, 47, .35);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 9996; width: min(420px, 100vw);
  background: var(--bg, #F5F2EC); color: var(--ink, #34322F); font-family: Inter, system-ui, sans-serif;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .4s var(--ease, ease), box-shadow .4s;
}
body.cart-open { overflow: hidden; }
body.cart-open .cart-overlay { opacity: 1; pointer-events: auto; }
body.cart-open .cart-drawer { transform: none; box-shadow: -18px 0 50px rgba(0, 0, 0, .15); }
.cart-drawer.is-busy .cart-lines { opacity: .55; pointer-events: none; }

.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 1.5rem; border-bottom: 1px solid var(--line, rgba(0, 0, 0, .08));
}
.cart-head h2 { margin: 0; font: 500 1.5rem "Playfair Display", Georgia, serif; }
.cart-head h2 span { color: var(--muted, #7B7670); font-size: 1rem; }
.cart-close {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line, rgba(0, 0, 0, .08));
  background: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; color: inherit;
}
.cart-close:hover { background: var(--ink, #34322F); color: #fff; }

.cart-lines { flex: 1; overflow-y: auto; padding: .5rem 1.5rem; transition: opacity .2s; }
.cart-empty { color: var(--muted, #7B7670); text-align: center; margin: 3rem 0; }
.cart-line { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line, rgba(0, 0, 0, .08)); }
.cart-line img, .cart-noimg { width: 76px; height: 96px; object-fit: cover; background: #fff; flex-shrink: 0; }
.cart-line-info { flex: 1; min-width: 0; }
.cart-line-title { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.cart-line-variant { font-size: .8rem; line-height: 1.4; color: var(--muted, #7B7670); margin-top: 3px; }
.cart-line-price { margin: .25rem 0 .6rem; font-size: .9rem; }
.cart-qty { display: flex; align-items: center; gap: .5rem; }
.cart-qty button {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line, rgba(0, 0, 0, .12));
  background: #fff; cursor: pointer; font-size: 1rem; line-height: 1; color: inherit;
}
.cart-qty button:hover { border-color: var(--ink, #34322F); }
.cart-qty span { min-width: 1.4rem; text-align: center; font-weight: 600; font-size: .9rem; }
.cart-qty .cart-remove {
  width: auto; height: auto; border: 0; background: none; margin-left: auto;
  color: var(--muted, #7B7670); font-size: .8rem; text-decoration: underline; padding: 0;
}

.cart-foot { padding: 1.25rem 1.5rem 1.5rem; border-top: 1px solid var(--line, rgba(0, 0, 0, .08)); background: #fff; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1rem; }
.cart-total strong { font-size: 1.25rem; }
.cart-note { color: var(--muted, #7B7670); font-size: .8rem; margin: .35rem 0 .5rem; }
.cart-terms { color: var(--muted, #7B7670); font-size: .74rem; margin: 0 0 1rem; line-height: 1.5; }
.cart-terms a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent, #BDA171); text-underline-offset: 2px; }
.cart-checkout, .cart-continue {
  display: block; width: 100%; padding: .9rem; border: 0; cursor: pointer;
  font: 500 .9rem Inter, system-ui, sans-serif;
}
.cart-checkout { background: var(--ink, #34322F); color: #fff; transition: background .3s; }
.cart-checkout:hover { background: var(--accent, #BDA171); }
.cart-continue { background: none; color: var(--muted, #7B7670); margin-top: .4rem; text-decoration: underline; }

.cart-toast {
  position: fixed; left: 50%; bottom: 6rem; z-index: 9999; transform: translate(-50%, 20px);
  background: var(--ink, #34322F); color: #fff; padding: .7rem 1.1rem; border-radius: 999px;
  font: 500 .85rem Inter, system-ui, sans-serif; opacity: 0; pointer-events: none; transition: all .3s;
  max-width: calc(100vw - 2rem); text-align: center;
}
.cart-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 575.98px) {
  /* language switcher sits bottom-centre on phones: keep the cart button compact at the right */
  .cart-fab { right: 1rem; bottom: 2rem; padding: .75rem; }
  .cart-fab-label { display: none; }
}

/* the page's fixed BG/EN switch would cover the drawer's close button */
body.cart-open .language-switcher { display: none; }
