/* ===== Design tokens (matching production) ===== */
:root {
  /* font sizes (Tailwind text-* tokens) */
  --text-xs: 0.75rem;       --text-xs-lh: calc(1 / 0.75);
  --text-sm: 0.875rem;      --text-sm-lh: calc(1.25 / 0.875);
  --text-base: 1rem;        --text-base-lh: 1.5;
  --text-lg: 1.125rem;      --text-lg-lh: calc(1.75 / 1.125);
  --text-xl: 1.25rem;       --text-xl-lh: calc(1.75 / 1.25);
  --text-2xl: 1.5rem;       --text-2xl-lh: calc(2 / 1.5);

  /* font weights */
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* colors */
  --color-black: #000;
  --color-white: #fff;
  --color-gray: #dcdadd;
  --color-gray-2: #8b858e;
  --color-gray-3: #f3f3f4;
  --color-gray-4: #b9b6bb;
  --color-gray-5: #f9f9f9;
  --color-yellow: #fcb82c;
  --color-green: #27ae60;
  --color-green-light: #a7ddbe;
  --color-green-hover: #31c36e;
  --color-red: #e71d36;
  --color-dark-purple: #5d5462;
  --color-dark-purple-2: #170b1e;
  --color-light-white: #fdfdfd;
  --color-slesh-primary: #944bbb;

  /* radii */
  --radius-card: 30px;
  --radius-overlay: 29px;
  --radius-btn: 26px;
  --radius-btn-md: 14px;
  --radius-btn-split: 11px;

  /* layout */
  --header-height: 80px;
  --footer-pad-bottom: 86px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: "Sora", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: var(--text-base);
  line-height: var(--text-base-lh);
  color: var(--color-black);
  background-color: var(--color-light-white);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { display: block; }

/* ===== Headings (matching prod h1-h4) ===== */
h1 {
  font-size: var(--text-xl);
  line-height: var(--text-xl-lh);
  font-weight: var(--fw-semibold);
}
h2 {
  font-size: var(--text-lg);
  line-height: var(--text-lg-lh);
  font-weight: var(--fw-semibold);
}
h3 {
  font-size: var(--text-base);
  line-height: var(--text-base-lh);
  font-weight: var(--fw-medium);
}
h4 {
  font-size: var(--text-base);
  line-height: var(--text-base-lh);
  font-weight: var(--fw-medium);
}

@media (min-width: 48rem) {
  h1 { font-size: var(--text-2xl); line-height: var(--text-2xl-lh); }
  h2 { font-size: var(--text-xl); line-height: var(--text-xl-lh); }
  h3 { font-size: var(--text-lg); line-height: var(--text-lg-lh); }
}

/* utility */
.muted { color: var(--color-gray-2); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Layout ===== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Header (mobile only) ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  min-height: var(--header-height);
  max-height: var(--header-height);
  background-color: var(--color-light-white);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 1rem;
}

.header-left,
.header-right {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.header-left  { justify-content: flex-start; }
.header-right { justify-content: flex-end; }

.header-logo {
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ===== Buttons ===== */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  color: var(--color-black);
  transition: background-color 0.15s ease;
  font-size: 1rem;
}
.btn-icon svg { width: 16px; height: 16px; pointer-events: none; }

.btn-white {
  background-color: var(--color-white);
  border-color: var(--color-gray);
  color: var(--color-black);
}
.btn-white:hover { background-color: rgba(255, 255, 255, 0.9); }

.btn-ghost { border: none; }
.btn-ghost:hover { background-color: rgba(0, 0, 0, 0.05); }

/* Action buttons (New order / Other / overlay) */
.btn,
.btn-pickup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 60px; /* h-15 */
  padding: 0 1.5rem; /* px-6 */
  border: none;
  cursor: pointer;
  font-weight: var(--fw-medium);
  font-size: var(--text-lg);
  line-height: var(--text-lg-lh);
  border-radius: var(--radius-btn);
  width: 100%;
  text-align: center;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn-primary { background-color: var(--color-green); color: var(--color-white); }
.btn-primary:hover { background-color: var(--color-green-hover); }

.btn-outline {
  background-color: transparent;
  color: var(--color-black);
  border: 1px solid var(--color-gray);
}
.btn-outline:hover { background-color: rgba(220, 218, 221, 0.4); }

.btn-pickup-no  { background-color: var(--color-black); color: var(--color-white); }
.btn-pickup-no:hover { background-color: rgba(0, 0, 0, 0.9); }
.btn-pickup-yes { background-color: var(--color-red); color: var(--color-white); }
.btn-pickup-yes:hover { background-color: rgba(231, 29, 54, 0.9); }

@media (min-width: 48rem) {
  .btn,
  .btn-pickup {
    height: 38px;
    font-size: var(--text-sm);
    line-height: var(--text-sm-lh);
    border-radius: var(--radius-btn-md);
    padding: 0.5rem 1.5rem;
    width: auto;
  }
}

/* Split button */
.btn-split {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 28px; /* h-7 */
  padding: 0 0.75rem; /* px-3 */
  border: none;
  cursor: pointer;
  font-size: var(--text-xs);
  line-height: var(--text-xs-lh);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-btn-split);
  background-color: var(--color-green);
  color: var(--color-white);
  transition: background-color 0.15s ease;
  white-space: nowrap;
}
.btn-split:hover { background-color: var(--color-green-hover); }

/* ===== Main ===== */
.main {
  flex: 1;
  padding: 1rem; /* p-4 */
}

.container {
  max-width: 56rem; /* max-w-4xl */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem; /* space-y-4 */
}

@media (min-width: 48rem) {
  .main { padding: 3rem; /* p-12 */ }
}

.order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.order-meta {
  display: flex;
  flex-direction: column;
}
.order-meta-right {
  display: flex;
  flex-direction: column;
}
.order-meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

@media (min-width: 40rem) {
  .order-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .order-meta-right { align-items: flex-end; }
  .order-meta-row { justify-content: flex-end; }
}

/* Section + product card */
.category {
  display: flex;
  flex-direction: column;
  gap: 0.25rem; /* space-y-1 */
}

.product-card {
  position: relative;
  background-color: var(--color-white);
  border: 1px solid var(--color-gray);
  border-radius: var(--radius-card);
  cursor: pointer;
}

.product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem;
}

