/* TPS Ordering - Public Landing Page */

:root {
  --tps-black:  #15110e;
  --tps-orange: #ff4400;
  --tps-ember7: #b83a0e;
  --tps-cream:  #f7f0e4;
  --tps-cream2: #ede5d6;
  --tps-ink:    #231c17;
  --tps-muted:  #9c8e82;
  --tps-yellow: #f2a93b;
  --tps-leaf:   #3aa528;
  --tps-radius: 12px;
  --tps-drawer-w: 420px;
}

*, *::before, *::after { box-sizing: border-box; }

body.tps-order-page { margin: 0; background: var(--tps-cream); }
body.tps-order-page .tps-page-header { position: sticky; top: 0; z-index: 50; }

.tps-order-wrap {
  font-family: 'Montserrat', system-ui, sans-serif;
  color: var(--tps-ink);
  min-height: 60vh;
}

/* ---- Page header ---- */
.tps-page-header {
  background: var(--tps-black);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.tps-brand-name {
  font-family: 'Young Serif', Georgia, serif;
  font-size: 20px;
  color: var(--tps-cream);
  letter-spacing: .01em;
}
.tps-brand-tagline {
  font-size: 12px;
  color: var(--tps-muted);
  margin: 2px 0 0;
  font-style: italic;
}
.tps-brand-branch {
  display: inline-block;
  background: var(--tps-orange);
  color: var(--tps-black);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 10px;
}

/* ---- Menu ---- */
.tps-menu { max-width: 1200px; margin: 0 auto; padding: 0 24px 100px; }

.tps-category { margin-top: 44px; }

.tps-cat-heading {
  font-family: 'Young Serif', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--tps-black);
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--tps-black);
}

.tps-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  align-items: start; /* each card keeps its own height; a card that grows does not stretch its row */
}

/* ---- Item card ---- */
.tps-item-card {
  background: #fff;
  border-radius: var(--tps-radius);
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.tps-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1), 0 12px 32px rgba(0,0,0,.08);
}
.tps-out-of-stock { opacity: .6; }
.tps-out-of-stock:hover { transform: none; }

.tps-item-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--tps-cream2);
  overflow: hidden;
}
.tps-item-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.tps-item-card:hover .tps-item-photo img { transform: scale(1.04); }
.tps-item-photo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--tps-cream2) 0%, var(--tps-cream) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tps-item-photo-placeholder::after {
  content: '';
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--tps-cream-mid, var(--tps-cream2));
  opacity: .6;
}
.tps-sold-out-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(21,17,14,.75);
  color: var(--tps-cream);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.tps-item-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tps-item-heat { min-height: 14px; }
.tps-heat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tps-orange);
  margin-right: 3px;
}
.tps-heat-label {
  font-size: 11px;
  color: var(--tps-muted);
  text-transform: capitalize;
  margin-left: 2px;
}

.tps-item-name {
  font-family: 'Young Serif', Georgia, serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--tps-black);
  margin: 0;
  line-height: 1.25;
}
.tps-item-desc {
  font-size: 13px;
  color: var(--tps-muted);
  margin: 0;
  line-height: 1.5;
}

/* ---- Size options ---- */


/* Qty controls */
.tps-qty-ctrl { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tps-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--tps-black);
  background: transparent;
  color: var(--tps-black);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  font-family: inherit;
  padding: 0;
}
.tps-qty-btn:hover { background: var(--tps-black); color: var(--tps-cream); }
.tps-qty-val {
  min-width: 20px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--tps-ink);
}

/* ---- Cart button ---- */
.tps-cart-btn {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--tps-black);
  color: var(--tps-cream);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  z-index: 100;
  transition: transform .15s, box-shadow .15s;
}
.tps-cart-btn:hover { transform: scale(1.06); box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.tps-cart-btn svg { width: 26px; height: 26px; }
.tps-cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--tps-yellow);
  color: var(--tps-black);
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.tps-cart-count[hidden] { display: none; }

/* ---- Cart drawer ---- */
.tps-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.tps-drawer-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.tps-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--tps-drawer-w);
  max-width: 100vw;
  background: var(--tps-black);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .32s cubic-bezier(.32,0,.67,0), visibility 0s linear .32s;
  overflow: hidden;
}
.tps-drawer.open {
  transform: translateX(0);
  visibility: visible;
  box-shadow: -4px 0 32px rgba(0,0,0,.35);
  transition: transform .32s cubic-bezier(.33,1,.68,1), visibility 0s;
}
@media (prefers-reduced-motion: reduce) { .tps-drawer, .tps-drawer.open { transition: none; } }

