/* Order page — extends the tokens defined in ../styles.css (colors, spacing, radii, fonts). */

body.order-body {
  font-family: var(--font-en);
  background: var(--color-bg-light);
  padding-bottom: 6rem; /* room for the sticky cart bar */
}

.order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.order-header .order-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.order-header .order-brand img {
  width: 32px;
  height: 32px;
}

.order-header a.order-home-link {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: underline;
}

.order-experimental-notice {
  max-width: 720px;
  margin: 1.25rem auto 0;
  padding: 0.75rem 1.25rem;
  text-align: center;
  background: #fff8e1;
  color: #7a5b00;
  border: 1px solid #f2d98a;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.5;
}

.order-intro {
  max-width: 720px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.order-intro strong {
  color: var(--color-text-main);
}

.order-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.order-category {
  margin-top: 2.5rem;
}

.order-category h2 {
  font-family: var(--font-en);
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--color-text-main);
}

.order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.order-card {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.order-card.is-sold-out .order-card-img img {
  filter: grayscale(1);
  opacity: 0.6;
}

.order-card-img {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #f4eee8, #e9ded3);
  position: relative;
}

.order-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-sold-out-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--color-text-main);
  color: var(--color-bg-white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.order-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.order-card-body h3 {
  font-size: 1.05rem;
  color: var(--color-text-main);
  margin: 0;
}

.order-card-kr {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.order-card-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.order-card-price {
  font-weight: 700;
  color: var(--color-text-main);
  margin-top: 0.25rem;
}

.order-card-actions {
  margin-top: auto;
  padding-top: 0.75rem;
}

.order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font-en);
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  background: var(--color-primary);
  color: var(--color-espresso);
}

.order-btn:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.order-btn:disabled {
  background: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.order-btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
}

.order-options-panel {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.order-option-set legend {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.35rem;
}

.order-option-set .order-option-hint {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.order-option-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.85rem;
}

.order-option-choice label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.order-option-choice .order-option-price {
  color: var(--color-text-muted);
}

.order-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.order-qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.4rem;
}

.order-qty-stepper button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--color-bg-light);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.order-panel-total {
  font-weight: 700;
}

/* Sticky cart bar */
.order-cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--color-text-main);
  color: var(--color-bg-white);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform var(--transition-base);
}

.order-cart-bar.is-visible {
  transform: translateY(0);
}

.order-cart-bar .order-cart-summary {
  font-size: 0.9rem;
}

.order-cart-bar .order-cart-summary strong {
  font-size: 1.05rem;
}

/* Cart / checkout drawer */
.order-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
  display: none;
}

.order-drawer-overlay.is-open {
  display: block;
}

.order-drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: var(--color-bg-white);
  z-index: 41;
  transform: translateX(100%);
  transition: transform var(--transition-base);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.order-drawer.is-open {
  transform: translateX(0);
}

.order-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.order-drawer-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--color-text-muted);
}

.order-drawer-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.order-cart-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.order-cart-line-selections {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.order-cart-line-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: underline;
}

.order-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.order-form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.order-form-field input[type="text"],
.order-form-field input[type="tel"],
.order-form-field input[type="time"],
.order-form-field textarea {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-en);
  font-size: 0.9rem;
}

.order-form-field textarea {
  min-height: 70px;
  resize: vertical;
}

.order-form-field input:focus,
.order-form-field textarea:focus {
  outline: 3px solid var(--color-primary);
  outline-offset: 1px;
}

.order-pickup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.order-chip {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg-white);
  font-size: 0.8rem;
  cursor: pointer;
}

.order-chip.is-selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-espresso);
  font-weight: 700;
}

/* Honeypot field — hidden from real visitors, left open for bots */
.order-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1rem;
  padding-top: 0.5rem;
}

.order-disclaimer {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.order-error {
  color: #c0392b;
  font-size: 0.85rem;
}

.order-confirmation {
  text-align: center;
  padding: 2rem 1.5rem;
}

.order-confirmation .order-code {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-primary-hover);
  margin: 0.75rem 0;
}

.order-receipt {
  text-align: left;
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-light);
}

.order-receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  padding: 0.2rem 0;
}

.order-receipt-row span:first-child {
  color: var(--color-text-muted);
}

.order-receipt-items {
  margin-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.order-receipt.is-completed {
  opacity: 0.55;
}

.order-staff-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
}

.order-staff-actions label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.order-debug {
  margin-top: 1.5rem;
  text-align: left;
  background: var(--color-bg-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.order-debug summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.order-debug pre {
  font-size: 0.72rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 0.5rem;
}

.order-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

@media (max-width: 480px) {
  .order-drawer {
    width: 100%;
  }
}
