:root {
  --bg-cream: #fff6e1;
  --bg-sand: #f1c981;
  --ink: #1d252d;
  --ink-soft: #4c5c68;
  --brand: #d96d10;
  --brand-dark: #923f00;
  --mint: #176f67;
  --mint-soft: #d5efe8;
  --card: #fffcf4;
  --line: #ebb973;
  --danger: #a61b1b;
  --customer-bg-image: url("/images/date-grove.jpg");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: linear-gradient(145deg, var(--bg-cream), var(--bg-sand));
}

.customer-page {
  position: relative;
  isolation: isolate;
}

.customer-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--customer-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.03);
}

.customer-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% -20%, rgba(252, 236, 201, 0.45), transparent 56%),
    linear-gradient(180deg, rgba(30, 20, 8, 0.28), rgba(30, 20, 8, 0.5));
}

.background-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0.35) 8px,
    rgba(255, 255, 255, 0) 8px,
    rgba(255, 255, 255, 0) 18px
  );
  opacity: 0.18;
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 840px;
  margin: 1.4rem auto;
  padding: 0 0.75rem 5.5rem;
  display: grid;
  gap: 0.9rem;
}

.card {
  background: rgba(255, 252, 244, 0.9);
  border: 1px solid rgba(235, 185, 115, 0.72);
  border-radius: 18px;
  padding: 0.85rem;
  box-shadow: 0 18px 36px rgba(18, 13, 8, 0.23);
  backdrop-filter: blur(6px);
  animation: rise-in 300ms ease both;
}

.hero {
  text-align: center;
  padding: 1.1rem;
}

.customer-page .hero.card {
  background: linear-gradient(120deg, rgba(45, 33, 17, 0.78), rgba(122, 69, 17, 0.64));
  border-color: rgba(255, 235, 199, 0.35);
  box-shadow: 0 22px 42px rgba(16, 10, 5, 0.4);
}

.compact-hero {
  display: grid;
  gap: 0.18rem;
}

.hero-trust-row {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.hero-trust-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 240, 214, 0.5);
  background: rgba(255, 250, 240, 0.14);
  color: #fff3db;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  letter-spacing: 0.02em;
}

.hero-line {
  margin: 0.1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.subbrand {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.1rem;
  color: #ffe7b9;
}

.season-line {
  margin: 0;
  font-size: 0.85rem;
  color: #7e5122;
}

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: #f3debc;
}

.customer-page h1 {
  color: #fff8ea;
  text-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
}

.customer-page .hero p {
  color: #f8e5c4;
}

.customer-page .app-card {
  background: rgba(255, 250, 240, 0.93);
}

h1,
h2,
h3 {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  font-family: "Fraunces", serif;
  line-height: 1.1;
}

h1 {
  font-size: clamp(1.9rem, 5.4vw, 2.75rem);
}

.stacked-form {
  display: grid;
  gap: 0.58rem;
}

.catalog-head {
  display: grid;
  gap: 0.2rem;
}

.catalog-head h3 {
  margin: 0;
}

label,
fieldset {
  display: grid;
  gap: 0.25rem;
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

input,
textarea {
  border: 1px solid #e5c089;
  border-radius: 11px;
  padding: 0.6rem;
  font: inherit;
  background: #fff;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(217, 119, 6, 0.3);
  border-color: var(--brand);
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.64rem 0.95rem;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
}

.btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
}

.btn.whatsapp {
  background: linear-gradient(135deg, #25d366, #1da851);
  color: #fff;
}

.admin-entry-row {
  margin: 0;
  text-align: center;
}

.admin-entry-link {
  color: #7b674e;
  font-size: 0.76rem;
  text-decoration: none;
  border-bottom: 1px dotted rgba(123, 103, 78, 0.6);
}

.admin-entry-link:hover,
.admin-entry-link:focus-visible {
  color: #5b4a36;
  border-bottom-color: rgba(91, 74, 54, 0.9);
}

.top-row,
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
}


.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.58rem;
}

.product-media,
.product-image-frame {
  border: 1px solid #e9c993;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #fffaf0, #fff2de);
}

.product-media {
  margin-bottom: 0.45rem;
}

.product-image {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.product-image-placeholder {
  display: grid;
  place-items: center;
  min-height: 132px;
  padding: 0.6rem;
  color: #85623b;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.45),
    rgba(255, 255, 255, 0.45) 10px,
    rgba(255, 247, 231, 0.9) 10px,
    rgba(255, 247, 231, 0.9) 20px
  );
  text-align: center;
  font-size: 0.84rem;
}

.product-item {
  border: 1px solid rgba(235, 185, 115, 0.8);
  border-radius: 12px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.86);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.product-badge {
  margin: 0 0 0.42rem;
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 0.16rem 0.48rem;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, #1c7a60, #135d49);
}

.product-badge-secondary {
  background: linear-gradient(135deg, #a55810, #7d3c03);
}

.customer-page .product-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(55, 33, 8, 0.16);
}

.product-item h4 {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.25;
}

.product-admin-card {
  display: grid;
  gap: 0.55rem;
}

.product-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.product-admin-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  align-items: start;
}

.product-admin-card .product-image-frame {
  width: 100%;
}