.tps-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(247,240,228,.12);
  flex-shrink: 0;
}
.tps-drawer-title {
  font-family: 'Young Serif', Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--tps-cream);
  margin: 0;
}
.tps-drawer-close {
  background: none;
  border: none;
  color: var(--tps-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
  font-family: inherit;
}
.tps-drawer-close:hover { color: var(--tps-cream); background: rgba(255,255,255,.08); }

/* Cart items scroll area */
/* One scroll for items, subtotal and form; only the drawer header stays fixed. */
.tps-drawer-scroll {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
}
.tps-drawer-body { flex: 0 0 auto; padding: 16px 20px; }

.tps-cart-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--tps-muted);
  font-size: 15px;
  line-height: 1.6;
}

.tps-cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(247,240,228,.1);
}
.tps-cart-item:last-child { border-bottom: none; }
.tps-cart-item-info { flex: 1; min-width: 0; }
.tps-cart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--tps-cream);
  margin: 0 0 2px;
}
.tps-cart-item-size { font-size: 12px; color: var(--tps-muted); }
.tps-cart-item-price { font-size: 14px; font-weight: 700; color: var(--tps-yellow); white-space: nowrap; }
.tps-cart-item-qty { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tps-cart-qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(247,240,228,.25);
  background: transparent;
  color: var(--tps-cream);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background .15s;
  padding: 0;
}
.tps-cart-qty-btn:hover { background: rgba(255,255,255,.1); }
.tps-cart-qty-num { font-size: 14px; color: var(--tps-cream); min-width: 18px; text-align: center; }

/* Subtotal row */
.tps-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid rgba(247,240,228,.12);
  flex-shrink: 0;
}
.tps-subtotal-label { font-size: 13px; font-weight: 600; color: var(--tps-muted); text-transform: uppercase; letter-spacing: .05em; }
.tps-subtotal-amount { font-size: 20px; font-weight: 700; color: var(--tps-cream); }

/* Checkout form */
.tps-checkout-form {
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(247,240,228,.12);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tps-checkout-form.hidden { display: none; }

.tps-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tps-field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tps-muted);
}
.tps-field input, .tps-field textarea {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  padding: 10px 12px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(247,240,228,.18);
  border-radius: 8px;
  color: var(--tps-cream);
  outline: none;
  transition: border-color .15s, background .15s;
}
.tps-field input::placeholder, .tps-field textarea::placeholder { color: rgba(247,240,228,.35); }
.tps-field input:focus, .tps-field textarea:focus {
  border-color: var(--tps-orange);
  background: rgba(255,255,255,.1);
}
.tps-field input.err, .tps-field textarea.err { border-color: #e74c3c; }
.tps-field textarea { resize: none; }

.tps-pay-btn {
  width: 100%;
  padding: 14px 20px;
  background: var(--tps-orange);
  color: var(--tps-black);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s;
  letter-spacing: .01em;
}
.tps-pay-btn:hover { background: #e03c00; }
.tps-pay-btn:disabled { opacity: .6; cursor: wait; }

/* Error message */
.tps-checkout-error {
  font-size: 13px;
  color: #f1948a;
  text-align: center;
  display: none;
}
.tps-checkout-error.visible { display: block; }

/* Success state */
.tps-success-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  display: none;
}
.tps-success-state.visible { display: flex; }
.tps-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(58,165,40,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.tps-success-icon svg { width: 28px; height: 28px; }
.tps-success-title {
  font-family: 'Young Serif', Georgia, serif;
  font-size: 22px;
  color: var(--tps-cream);
  margin: 0 0 8px;
}
.tps-success-body { font-size: 14px; color: var(--tps-muted); line-height: 1.6; margin: 0; }
.tps-success-wa {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background: var(--tps-orange);
  color: var(--tps-black);
  font-weight: 700;
  font-size: 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s;
}
.tps-success-wa:hover { background: #e03c00; }

/* Loading overlay inside drawer */
.tps-drawer-loading {
  position: absolute;
  inset: 0;
  background: rgba(21,17,14,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  display: none;
}
.tps-drawer-loading.visible { display: flex; }
.tps-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(247,240,228,.2);
  border-top-color: var(--tps-orange);
  border-radius: 50%;
  animation: tps-spin .7s linear infinite;
}
@keyframes tps-spin { to { transform: rotate(360deg); } }

/* Error state */
.tps-error {
  text-align: center;
  padding: 48px 24px;
  color: var(--tps-muted);
  font-size: 15px;
}

/* Responsive */
@media (max-width: 600px) {
  --tps-drawer-w: 100vw;
  .tps-menu { padding: 0 16px 100px; }
  .tps-page-header { padding: 16px; }
  .tps-brand-name { font-size: 17px; }
  .tps-items-grid { grid-template-columns: 1fr; }
  .tps-cart-btn { right: 16px; bottom: 20px; }
}

/* Touch targets: the circles stay small, the tappable area is at least 44px. */
.tps-qty-btn, .tps-cart-qty-btn { position: relative; }
.tps-qty-btn::after, .tps-cart-qty-btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 44px; height: 44px;
  transform: translate(-50%, -50%);
}
.tps-qty-val { min-width: 24px; text-align: center; }

/* Size picker: one button opens the sizes, then - / + sets the quantity for the chosen size. */
.tps-item-photo { border-radius: var(--tps-radius) var(--tps-radius) 0 0; overflow: hidden; }
.tps-item-card:has(.tps-size-menu:not([hidden])) { z-index: 20; }
.tps-from { margin: 2px 0 12px; font-weight: 700; font-size: 15px; color: var(--tps-ink); }
.tps-picker { position: relative; }
.tps-size-btn {
  width: 100%; min-height: 44px; padding: 10px 40px 10px 14px;
  border: 1.5px solid var(--tps-black); border-radius: 10px;
  background: var(--tps-cream); color: var(--tps-black);
  font: 600 14px/1.2 'Montserrat', system-ui, sans-serif; text-align: left; cursor: pointer;
  position: relative;
}
.tps-size-btn::after {
  content: ''; position: absolute; right: 16px; top: 50%;
  width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .2s;
}
.tps-size-btn[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: -2px; }
.tps-size-btn:focus-visible, .tps-size-opt:focus-visible, .tps-qty-btn:focus-visible { outline: 3px solid var(--tps-orange); outline-offset: 2px; }
.tps-size-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: #fff; border-radius: 10px; padding: 6px;
  box-shadow: 0 10px 30px rgba(21,17,14,.22), 0 0 0 1px rgba(21,17,14,.08);
  display: flex; flex-direction: column; gap: 2px;
}
.tps-size-menu[hidden] { display: none; }
.tps-size-opt {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 44px; padding: 10px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--tps-ink); cursor: pointer;
  font: 600 14px/1.2 'Montserrat', system-ui, sans-serif; text-align: left;
}
.tps-size-opt:hover { background: var(--tps-cream); }
.tps-size-opt[aria-checked="true"] { background: var(--tps-cream2); box-shadow: inset 3px 0 0 var(--tps-orange); }
.tps-size-opt-price { font-weight: 700; color: var(--tps-black); white-space: nowrap; }
.tps-item-body .tps-qty-ctrl { margin-top: 12px; justify-content: center; gap: 20px; }
.tps-item-body .tps-qty-ctrl[hidden] { display: none; }
.tps-item-body .tps-qty-btn { width: 40px; height: 40px; font-size: 20px; }
.tps-item-body .tps-qty-val { font-size: 18px; font-weight: 700; min-width: 32px; }
.tps-in-cart { margin: 10px 0 0; font-size: 12px; font-weight: 600; color: var(--tps-ember7); text-align: center; }

