/* Flowers Time order portal. Light theme, one accent (#A3195B), neutral surfaces. */

@font-face {
  font-family: "Manrope";
  src: url("../assets/fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Accent tonal palette (seed #A3195B) */
  --primary: #a3195b;
  --on-primary: #ffffff;
  --primary-container: #ffd9e5;
  --on-primary-container: #3e0021;
  --primary-deep: #6c0b3b;

  /* Neutral surfaces */
  --surface: #f7f7f7;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f1f1f1;
  --surface-container: #eaeaea;
  --surface-container-high: #e3e3e3;
  --surface-container-highest: #dcdcdc;
  --outline: #767676;
  --outline-variant: #d0d0d0;
  --on-surface: #1b1b1b;
  --on-surface-variant: #4a4a4a;

  /* Type scale */
  --fs-page: 1.5rem;
  --fs-section: 1.1875rem;
  --fs-body: 0.9375rem;
  --fs-secondary: 0.8125rem;
  --fs-small: 0.75rem;
  --fs-hero: 2rem;

  /* Radius */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Motion */
  --t: 150ms;
  --spring: linear(0, 0.2 6%, 0.62 14%, 0.96 24%, 1.1 32%, 1.12 38%, 1.06 48%, 1.01 60%, 0.995 72%, 1);

  --gutter: 16px;
  --bar-space: calc(112px + env(safe-area-inset-bottom));
  --shadow-float: 0 6px 20px rgb(0 0 0 / 0.16), 0 1px 3px rgb(0 0 0 / 0.1);

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.45;
  overflow-x: hidden;
}

body:has(dialog[open]) { overflow: hidden; }

[hidden] { display: none !important; }

h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }

::selection { background: var(--primary-container); color: var(--on-primary-container); }

.tnum { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--on-surface); outline-offset: 3px; }
.btn-primary:focus-visible { outline-color: var(--primary); }

.icon { display: inline-flex; flex: none; line-height: 0; }

/* Layout */
.shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.top { padding-top: calc(14px + env(safe-area-inset-top)); }

.wordmark {
  font-size: var(--fs-section);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--primary);
  line-height: 1.2;
}

.steps { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.steps-label { font-size: var(--fs-secondary); font-weight: 600; color: var(--on-surface-variant); white-space: nowrap; }
.steps-track { display: flex; gap: 4px; flex: 1; }
.steps-track span {
  flex: 1; height: 4px; border-radius: var(--r-pill);
  background: var(--surface-container-highest);
  transition: background-color var(--t) ease;
}
.steps-track span.on { background: var(--primary); }

.view { padding-top: 20px; padding-bottom: 40px; outline: none; }
.view.has-bar { padding-bottom: var(--bar-space); }

.noscript { padding: 16px; border-radius: var(--r-md); background: var(--primary-container); color: var(--on-primary-container); }

/* Title row */
.title-row { display: flex; align-items: center; gap: 8px; }
.title-row .icon-btn { margin-left: -8px; }
.page-title { font-size: var(--fs-page); font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; outline: none; }
.subtitle { margin-top: 6px; color: var(--on-surface-variant); }
.notice { margin-top: 6px; font-size: var(--fs-small); font-weight: 600; letter-spacing: 0.02em; color: var(--on-surface-variant); }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  color: var(--on-surface);
  transition: background-color var(--t) ease, transform var(--t) ease;
}
.icon-btn:hover { background: var(--surface-container); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn[aria-disabled="true"] { opacity: 0.38; cursor: not-allowed; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px;
  border-radius: var(--r-pill);
  font-size: var(--fs-body); font-weight: 800;
  text-decoration: none; text-align: center;
  transition: transform var(--t) ease, background-color var(--t) ease, opacity var(--t) ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: #8f154f; }
.btn-primary[aria-disabled="true"] {
  background: var(--surface-container-highest); color: #666; cursor: not-allowed; box-shadow: none;
}
.btn-block { display: flex; width: 100%; }

.btn-tonal {
  min-height: 44px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  background: var(--primary-container); color: var(--on-primary-container);
  font-size: var(--fs-secondary); font-weight: 800;
  transition: transform var(--t) ease;
}
.btn-tonal:active { transform: scale(0.96); }

/* Filter: connected button group */
.filter {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  margin: 18px 0 20px;
}
.filter button {
  min-height: 44px; padding: 0 20px;
  border-radius: var(--r-xs);
  background: var(--surface-container-high);
  font-size: var(--fs-body); font-weight: 700;
  transition: background-color var(--t) ease, color var(--t) ease, border-radius 400ms var(--spring), transform var(--t) ease;
}
.filter button:active { transform: scale(0.97); }
.filter button:nth-child(1) { border-top-left-radius: 22px; }
.filter button:nth-child(2) { border-top-right-radius: 22px; }
.filter button:nth-child(3) { border-bottom-left-radius: 22px; }
.filter button:nth-child(4) { border-bottom-right-radius: 22px; }
.filter button[aria-pressed="true"] {
  border-radius: 22px; background: var(--primary); color: var(--on-primary);
}
@media (min-width: 480px) {
  .filter { grid-template-columns: repeat(4, auto); justify-content: start; }
  .filter button { min-width: 92px; }
  .filter button:nth-child(1) { border-radius: 22px var(--r-xs) var(--r-xs) 22px; }
  .filter button:nth-child(2), .filter button:nth-child(3) { border-radius: var(--r-xs); }
  .filter button:nth-child(4) { border-radius: var(--r-xs) 22px 22px var(--r-xs); }
  .filter button[aria-pressed="true"] { border-radius: 22px; }
}

/* Counter (step 2) */
.counter { display: flex; align-items: center; gap: 10px; min-height: 28px; margin-top: 16px; font-size: var(--fs-secondary); color: var(--on-surface-variant); }
.counter-chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px;
  border-radius: var(--r-pill); background: var(--primary-container); color: var(--on-primary-container);
  font-weight: 800;
}

/* Bouquet grid */
.grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 12px;
}
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; } }