.product-admin-main .stacked-form {
  gap: 0.28rem;
}

.product-admin-main h4 {
  margin: 0;
  font-size: 1rem;
}

.product-actions {
  justify-content: flex-end;
}

.product-actions .btn {
  min-width: 72px;
}

.product-meta {
  margin: 0.12rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.product-item label {
  margin-top: 0.35rem;
}

.product-item .product-image-placeholder {
  min-height: 126px;
}

.qty-shell {
  margin-top: 0.35rem;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  gap: 0.3rem;
}

.qty-btn {
  border: 1px solid #d8af72;
  border-radius: 9px;
  background: #fff4de;
  color: var(--brand-dark);
  font-size: 1.05rem;
  font-weight: 700;
  min-height: 38px;
  cursor: pointer;
}

.qty-input {
  text-align: center;
  font-weight: 700;
  min-height: 38px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.payment-box {
  border: 1px dashed #dcb06e;
  border-radius: 12px;
  padding: 0.55rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.7rem;
  row-gap: 0.22rem;
}

.payment-box legend {
  grid-column: 1 / -1;
  padding: 0 0.25rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.88rem;
}

.orders-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.orders-list li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem;
  background: #fff;
}

.checkout-row {
  position: sticky;
  bottom: 0.6rem;
  background: linear-gradient(135deg, rgba(255, 253, 247, 0.98), rgba(252, 237, 208, 0.98));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.6rem 0.7rem;
  box-shadow: 0 10px 20px rgba(112, 61, 0, 0.2);
}

.checkout-row .btn.primary {
  min-width: 148px;
}

#orderTotal {
  margin: 0;
  font-weight: 700;
  font-size: 0.96rem;
}

.trust-line {
  margin: 0;
  font-size: 0.84rem;
  color: #5d4322;
  text-align: center;
}

.message {
  margin: 0;
  min-height: 1.2rem;
  color: var(--danger);
  font-weight: 700;
}

.hint {
  margin: 0;
  color: var(--ink-soft);
}

.hidden {
  display: none;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.metric-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem;
  background: #fff;
}

.metric-highlight {
  border-color: #d78e2d;
  background: #fff0d5;
}

.metric-new-orders {
  grid-column: 1 / -1;
}

.metric-label {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.metric-value {
  margin: 0.2rem 0 0;
  font-family: "Fraunces", serif;
  font-size: 1.16rem;
  color: var(--brand-dark);
}

.tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.section-divider {
  border: 0;
  border-top: 1px solid #e8c98d;
  margin: 0.35rem 0 0.55rem;
}

.tab-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-color: transparent;
}

.section-caption {
  margin: 0.2rem 0;
  font-weight: 700;
  color: #784718;
  letter-spacing: 0.02em;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #d9b27a;
  padding: 0.16rem 0.45rem;
  font-size: 0.72rem;
  color: #6e4c24;
  background: #fff8ec;
}

.chip-status-awaiting_card_payment,
.chip-status-awaiting_zelle,
.chip-status-awaiting_cash {
  border-color: #d38f3b;
  background: #ffe7c6;
  color: #8f4f04;
}

.chip-status-paid,
.chip-status-ready_for_pickup {
  border-color: #2f9a60;
  background: #e4f5ea;
  color: #15613a;
}

.chip-status-completed {
  border-color: #2a7f79;
  background: #dff3f1;
  color: #14524e;
}

.chip-status-cancelled {
  border-color: #be5a5a;
  background: #fde5e5;
  color: #8b2020;
}

select {
  border: 1px solid #d8af72;
  border-radius: 9px;
  padding: 0.42rem 0.5rem;
  font: inherit;
  background: #fff;
}

.order-controls {
  display: grid;
  gap: 0.38rem;
  justify-items: end;
}

.ready-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #285d57;
}

.ready-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #176f67;
}

.order-confirm-dialog,
.order-summary-dialog,
.season-notice-dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem;
  width: min(560px, calc(100vw - 1.4rem));
  background: var(--card);
  color: var(--ink);
}

.customer-page .hero.card {
  animation-delay: 40ms;
}

.customer-page .app-card.card {
  animation-delay: 120ms;
}

.order-confirm-dialog::backdrop,
.order-summary-dialog::backdrop,
.season-notice-dialog::backdrop {
  background: rgba(25, 21, 14, 0.4);
}

.confirm-item-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.22rem;
  color: var(--ink);
  font-weight: 600;
}

#orderConfirmMeta {
  gap: 0.2rem;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .product-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .payment-box {
    grid-template-columns: 1fr;
  }

  .summary-row,
  .top-row {
    align-items: center;
  }

  .qty-shell {
    grid-template-columns: 46px 1fr 46px;
    gap: 0.35rem;
  }

  .qty-btn,
  .qty-input {
    min-height: 46px;
    font-size: 1.12rem;
  }

  .btn.primary {
    min-height: 46px;
    min-width: 148px;
  }

  .checkout-row .btn.primary {
    width: 100%;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-admin-main {
    grid-template-columns: 1fr;
  }

  .chip-row {
    row-gap: 0.28rem;
  }

  .customer-page::before {
    background-attachment: scroll;
    transform: scale(1.01);
  }

}
