/* ═══════════════════════════════════════════════
   DESIGN TOKENS (overridden by app.js at runtime)
═══════════════════════════════════════════════ */
:root {
  --bg: #f5f5f5;
  --text: #1a1a1a;
  --accent: #ff7043;
  --border: #e0e0e0;
  --card: #ffffff;
  --btn-text: #ffffff;
  --radius-card: 14px;
  --radius-img: 10px;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.07);
  --shadow-card-hover: 0 4px 18px rgba(0, 0, 0, 0.12);
  --transition: 0.22s ease;
  --max-width: 580px;
  --font: 'Inter', system-ui, sans-serif;
}

/* ═══════════════════════════════════════════════
   PATTERN BACKGROUND
   (controlled via CSS variables injected by app.js or backend)
═══════════════════════════════════════════════ */
#pattern-bg {
  position: fixed;
  top: -10vh;
  left: -10vw;
  width: 120vw;
  height: 120vh;
  z-index: -1;
  pointer-events: none;
  background-color: var(--p-fill, transparent);
  mask-image: var(--p-url, none);
  -webkit-mask-image: var(--p-url, none);
  mask-repeat: repeat;
  -webkit-mask-repeat: repeat;
  mask-size: var(--p-size, 200px);
  -webkit-mask-size: var(--p-size, 200px);
  mask-attachment: fixed;
  -webkit-mask-attachment: fixed;
  opacity: var(--p-opacity, 0);
  transform: translateZ(0);
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 48px;
}

img {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ═══════════════════════════════════════════════
   WIDTH CONTAINER (shared by header, main, footer)
═══════════════════════════════════════════════ */
.site-header,
.menu-section,
.site-footer {
  width: 100%;
  max-width: var(--max-width);
}

/* ═══════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════ */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 0 28px;
  text-align: center;
}

.header-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
  background: var(--border);
}

.header-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.header-desc {
  font-size: 0.92rem;
  color: var(--desc-text, #666);
  max-width: 360px;
  line-height: 1.5;
}

/* Social icons */
.social-icons {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--border);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.social-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--social-fill, var(--text));
  transition: fill var(--transition);
}

.social-icon:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.social-icon:hover svg {
  fill: var(--social-fill-hover, var(--bg));
}

/* ═══════════════════════════════════════════════
   MENU GRID
═══════════════════════════════════════════════ */
.menu-section {
  padding: 0;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 420px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════
   PRODUCT CARD & SECTIONS
═══════════════════════════════════════════════ */

/* — Section Labels (Pills) — */
.section-label {
  grid-column: 1 / -1;
  background: var(--sl-bg, rgba(0, 0, 0, 0.04));
  color: var(--sl-text, #666666);
  font-weight: 600;
  font-size: 1rem;
  padding: 6px 14px;
  border-radius: 100px;
  width: max-content;
  margin: 16px auto 6px;
  box-shadow: none;
  border: none;
  letter-spacing: 0.02em;
}

.product-card {
  display: flex;
  flex-direction: row;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 12px;
  transition: box-shadow var(--transition);
  overflow: hidden;
  position: relative;
  height: 106px;
  width: 100%;
}

.product-card:hover {
  box-shadow: var(--shadow-card-hover);
}

/* — Image side — */
.product-img-wrap {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-img);
  overflow: hidden;
  border: 1.5px solid var(--border);
  cursor: zoom-in;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-img);
  transition: opacity var(--transition), transform 0.3s ease;
}

.product-img-wrap:hover img {
  opacity: 0.82;
}

/* Video play badge */
.video-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.video-badge svg {
  width: 22px;
  height: 22px;
  fill: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.55));
}

.product-img-wrap {
  position: relative;
}

/* — Info side — */
.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

/* — Selection Checkbox — */
.product-check-wrap {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  z-index: 2;
  user-select: none;
}

.product-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.product-checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 26px;
  width: 26px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border: 2px solid var(--border);
  border-radius: 50%;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.product-checkbox:checked~.product-checkmark {
  background-color: var(--accent);
  border-color: var(--accent);
}

.product-checkmark svg {
  width: 14px;
  height: 14px;
  stroke: transparent;
  transition: stroke var(--transition);
}

.product-checkbox:checked~.product-checkmark svg {
  stroke: #fff;
}

.product-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-card);
}

.product-name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  padding-right: 34px;
}

.product-desc {
  font-size: 0.76rem;
  color: #888;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  margin-top: -2px;
}

.product-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.price-row .product-price {
  margin-top: 0;
}

.product-quantity {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 4px;
}

.product-card.selected .product-quantity {
  display: flex;
}

.qty-btn {
  background: transparent;
  color: var(--text);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  transition: background var(--transition);
}

.qty-btn:hover {
  background: var(--border);
}

.qty-input {
  width: 28px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text);
  appearance: textfield;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

/* — Button — */
.product-btn {
  display: inline-block;
  padding: 7px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font);
  background: var(--accent);
  color: var(--btn-text);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  line-height: 1;
  width: 100%;
}

.product-btn:hover {
  background: color-mix(in srgb, var(--accent) 85%, #000);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ═══════════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════════ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.open {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(var(--max-width), calc(100vw - 40px));
  animation: lb-in 0.22s ease;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100dvh - 140px);
  width: auto;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox-video {
  display: none;
  max-width: 100%;
  max-height: calc(100dvh - 140px);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #000;
  outline: none;
}

.lightbox-video.active {
  display: block;
}

.lightbox-iframe {
  display: none;
  width: min(var(--max-width), calc(100vw - 40px));
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: none;
  background: #000;
}

.lightbox-iframe.active {
  display: block;
}

/* Lightbox Play Overlay */
.lightbox-play-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  border-radius: 8px;
}