.card { position: relative; }
.card-select { display: block; width: 100%; text-align: left; border-radius: var(--r-md); }
.card-select:focus-visible { outline-offset: 4px; }

.photo {
  display: block; position: relative; overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-xl);
  background: var(--surface-container-high);
  transition: border-radius 450ms var(--spring), box-shadow var(--t) ease, transform var(--t) ease;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.card-select:active .photo { transform: scale(0.98); }
.card-select[aria-pressed="true"] .photo {
  border-radius: 48px 12px 48px 12px;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--primary);
}
.card-select[aria-disabled="true"] { opacity: 0.42; cursor: not-allowed; }

.badge {
  position: absolute; left: 10px; bottom: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary);
  transform: scale(0);
  transition: transform 450ms var(--spring);
}
.card-select[aria-pressed="true"] .badge { transform: scale(1); }

.card-expand {
  position: absolute; top: 4px; right: 4px;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgb(255 255 255 / 0.92); color: var(--on-surface);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);
  transition: transform var(--t) ease;
}
.card-expand:active { transform: scale(0.92); }
.card-expand:focus-visible { outline-offset: 1px; }

.card-name { display: block; margin-top: 10px; font-weight: 700; line-height: 1.3; }
.card-price { display: block; margin-top: 2px; font-size: var(--fs-secondary); color: var(--on-surface-variant); font-weight: 600; }

/* Segmented rows */
.seg { display: grid; gap: 3px; }
.seg > li {
  display: flex; align-items: center; gap: 12px;
  min-height: 72px; padding: 12px 16px;
  background: var(--surface-container-lowest);
  border-radius: var(--r-xs);
}
.seg > li:first-child { border-top-left-radius: var(--r-xl); border-top-right-radius: var(--r-xl); }
.seg > li:last-child { border-bottom-left-radius: var(--r-xl); border-bottom-right-radius: var(--r-xl); }

