/* ------------------------------------------------------------------
   Basket — an enquiry list, not a checkout. Nothing is charged here;
   the list is composed into one WhatsApp message and the sale is
   settled the way it always has been, by talking.

   The whole UI is injected by js/basket.js, so this file is the only
   place its appearance is described.
------------------------------------------------------------------ */

/* --- Trigger in the header ------------------------------------- */
.basket-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  margin-inline-start: 0.4rem;
  border: var(--rule) solid rgba(212, 175, 55, 0.34);
  border-radius: 2px;
  background: transparent;
  color: var(--gold-300);
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.4s var(--ease-soft), color 0.4s var(--ease-soft);
}
.basket-btn:hover { border-color: var(--gold-500); color: var(--gold-200); }
.basket-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.basket-btn__label { display: none; }
@media (min-width: 861px) { .basket-btn__label { display: inline; } }

/* The count only appears once there is something to count. */
.basket-btn__count {
  min-width: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--gold-500);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.15rem;
  text-align: center;
}
.basket-btn[data-count="0"] .basket-btn__count { display: none; }

/* A small nudge when a piece lands in the basket, so the header
   button is noticed on a page the visitor is not looking at. */
@keyframes basket-nudge {
  0%, 100% { transform: scale(1); }
  40%      { transform: scale(1.14); }
}
.basket-btn.is-bumped .basket-btn__count { animation: basket-nudge 0.45s var(--ease-out); }

/* --- Add / remove control -------------------------------------- */
/* .btn was written for anchors; strip the UA chrome off a <button>. */
button.btn { background: none; font-family: inherit; cursor: pointer; }
.btn--basket[aria-pressed="true"] { border-color: var(--gold-500); color: var(--gold-200); }
.btn--basket[aria-pressed="true"] .btn--basket__add { display: none; }
.btn--basket[aria-pressed="false"] .btn--basket__added { display: none; }

/* --- Scrim ------------------------------------------------------ */
.basket-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(16, 12, 10, 0.72);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-soft), visibility 0.4s;
}
.basket-scrim.is-open { opacity: 1; visibility: visible; }

/* --- Drawer ----------------------------------------------------- */
.basket {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: 91;
  display: flex;
  flex-direction: column;
  width: min(25rem, 100vw);
  background: var(--espresso-900);
  border-inline-start: var(--rule) solid rgba(212, 175, 55, 0.2);
  color: var(--cream);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.5s var(--ease-out), visibility 0.5s;
}
.basket.is-open { transform: none; visibility: visible; }

.basket__head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.4rem 1.4rem 1rem;
  border-block-end: var(--rule) solid rgba(212, 175, 55, 0.16);
}
.basket__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.1;
  color: var(--gold-200);
}
.basket__sub {
  margin: 0.3rem 0 0;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--sand);
}
.basket__close {
  margin-inline-start: auto;
  padding: 0.35rem;
  border: 0;
  background: none;
  color: var(--sand);
  cursor: pointer;
  transition: color 0.3s var(--ease-soft);
}
.basket__close:hover { color: var(--gold-300); }
.basket__close svg { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* --- The list --------------------------------------------------- */
.basket__list {
  flex: 1 1 auto;
  overflow-y: auto;
  margin: 0;
  padding: 0.4rem 1.4rem;
  list-style: none;
  -webkit-overflow-scrolling: touch;
}
.basket__row {
  display: grid;
  grid-template-columns: 3.75rem 1fr auto;
  gap: 0.85rem;
  align-items: start;
  padding: 0.95rem 0;
  border-block-end: var(--rule) solid rgba(212, 175, 55, 0.1);
}
.basket__row:last-child { border-block-end: 0; }
.basket__thumb {
  width: 3.75rem;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 1px;
  background: var(--espresso-800);
}
.basket__name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--cream);
  text-decoration: none;
}
.basket__name:hover { color: var(--gold-300); }
.basket__cat {
  margin: 0.22rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.basket__price {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: var(--cream-dim);
}
.basket__price.is-enquiry { color: var(--sand); font-style: italic; }
.basket__freight {
  margin: 0.3rem 0 0;
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--sand);
}
.basket__remove {
  padding: 0.3rem;
  border: 0;
  background: none;
  color: var(--sand);
  cursor: pointer;
  transition: color 0.3s var(--ease-soft);
}
.basket__remove:hover { color: var(--brick-500); }
.basket__remove svg { display: block; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* --- Empty state ------------------------------------------------ */
.basket__empty {
  margin: auto;
  padding: 2rem 1.4rem;
  text-align: center;
  color: var(--sand);
}
.basket__empty p { margin: 0 0 1.1rem; font-size: 0.9rem; line-height: 1.6; }

/* --- Foot ------------------------------------------------------- */
.basket__foot {
  flex: 0 0 auto;
  padding: 1.1rem 1.4rem calc(1.3rem + env(safe-area-inset-bottom));
  border-block-start: var(--rule) solid rgba(212, 175, 55, 0.16);
  background: var(--espresso-950);
}
.basket__total {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: var(--cream-dim);
}
.basket__total b { font-weight: 500; color: var(--gold-200); }
.basket__send {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 2px;
  background: var(--gold-500);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  transition: background 0.3s var(--ease-soft);
}
.basket__send:hover { background: var(--gold-400); }
.basket__send svg { width: 17px; height: 17px; fill: currentColor; flex: 0 0 auto; }
.basket__fine {
  margin: 0.8rem 0 0;
  font-size: 0.7rem;
  line-height: 1.5;
  text-align: center;
  color: var(--sand);
}
.basket__clear {
  display: block;
  margin: 0.7rem auto 0;
  padding: 0.2rem;
  border: 0;
  background: none;
  color: var(--sand);
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.basket__clear:hover { color: var(--cream); }

@media (prefers-reduced-motion: reduce) {
  .basket, .basket-scrim { transition-duration: 0.01ms; }
  .basket-btn.is-bumped .basket-btn__count { animation: none; }
}