.product-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.product-img {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  object-fit: cover;
  background-color: var(--color-gray-3);
}

.product-text { display: flex; flex-direction: column; min-width: 0; }
.product-text h4 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.qty {
  color: var(--color-green);
  font-size: var(--text-base);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem 0.35rem; /* py-0.5 px-[0.35rem] */
  background-color: var(--color-black);
  color: var(--color-white);
  font-size: var(--text-xs);
  line-height: var(--text-xs-lh);
  font-weight: var(--fw-medium);
  border-radius: 9999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* ===== Ticket section + dashed divider ===== */
.ticket-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1.5rem; /* pt-6 */
}

.ticket-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 2px dashed var(--color-gray);
}

/* Main rectangular cutouts on the dashed line */
.notch-main {
  position: absolute;
  top: -11px;
  width: 10px;
  height: 20px;
  background-color: var(--color-light-white);
  border: 1px solid var(--color-gray);
  z-index: 20;
}
.notch-main-l {
  left: -1px;
  border-left: 0;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}
.notch-main-r {
  right: -1px;
  border-right: 0;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

/* Connector pieces that curve the card border into the notch */
.notch-conn {
  position: absolute;
  width: 5px;
  height: 10px;
  background-color: var(--color-light-white);
  z-index: 20;
}
.notch-conn::after {
  content: "";
  display: block;
  width: 5px;
  height: 10px;
  box-sizing: border-box;
  border: 1px solid var(--color-gray);
  background-color: transparent;
  transition: background-color 0.3s ease;
}
.notch-conn-tl { top: -19.5px; left: -1px; }
.notch-conn-tl::after { border-top: 0; border-right: 0; border-bottom-left-radius: 5px; }

.notch-conn-bl { top: 8px; left: -1px; }
.notch-conn-bl::after { border-bottom: 0; border-right: 0; border-top-left-radius: 5px; }

.notch-conn-tr { top: -19.5px; right: -1px; }
.notch-conn-tr::after { border-top: 0; border-left: 0; border-bottom-right-radius: 5px; }

.notch-conn-br { top: 8px; right: -1px; }
.notch-conn-br::after { border-bottom: 0; border-left: 0; border-top-right-radius: 5px; }

/* ===== Pickup overlay (3 steps) ===== */
.pickup-overlay {
  position: absolute;
  inset: 0;
  background-color: color-mix(in oklab, var(--color-dark-purple-2) 80%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2rem; /* px-8 */
  border-radius: var(--radius-overlay);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.pickup-step {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.pickup-step h2 { color: var(--color-white); text-align: center; }

.pickup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

/* state visibility */
.product-card[data-pickup-state="1"] .pickup-overlay,
.product-card[data-pickup-state="2"] .pickup-overlay,
.product-card[data-pickup-state="3"] .pickup-overlay {
  opacity: 1;
  pointer-events: auto;
}
.product-card[data-pickup-state="1"] .pickup-step-1 { display: flex; }
.product-card[data-pickup-state="2"] .pickup-step-2 { display: flex; }
.product-card[data-pickup-state="3"] .pickup-step-3 { display: flex; }

/* tint notch connectors with overlay color when active */
.product-card[data-pickup-state="1"] .notch-conn::after,
.product-card[data-pickup-state="2"] .notch-conn::after,
.product-card[data-pickup-state="3"] .notch-conn::after {
  background-color: color-mix(in oklab, var(--color-dark-purple-2) 80%, transparent);
}

.product-card[data-pickup-state="2"],
.product-card[data-pickup-state="3"] { cursor: default; }

/* picked-up checkmark */
.pickup-check {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background-color: var(--color-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pickup-check svg { width: 18px; height: 18px; }

/* refund note */
.refund-note {
  text-align: center;
  font-size: var(--text-sm);
  line-height: var(--text-sm-lh);
  padding: 0.5rem 0; /* py-2 */
  margin: 0 auto;
}
@media (min-width: 48rem) {
  .refund-note { max-width: 300px; }
}

/* actions row */
.actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}
@media (min-width: 48rem) {
  .actions {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
  }
}

/* ===== Footer ===== */
.footer {
  width: 100%;
  padding: 1rem 1rem var(--footer-pad-bottom);
  background-color: var(--color-light-white);
  margin-top: auto;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}
.footer-logo .slesh-logo { width: 120px; height: 28px; display: inline-block; }
.footer-info p {
  font-size: var(--text-sm);
  line-height: var(--text-sm-lh);
}
.footer-contact a {
  font-size: var(--text-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-contact a:hover { text-decoration: underline; }
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  font-size: var(--text-xs);
}
.footer-legal a:hover { text-decoration: underline; }

@media (min-width: 48rem) {
  .header { display: none; }
  .footer { padding: 1rem 3rem; position: sticky; bottom: 0; }
  .footer-inner {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    text-align: left;
  }
  .product-card { /* on desktop card is half-width */ }
}