.row-thumb { flex: none; width: 52px; height: 68px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-container-high); }
.row-text { flex: 1; min-width: 0; }
.row-caption { font-size: var(--fs-small); font-weight: 700; letter-spacing: 0.02em; color: var(--primary); }
.row-name {
  font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.row-amount { margin-top: 2px; font-weight: 800; }
.row-sub { margin-left: 6px; font-size: var(--fs-secondary); font-weight: 600; color: var(--on-surface-variant); }

/* Complements (step 3) */
.product-photo {
  position: relative; flex: none; overflow: hidden;
  border-radius: var(--r-sm);
  background: #fff; box-shadow: inset 0 0 0 1px var(--surface-container-high);
  transition: transform var(--t) ease;
}
.product-photo:active { transform: scale(0.96); }
.product-photo img { width: 100%; height: 100%; object-fit: contain; }
.product-zoom {
  position: absolute; right: 3px; bottom: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgb(255 255 255 / 0.92); color: var(--on-surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
}
.comp-photo { width: 84px; height: 84px; }
.row-photo { width: 52px; height: 52px; }
.row-photo .product-zoom { display: none; }
.comp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.comp-foot .row-amount { margin-top: 0; }
.comp-foot .row-sub { display: block; margin-left: 0; }
.stepper { display: inline-flex; align-items: center; flex: none; }
.stepper button {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-container-high);
  transition: transform var(--t) ease, background-color var(--t) ease, opacity var(--t) ease;
}
.stepper button:active { transform: scale(0.9); }
.stepper .plus { background: var(--primary); color: var(--on-primary); }
.stepper button[aria-disabled="true"] { opacity: 0.38; cursor: not-allowed; }
.stepper .qty { min-width: 32px; text-align: center; font-weight: 800; font-size: var(--fs-section); }

/* Shipping check row */
.section-gap { margin-top: 16px; }
.check-row {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 20px;
  background: var(--surface-container-lowest);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: transform var(--t) ease;
}
.check-row:active { transform: scale(0.99); }
.check-row:has(.check-input:focus-visible) { outline: 3px solid var(--on-surface); outline-offset: 3px; }
.check-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.check-box {
  flex: none; width: 24px; height: 24px; border-radius: 8px;
  border: 2px solid var(--outline); color: transparent;
  display: grid; place-items: center;
  transition: background-color var(--t) ease, border-color var(--t) ease, color var(--t) ease;
}
.check-input:checked ~ .check-box { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.check-text { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.check-fee { font-weight: 800; }

/* Delivery details: hidden until the customer asks for them */
.ship-card { background: var(--surface-container-lowest); border-radius: var(--r-xl); }
.ship-card .check-row { background: none; }
.ship-field { padding: 0 20px 18px; }

.opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.opt.open { flex-basis: 100%; }
.opt-add { gap: 6px; padding: 0 16px 0 12px; background: var(--surface-container-high); color: var(--on-surface); }
.opt .field { padding: 6px 20px 18px; background: var(--surface-container-lowest); border-radius: var(--r-xl); }

.field-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.field-head .icon-btn { margin-right: -10px; }
.field-label { display: block; font-size: var(--fs-secondary); font-weight: 700; color: var(--on-surface-variant); }
.ship-field .field-label { margin-bottom: 8px; }
.field-input {
  display: block; width: 100%; min-height: 48px; padding: 12px 14px;
  border: 0; border-radius: var(--r-md);
  background: var(--surface-container-low); color: var(--on-surface);
  font: inherit; font-size: 1rem; /* 16px stops iOS from zooming on focus */
  line-height: 1.35; resize: none; caret-color: var(--primary);
  -webkit-appearance: none; appearance: none;
  transition: box-shadow var(--t) ease;
}
.field-input::placeholder { color: var(--on-surface-variant); opacity: 1; }
.field-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--primary); }

/* Hero total */
.hero {
  position: relative; overflow: hidden;
  margin-top: 16px; padding: 24px;
  border-radius: var(--r-xl);
  color: #fff;
  background: linear-gradient(135deg, #a3195b 0%, var(--primary-deep) 100%);
}
.hero > * { position: relative; z-index: 1; }
.hero .shape { position: absolute; z-index: 0; pointer-events: none; background: rgb(255 255 255 / 0.12); }
.hero .s1 { width: 150px; height: 150px; right: -36px; top: -44px; border-radius: 62% 38% 55% 45% / 50% 60% 40% 50%; }
.hero .s2 { width: 92px; height: 92px; right: 64px; bottom: -34px; border-radius: 30% 70% 40% 60%; background: rgb(255 255 255 / 0.09); }
.hero .s3 { width: 54px; height: 54px; right: 18px; bottom: 34px; border-radius: 48px 12px 48px 12px; background: rgb(255 255 255 / 0.1); }
.hero-label { font-size: var(--fs-secondary); font-weight: 700; letter-spacing: 0.02em; }
.hero-amount { margin-top: 4px; font-size: var(--fs-hero); font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; }
.hero-meta { margin-top: 6px; font-size: var(--fs-secondary); font-weight: 600; }

.send { margin-top: 16px; }
.send-note { margin-top: 12px; text-align: center; font-size: var(--fs-secondary); color: var(--on-surface-variant); }

.empty { padding: 20px; border-radius: var(--r-xl); background: var(--surface-container-lowest); color: var(--on-surface-variant); }

/* Floating bar: no background band, only floating controls */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.bar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: var(--gutter);
}
.bar-inner > * { pointer-events: auto; }
.bar-total {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 56px; padding: 6px 20px;
  border-radius: var(--r-xl);
  background: var(--surface-container-lowest);
  box-shadow: var(--shadow-float);
  min-width: 0;
}
.bar-label { font-size: var(--fs-small); font-weight: 700; color: var(--on-surface-variant); line-height: 1.2; white-space: nowrap; }
.bar-amount { font-size: var(--fs-section); font-weight: 800; line-height: 1.2; white-space: nowrap; }
.bar .btn { flex: 1; max-width: 280px; box-shadow: var(--shadow-float); }
.bar .btn[aria-disabled="true"] { box-shadow: var(--shadow-float); background: var(--surface-container-highest); }

/* Snackbar: confirmation and undo */
.snack {
  position: fixed; z-index: 30;
  left: var(--gutter); right: var(--gutter); bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 480px; margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 4px 8px 4px 20px;
  border-radius: var(--r-md);
  background: var(--on-surface); color: #fff;
  font-size: var(--fs-secondary); font-weight: 600;
  box-shadow: var(--shadow-float);
  animation: sheet-in var(--t) ease-out;
}
#bar:not([hidden]) ~ .snack { bottom: calc(86px + env(safe-area-inset-bottom)); }
.snack-action {
  flex: none; min-height: 44px; padding: 0 12px;
  border-radius: var(--r-pill);
  color: var(--primary-container); font-weight: 800;
}
.snack-action:focus-visible { outline-color: #fff; outline-offset: 0; }

/* Bottom sheet (dialog) */
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh;
  margin: auto auto 0; padding: 0; border: 0; overflow: auto;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface-container-lowest); color: var(--on-surface);
}
.sheet::backdrop { background: rgb(0 0 0 / 0.5); }
.sheet[open] { animation: sheet-in var(--t) ease-out; }
.sheet[open]::backdrop { animation: fade-in var(--t) ease-out; }
@keyframes sheet-in { from { transform: translateY(28px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@media (min-width: 600px) {
  .sheet { margin: auto; border-radius: var(--r-xl); }
}
.sheet-body { padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; }
.sheet-title { font-size: var(--fs-section); font-weight: 800; padding-left: 4px; }
.sheet-photo {
  display: block; margin: 4px auto 0;
  width: auto; height: auto; max-width: 100%; max-height: min(58dvh, 520px);
  aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: var(--r-lg); background: var(--surface-container-high);
}
.sheet-photo.product { aspect-ratio: 1; width: 100%; object-fit: contain; background: #fff; }
.sheet-price { margin-top: 12px; text-align: center; font-weight: 800; font-size: var(--fs-section); }
.sheet-action { margin-top: 14px; }

@media (min-width: 900px) {
  :root { --gutter: 24px; }
  .view { padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .btn:active, .icon-btn:active, .btn-tonal:active, .filter button:active,
  .card-select:active .photo, .stepper button:active, .card-expand:active, .check-row:active { transform: none; }
}
