/* Turban By Beyza order page.
   Colours are sampled from the logo: cream #F9F0E1 and chocolate brown #4A2E18. */

:root {
  --cream: #F9F0E1;
  --cream-2: #F1E4CE;
  --cream-3: #E4D2B4;
  --card: #FFFBF3;
  --brown: #4A2E18;
  --brown-2: #6B4A30;
  --caramel: #8F5F2E;
  --emerald: #00573A;            /* the basket bar: one strong colour that means "go" */
  --emerald-2: #00432C;
  --radius: 18px;
  --shadow: 0 8px 28px rgba(74, 46, 24, 0.10);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--brown); text-underline-offset: 3px; }
a:hover { color: var(--caramel); }

:focus-visible {
  outline: 3px solid var(--caramel);
  outline-offset: 2px;
}

/* ---------- header ---------- */
.hero {
  text-align: center;
  padding: 20px 16px 10px;
  max-width: 640px;
  margin: 0 auto;
}
.logo {
  display: block;
  margin: 0 auto -6px;
  width: clamp(120px, 34vw, 220px);
  height: auto;
  /* feather the edges so the logo's cream melts into the page, no visible box */
  -webkit-mask-image: radial-gradient(closest-side, #000 76%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 76%, transparent 100%);
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.9rem, 7vw, 2.8rem);
  line-height: 1.1;
  margin: 0 0 6px;
}
.lead { margin: 0 auto 10px; max-width: 30em; color: var(--brown-2); font-size: 0.97rem; }
.perks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  font-size: 0.82rem;
  color: var(--brown-2);
}
.perks li { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.perks li::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  background: var(--brown) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F9F0E1' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 10px no-repeat;
}

/* ---------- category bar (sticks to the top) and sections ---------- */
.cats {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: rgba(249, 240, 225, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cream-3);
}
.cats::-webkit-scrollbar { display: none; }
.cats:empty { display: none; }
.cats a {
  flex: none;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--cream-3);
  background: var(--card);
  color: var(--brown);
}
.cats a:first-child { margin-left: auto; }   /* centred when it fits, scrolls when it does not */
.cats a:last-child { margin-right: auto; }
.cats a:hover { background: var(--cream-2); color: var(--brown); }
.cats a[aria-current="true"] { background: var(--brown); border-color: var(--brown); color: var(--cream); }
.cats span { opacity: 0.65; font-weight: 400; margin-left: 3px; }
.category, .card { scroll-margin-top: 64px; }   /* clear the sticky bar */
.category-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  max-width: 1100px;
  margin: 22px auto 0;
  padding: 0 16px;
}
.category-count { margin: 0; font-size: 0.85rem; color: var(--brown-2); white-space: nowrap; }
.category-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2rem);
  line-height: 1.1;
  margin: 0;
}

/* ---------- product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--cream-3);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* product photo with no label on it; tapping it loads the Instagram player in its place */
.media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--cream-2);
}
.media.playing {
  aspect-ratio: 17 / 32;         /* fits Instagram's player (video + like bar) without clipping */
}
.media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--cream-2);
}
.play {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: linear-gradient(160deg, var(--cream-2), var(--cream-3));
  color: var(--brown);
  cursor: pointer;
  display: grid;
  place-items: center;
  font: inherit;
}
.play-name { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; padding: 0 16px; text-align: center; }
.cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

.body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.body h3 {
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1.15;
  margin: 0;
}
.blurb { margin: 0; color: var(--brown-2); font-size: 0.95rem; }
.watch { font-size: 0.85rem; }

.price { font-weight: 700; font-size: 1.15rem; }
.price.ask { font-weight: 600; font-size: 1rem; color: var(--brown-2); }

/* form controls */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 0.82rem; font-weight: 600; color: var(--brown-2); }
select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--cream-3);
  border-radius: 12px;
  background: #fff;
  color: var(--brown);
  font: inherit;
}