.lightbox-play-overlay.visible {
  display: flex;
}

.lightbox-play-overlay svg {
  width: 64px;
  height: 64px;
  fill: #fff;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s ease;
}

.lightbox-play-overlay:hover svg {
  transform: scale(1.1);
}

.lightbox-iframe.tiktok {
  aspect-ratio: 9 / 16;
  width: auto;
  max-height: calc(100dvh - 120px);
}

.lightbox-caption {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  line-height: 1.5;
  max-width: 480px;
  padding: 0 4px;
  display: none;
}

.lightbox-caption.visible {
  display: block;
}

@keyframes lb-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.30);
  transform: scale(1.1);
}

/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */
.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.footer-link {
  font-size: 0.8rem;
  color: #888;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--accent);
}

.footer-sep {
  font-size: 0.8rem;
  color: #bbb;
  user-select: none;
}

.footer-copy {
  font-size: 0.75rem;
  color: #aaa;
}

/* ═══════════════════════════════════════════════
   EXPORT BUTTON (fixed, right side, outside container)
═══════════════════════════════════════════════ */
.export-wrap {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 500;
  /* Only show when there's enough space beside the 580px container */
  display: none;
}

/* Show only when viewport is wider than container + button space */
@media (min-width: 700px) {
  .export-wrap {
    display: block;
  }
}

.export-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  background: #22c55e;
  border: 1.5px solid #22c55e;
  border-radius: 14px;
  color: #ffffff;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  transition: background var(--transition), border-color var(--transition),
    box-shadow var(--transition), transform var(--transition), color var(--transition);
  white-space: nowrap;
}

.export-btn svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  transition: transform var(--transition);
}

.export-btn:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  transform: translateX(-2px);
}

.export-btn:hover svg {
  stroke: #ffffff;
  transform: translateY(2px);
}

.export-btn:active {
  transform: translateX(0);
}

/* Loading/success state */
.export-btn.exporting {
  opacity: 0.7;
  pointer-events: none;
}

.export-btn.success {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}

.export-btn.success svg {
  stroke: #fff;
}

/* ═══════════════════════════════════════════════
   FLOATING CART BUTTON
═══════════════════════════════════════════════ */
.cart-btn-floating {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 150%);
  opacity: 0;
  z-index: 900;
  background: var(--accent);
  color: var(--btn-text, #fff);
  border: none;
  border-radius: 100px;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, background var(--transition);
  white-space: nowrap;
  pointer-events: none;
}

.cart-btn-floating.visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.cart-btn-floating:hover {
  background: color-mix(in srgb, var(--accent) 85%, #000);
  transform: translate(-50%, -2px);
}

.cart-btn-floating:active {
  transform: translate(-50%, 2px);
}

/*  ORDER CHECKOUT MODAL  */
.checkout-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.checkout-modal.open {
  pointer-events: auto;
  opacity: 1;
}

.checkout-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.checkout-content {
  position: relative;
  background: var(--card);
  width: 90%;
  max-width: 420px;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 90vh;
}

.checkout-modal.open .checkout-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.checkout-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition);
}

.checkout-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.checkout-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.checkout-header p {
  font-size: 0.85rem;
  color: #777;
}

.checkout-image-container {
  width: 100%;
  aspect-ratio: 4/5;
  background: #f8f8f8;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.checkout-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.checkout-loader {
  font-size: 0.85rem;
  font-weight: 600;
  color: #888;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-checkout {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.2s, filter 0.2s;
}

.btn-checkout:active {
  transform: scale(0.98);
}

.btn-checkout.primary {
  background: #25D366;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-checkout.primary:hover {
  filter: brightness(1.08);
}

.btn-checkout.outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-checkout.outline:hover {
  background: rgba(0, 0, 0, 0.03);
}

/*  HIDDEN RECEIPT TEMPLATE  */
.receipt-builder {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 800px;
  height: 1000px;
  background: #ffffff;
  color: #1a1a1a;
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  padding: 60px;
  box-sizing: border-box;
  z-index: -100;
}

.rcpt-header {
  text-align: center;
  margin-bottom: 50px;
  border-bottom: 2px dashed #ddd;
  padding-bottom: 40px;
}

.rcpt-header img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 0 auto 20px auto;
  border: 4px solid #f0f0f0;
}

.rcpt-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.rcpt-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#rcpt-items {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.rcpt-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.6rem;
  font-weight: 500;
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}

.rcpt-item .item-qty {
  font-weight: 700;
  color: var(--accent);
  margin-right: 15px;
  min-width: 40px;
  display: inline-block;
}

.rcpt-item .item-name {
  flex: 1;
}

.rcpt-item .item-price {
  font-weight: 700;
  color: #111;
}

.rcpt-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 3px solid #111;
  font-size: 2.2rem;
  font-weight: 800;
}

.rcpt-total span {
  font-size: 1.8rem;
  font-weight: 600;
  color: #555;
}

.rcpt-footer {
  text-align: center;
  margin-top: 40px;
  font-size: 1.4rem;
  color: #888;
  font-weight: 500;
}