/* Heat level: one choice per order, mirrors the live site's "How spicy" slider (ten named levels). */
.tps-heat-pick { padding: 4px 0 18px; margin-bottom: 4px; border-bottom: 1px solid rgba(247,240,228,.12); text-align: center; }
.tps-heat-q { display: block; font-family: 'Young Serif', Georgia, serif; font-size: 18px; color: var(--tps-cream); margin-bottom: 12px; }
.tps-chillies { display: flex; justify-content: space-between; align-items: flex-end; height: 30px; padding: 0 4px; margin-bottom: 8px; }
.tps-chilli { width: 16px; height: 16px; color: rgba(247,240,228,.22); transition: transform .15s, color .15s; }
.tps-chilli svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.tps-chilli.on { color: var(--tps-orange); }
.tps-chilli.current { transform: scale(1.75); transform-origin: bottom center; }
#tps-cf-heat {
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0;
  background: transparent; cursor: pointer;
}
#tps-cf-heat::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, transparent var(--fill, 44%), rgba(21,17,14,.55) var(--fill, 44%)),
              linear-gradient(90deg, #3aa528, #f2a93b 45%, #ff4400 75%, #b83a0e);
}
#tps-cf-heat::-moz-range-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, transparent var(--fill, 44%), rgba(21,17,14,.55) var(--fill, 44%)),
              linear-gradient(90deg, #3aa528, #f2a93b 45%, #ff4400 75%, #b83a0e);
}
#tps-cf-heat::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%;
  background: var(--tps-orange); border: 3px solid var(--tps-cream); box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
#tps-cf-heat::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--tps-orange); border: 3px solid var(--tps-cream); box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
#tps-cf-heat:focus-visible { outline: 3px solid var(--tps-orange); outline-offset: 4px; border-radius: 4px; }
.tps-heat-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--tps-muted); margin-top: 2px; }
.tps-heat-name { margin: 10px 0 0; font-size: 16px; font-weight: 700; color: var(--tps-orange); }
@media (prefers-reduced-motion: reduce) { .tps-chilli { transition: none; } }

.tps-test-banner { margin: 0; padding: 10px 16px; background: var(--tps-yellow); color: var(--tps-black); font-weight: 700; font-size: 14px; text-align: center; }