.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--cream-3);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.qty button {
  width: 46px;
  height: 46px;
  border: 0;
  background: var(--cream-2);
  color: var(--brown);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.qty button:hover { background: var(--cream-3); }
.qty input {
  width: 56px;
  height: 46px;
  border: 0;
  text-align: center;
  font: inherit;
  font-weight: 700;
  color: var(--brown);
  background: transparent;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.total { font-weight: 700; text-align: right; }

/* order buttons */
.actions { display: grid; gap: 10px; margin-top: auto; padding-top: 4px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 14px;
  border: 2px solid var(--brown);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-primary { background: var(--brown); color: var(--cream); }
.btn-primary:hover { background: var(--brown-2); border-color: var(--brown-2); color: var(--cream); }
.btn-ghost { background: transparent; color: var(--brown); }
.btn-ghost:hover { background: var(--cream-2); color: var(--brown); }

.quick-label { margin: 2px 0 -4px; font-size: 0.8rem; color: var(--brown-2); text-align: center; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick .btn { min-height: 44px; padding: 0 10px; gap: 6px; font-size: 0.92rem; border-width: 1.5px; }
.quick .btn svg { width: 18px; height: 18px; }

/* "Added" confirmation on the card button for a moment; tapping it then opens the basket */
.btn.add.added { background: var(--emerald); border-color: var(--emerald); color: #fff; }

/* basket: once something is added, the whole bottom bar is one big royal-green Buy button */
.basket-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 68px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border: 0;
  background: var(--emerald);
  color: #fff;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: 0 -8px 24px rgba(0, 67, 44, 0.3);
  cursor: pointer;
}
.basket-bar:hover { background: var(--emerald-2); }
.basket-bar-icon { position: relative; display: inline-grid; margin-right: 4px; }
.basket-bar svg { width: 28px; height: 28px; }
.basket-badge {
  position: absolute;
  top: -6px;
  right: -9px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: var(--emerald-2);
  font-size: 0.75rem;
  line-height: 20px;
  text-align: center;
}
.basket-bar-cta { text-transform: uppercase; letter-spacing: 0.08em; }
.basket-bar-sum { padding-left: 14px; border-left: 2px solid rgba(255, 255, 255, 0.45); }
.basket-bar-arrow { font-size: 1.4rem; line-height: 1; }
.basket-bar.pop .basket-bar-icon { animation: basket-pop 0.5s ease; }
@keyframes basket-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  65% { transform: scale(0.92); }
  100% { transform: scale(1); }
}
.basket-bar[hidden] { display: none; }
body.has-basket { padding-bottom: 88px; }
body.has-basket .toast { bottom: 88px; }
body.basket-open { overflow: hidden; }

.basket {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(30, 18, 8, 0.45);
}
.basket[hidden] { display: none; }
.basket-sheet {
  width: min(100%, 560px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow);
}
@media (min-width: 640px) {
  .basket { align-items: center; }
  .basket-sheet { border-radius: 20px; }
}
.basket-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; }
.basket-head h2 { margin: 0; font-family: var(--serif); font-size: 1.6rem; }
.basket-close { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--cream-2); color: var(--brown); font-size: 1.6rem; cursor: pointer; }
.basket-lines { list-style: none; margin: 0; padding: 0 16px; overflow-y: auto; }
.line {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  grid-template-areas:
    "img name  remove"
    "img pick  qty"
    "img price price";
  column-gap: 12px;
  row-gap: 4px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--cream-3);
}
.line.no-pick { grid-template-areas: "img name remove" "img price qty"; }
.line-img { grid-area: img; align-self: start; width: 56px; height: 70px; border-radius: 10px; object-fit: cover; background: var(--cream-2); }
.line-name { grid-area: name; margin: 0; font-weight: 700; min-width: 0; }
.line-remove { grid-area: remove; justify-self: end; }
.line-colour-pick { grid-area: pick; }
.line .qty { grid-area: qty; justify-self: end; }
.line-price { grid-area: price; margin: 0; }
.line-price { font-size: 0.85rem; color: var(--brown-2); }
.line-colour-pick {
  margin: 4px 0 2px;
  width: 100%;
  max-width: 100%;
  text-overflow: ellipsis;
  min-height: 36px;
  padding: 4px 8px;
  border: 1.5px solid var(--cream-3);
  border-radius: 10px;
  background: var(--card);
  color: var(--brown);
  font: inherit;
  font-size: 0.85rem;
}
.line-colour-pick.missing { border-color: #C77A1E; background: #FFF4E2; font-weight: 600; }
.qty.small button { width: 36px; height: 36px; font-size: 1.15rem; }
.line-qty { min-width: 30px; text-align: center; font-weight: 700; }
.line-remove, .link-btn { border: 0; background: none; padding: 4px; color: var(--brown-2); font: inherit; font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.basket-lines .empty { padding: 24px 0; text-align: center; color: var(--brown-2); }
.basket-actions { display: grid; gap: 10px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--cream-3); }
.basket-actions[hidden] { display: none; }
#basket-wa { background: var(--emerald); border-color: var(--emerald); color: #fff; }   /* matches the basket bar */
#basket-wa:hover { background: var(--emerald-2); border-color: var(--emerald-2); }
.basket-total-row { display: flex; justify-content: space-between; margin: 0; font-size: 1.05rem; }

.load-error { grid-column: 1 / -1; text-align: center; padding: 32px 16px; color: var(--brown-2); }

/* ---------- footer, toast ---------- */
.footer { text-align: center; padding: 8px 16px 40px; color: var(--brown-2); }
.footer .small { font-size: 0.8rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 24px);
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--brown);
  color: var(--cream);
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
