/* ==========================================================================
   Service request page (order.html)
   Calm, editorial kiosk: one category at a time, light cards, big tap
   targets, and a floating "Your request" bar.
   ========================================================================== */

:root {
  --header-h: 64px;
  --content-w: 1120px;
  --field-bg: #FCFAF6;
  --tint: #F1EFE6;          /* soft sage tint for icons and selected states */
  --card-radius: 18px;
}

body {
  background: var(--paper);
}

/* Room for the floating order bar on step 1 */
body[data-step="1"] {
  padding-bottom: 120px;
}

h1, h2, h3 {
  text-wrap: balance;
}

/* ---------- Shared building blocks ---------- */
.page {
  width: 100%;
  max-width: calc(var(--content-w) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.page-narrow {
  max-width: calc(760px + 2 * var(--gutter));
}

.kicker {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--olive);
}

.intro {
  padding-top: clamp(28px, 5vw, 56px);
  margin-bottom: clamp(20px, 3vw, 28px);
}

.intro h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  outline: none;
}

.intro > p:last-child {
  max-width: 58ch;
  margin: 0;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.btn-lg {
  min-height: 54px;
  padding: 0 26px;
  font-size: 1rem;
  font-weight: 600;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--brown);
}

.btn-ghost:hover {
  background: var(--white);
  border-color: var(--olive);
}

.icon,
.btn-icon,
.cat-icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.step-panel[hidden] {
  display: none;
}

/* ---------- Header ---------- */
.order-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.order-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  max-width: calc(var(--content-w) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.order-header .brand-mark {
  height: 36px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-underline-offset: 4px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stepper li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.stepper li + li::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--line-strong);
}

.stepper span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.stepper em {
  font-style: normal;
}

.stepper li[aria-current="step"] {
  color: var(--brown);
  font-weight: 600;
}

.stepper li[aria-current="step"] span,
.stepper li.is-done span {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--white);
}

@media (max-width: 720px) {
  .stepper em { display: none; }
  .stepper li[aria-current="step"] em { display: inline; }
  .stepper li + li::before { width: 14px; }
}

@media (max-width: 520px) {
  .order-header .brand-name { display: none; }
}

/* ==========================================================================
   Step 1 — choose services
   ========================================================================== */

/* Two columns: category list on the left, cards on the right */
.menu-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: clamp(20px, 2.4vw, 32px);
  padding-bottom: 24px;
}

/* Category list — stays in view while the cards scroll */
.category-panel {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.category-label {
  margin: 0 0 10px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--white);
}

.cat-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--brown);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.cat-btn:hover {
  background: var(--paper);
}

.cat-icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--olive);
}

.cat-name {
  flex: 1;
}

.cat-count {
  flex: none;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--olive);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

.cat-count:empty {
  display: none;
}

.cat-btn[aria-current="true"] {
  background: var(--brown);
  color: var(--cream);
}

.cat-btn[aria-current="true"] .cat-icon {
  color: var(--cream);
}

.cat-btn[aria-current="true"] .cat-count {
  background: var(--cream);
  color: var(--brown);
}

/* Tablets and phones: the list becomes a sticky row of tabs above the cards */
@media (max-width: 900px) {
  .menu-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .category-panel {
    top: var(--header-h);
    z-index: 30;
    margin: 0 calc(-1 * var(--gutter));
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }

  .category-label {
    display: none;
  }

  .category-nav {
    flex-direction: row;
    gap: 8px;
    padding: 12px var(--gutter);
    overflow-x: auto;
    border: 0;
    border-radius: 0;
    background: none;
    scrollbar-width: none;
  }

  .category-nav::-webkit-scrollbar {
    display: none;
  }

  /* End spacer: scrolling rows ignore end padding, so the last tab can scroll fully into view */
  .category-nav::after {
    content: "";
    flex: none;
    width: calc(var(--gutter) - 8px);
  }

  .cat-btn {
    flex: none;
    width: auto;
    min-height: 46px;
    gap: 8px;
    padding: 0 16px 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--white);
  }

  .cat-btn:hover {
    background: var(--white);
    border-color: var(--olive);
  }

  .cat-btn[aria-current="true"] {
    background: var(--brown);
    border-color: var(--brown);
  }
}

/* Category heading */
.menu-content {
  min-width: 0;
}

@media (max-width: 900px) {
  .menu-content {
    padding-top: 24px;
  }
}

.menu-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.menu-head h2 {
  margin: 0 0 4px;
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
}

.menu-head p {
  margin: 0;
  color: var(--ink-soft);
}

.menu-count {
  flex: none;
  padding-bottom: 3px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .menu-count { display: none; }
}

/* Service cards: 3 per row on laptops/desktops, 2 on tablets, 1 on phones */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1100px) {
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .tile-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Compact card: icon, name, description, then the action row at the bottom */
.tile {
  container-type: inline-size; /* lets the action row adapt to the card's own width */
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.tile:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px -20px rgba(76, 55, 19, 0.45);
}

.tile-media {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--tint);
  color: var(--olive);
  overflow: hidden;
  transition: background 0.2s, color 0.2s;
}

.tile-media .icon {
  width: 22px;
  height: 22px;
}

/* Service illustration (the little logo for each service) */
.tile.has-illustration .tile-media {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.service-icon {
  width: 52px;
  height: 52px;
}

.tile.has-illustration:hover .service-icon {
  animation: iconWiggle 0.5s var(--ease-out);
}

@keyframes iconWiggle {
  0%, 100% { transform: rotate(0); }
  30%      { transform: rotate(-6deg); }
  65%      { transform: rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
  .tile.has-illustration:hover .service-icon { animation: none; }
}

/* With a real photo, the picture spans the top of the card */
.tile.has-photo .tile-media {
  width: auto;
  height: auto;
  aspect-ratio: 16 / 10;
  margin: -16px -16px 0;
  border-radius: 16px 16px 0 0;
}

.tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-body {
  flex: 1;
  min-width: 0;
}

.tile-body h3 {
  margin: 0 0 4px;
  text-wrap: pretty;
  font-family: var(--font-sans);
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--brown);
}

.tile-body p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.tile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* A narrow card (e.g. 3 per row on a smaller laptop): quantity and button
   stack as two tidy full-width rows instead of wrapping unevenly */
@container (max-width: 236px) {
  .tile-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tile-actions .qty {
    grid-template-columns: 38px 1fr 38px;
    margin-right: 0;
  }

  .tile-actions .tile-add {
    width: 100%;
  }
}

/* Phones: one card per row, so the icon can sit beside the text again */
@media (max-width: 560px) {
  .tile {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
      "media body"
      "actions actions";
    column-gap: 14px;
  }

  .tile.has-illustration {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .tile-media { grid-area: media; }
  .tile-body { grid-area: body; }
  .tile-actions { grid-area: actions; }

  /* Full-width phone cards have room for larger tap targets */
  .tile-actions .qty {
    grid-template-columns: 42px auto 42px;
    height: 44px;
  }

  .tile-actions .qty button {
    width: 42px;
    height: 42px;
  }

  .tile-actions .tile-add {
    min-width: 104px;
    height: 44px;
    padding: 0 18px;
  }

  .tile.has-photo {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .tile.has-photo .tile-media {
    width: 72px;
    height: 72px;
    aspect-ratio: auto;
    margin: 0;
    border-radius: 12px;
  }
}

.tile-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid var(--olive);
  border-radius: 999px;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--olive);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tile-add .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.tile-add:hover {
  background: var(--tint);
}

.tile-add[aria-pressed="true"] {
  background: var(--olive);
  color: var(--white);
}

/* Selected card */
.tile.is-selected {
  border-color: var(--olive);
  box-shadow: 0 0 0 1px var(--olive);
  background: #FDFCF8;
}

.tile.is-selected .tile-media {
  background: var(--olive);
  color: var(--cream);
}

/* Illustrations keep their colours when selected: warmer tile + olive ring */
.tile.is-selected.has-illustration .tile-media {
  background: #ECE6D3;
  box-shadow: inset 0 0 0 2px var(--olive);
}

/* Quantity: [−] 120 pcs [+] */
.qty {
  display: inline-grid;
  grid-template-columns: 34px auto 34px;
  align-items: center;
  height: 38px;
  margin-right: auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--field-bg);
}

.qty[hidden] {
  display: none;
}

.qty button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 1.2rem;
  color: var(--brown);
  cursor: pointer;
}

.qty button:hover {
  background: var(--tint);
}

.qty-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  padding: 0 2px;
}

.qty input {
  width: 34px;
  border: 0;
  background: none;
  text-align: right;
  font-size: 1rem;
  font-weight: 600;
  color: var(--brown);
  -moz-appearance: textfield;
}

.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.qty input:focus {
  outline: none;
}

.qty:focus-within {
  border-color: var(--olive);
}

.qty-unit {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* Previous / next category: one slim row under a divider, side by side on every screen */
.menu-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 50%;
  min-height: 52px;
  padding: 6px 8px;
  margin: -6px -8px;  /* the hover background extends a little beyond the text */
  border: 0;
  border-radius: 14px;
  background: none;
  text-align: left;
  color: var(--brown);
  cursor: pointer;
  transition: background 0.2s;
}

.pager-btn[hidden] {
  display: none;
}

.pager-btn:hover {
  background: rgba(255, 253, 249, 0.8);
}

/* Small round arrow */
.pager-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--olive);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.pager-btn:hover .pager-arrow {
  border-color: var(--olive);
  background: var(--olive);
  color: var(--white);
}

.pager-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pager-text small {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* Long category names shorten with "…" instead of wrapping */
.pager-name {
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pager-next {
  margin-left: auto;
  text-align: right;
}

.pager-next .pager-text {
  align-items: flex-end;
}

/* Last category: the real next step, shown as a primary button */
.pager-btn.is-cta {
  max-width: none;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  margin: 0 0 0 auto;
  border-radius: 999px;
  background: var(--olive);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
}

.pager-btn.is-cta:hover {
  background: var(--brown);
}

.pager-btn.is-cta {
  flex: none;
  white-space: nowrap;
}

.cta-short {
  display: none;
}

/* Narrow phones: a shorter label keeps the button on one line */
@media (max-width: 480px) {
  .cta-long { display: none; }
  .cta-short { display: inline; }
}

/* ---------- Floating cart button ---------- */
.cart-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 45;
  display: none;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: var(--brown);
  color: var(--cream);
  box-shadow: 0 14px 30px -10px rgba(47, 38, 21, 0.55);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), background 0.2s;
}

/* The cart is part of step 1 (choosing services) */
body[data-step="1"] .cart-fab {
  display: grid;
}

.cart-fab:hover {
  background: #5c4419;
  transform: translateY(-2px);
}

.cart-fab:focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 3px;
}

.cart-fab-icon {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Number dot on the top-right of the cart */
.cart-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: var(--sage);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.cart-badge[hidden] {
  display: none;
}

/* A little bounce when something is added or removed */
.cart-fab.is-bumping {
  animation: cartBump 0.45s var(--ease-out);
}

@keyframes cartBump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ---------- Cart drawer (slides in from the right) ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(47, 38, 21, 0.4);
  animation: fadeIn 0.25s both;
}

.sheet-backdrop[hidden],
.sheet[hidden] {
  display: none;
}

.sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  background: var(--white);
  box-shadow: -24px 0 60px -24px rgba(47, 38, 21, 0.5);
  animation: drawerIn 0.32s var(--ease-out) both;
}

/* Closing plays the slide in reverse before the drawer is hidden */
.sheet.is-closing {
  animation: drawerOut 0.24s ease-in both;
}

.sheet-backdrop.is-closing {
  animation: fadeOut 0.24s ease-in both;
}

@keyframes drawerIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes drawerOut {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.sheet-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 1.45rem;
  outline: none;
}

.sheet-count {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--paper-deep);
  font-size: 0.8rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.sheet-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--brown);
  cursor: pointer;
}

.sheet-close:hover {
  background: var(--paper);
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px;
}

/* Empty cart */
.sheet-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 8px;
  text-align: center;
}

.sheet-empty[hidden] {
  display: none;
}

.sheet-empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--olive);
}

.sheet-empty-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sheet-empty p {
  margin: 0;
  color: var(--ink-soft);
}

.sheet-empty strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.05rem;
  color: var(--brown);
}

/* Cart items */
.sheet-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sheet-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.sheet-item:last-child {
  border-bottom: 0;
}

.sheet-item-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--tint);
  color: var(--olive);
}

.sheet-item-icon .icon {
  width: 20px;
  height: 20px;
}

.sheet-item-icon .service-icon {
  width: 34px;
  height: 34px;
}

.sheet-item-name {
  font-weight: 600;
  line-height: 1.35;
  color: var(--brown);
}

.sheet-item-name small {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink-soft);
}

.sheet-item .qty {
  grid-column: 2 / -1;
  justify-self: start;
}

.sheet-remove {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}

.sheet-remove .icon {
  width: 19px;
  height: 19px;
}

.sheet-remove:hover {
  background: #f6e7e2;
  color: #8c3a26;
}

/* Footer: note + checkout */
.sheet-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 24px max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--white);
}

.sheet-note {
  display: flex;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.sheet-note svg {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  fill: none;
  stroke: var(--olive);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.sheet-checkout {
  width: 100%;
  gap: 10px;
}

.sheet-checkout[disabled] {
  opacity: 0.45;
}

.sheet-keep {
  align-self: center;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .sheet-head,
  .sheet-body,
  .sheet-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .cart-fab {
    width: 60px;
    height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet,
  .sheet.is-closing,
  .sheet-backdrop,
  .cart-fab.is-bumping {
    animation: none;
  }
}

/* ==========================================================================
   Step 2 — details
   Form (three numbered sections) on the left, services summary on the right.
   ========================================================================== */
.details-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: clamp(20px, 3vw, 36px);
}

@media (max-width: 960px) {
  .details-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  /* On smaller screens the summary sits above the form */
  .details-summary {
    order: -1;
  }
}

.form-section {
  margin-bottom: 16px;
  padding: clamp(20px, 3.5vw, 32px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
}

/* Section header: number badge + title + one-line description */
.section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--tint);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--olive);
}

.section-head h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 2px;
  font-size: 1.2rem;
}

.section-head p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* Fields */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 18px;
}

.span-2 {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }
}

.form-section > .field {
  margin-bottom: 20px;
}

.form-section > .field:last-child {
  margin-bottom: 0;
}

.details-form .field {
  gap: 7px;
}

/* Field titles only (not the tile/segment labels inside a field) */
.details-form .field > label,
.label-like {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--brown);
}

.optional {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--paper-deep);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.field-hint {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

/* Inputs: soft fill, clear focus (16px text also stops phones from zooming in) */
.details-form .field input,
.details-form .field textarea {
  min-height: 50px;
  border-color: var(--line-strong);
  border-radius: 12px;
  background: var(--field-bg);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.details-form .field input::placeholder,
.details-form .field textarea::placeholder {
  color: #A79A86;
}

.details-form .field input:hover,
.details-form .field textarea:hover {
  border-color: rgba(76, 55, 19, 0.45);
}

.details-form .field input:focus,
.details-form .field textarea:focus {
  background: var(--white);
}

.details-form .field textarea {
  min-height: 120px;
  line-height: 1.5;
}

/* Input with a small icon on the left */
.input-icon {
  position: relative;
}

.input-icon .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--sage);
  transform: translateY(-50%);
  pointer-events: none;
  transition: color 0.2s;
}

.details-form .input-icon input {
  padding-left: 42px;
}

.input-icon:focus-within .icon {
  color: var(--olive);
}

/* Event type list: tiles with an icon */
.type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 700px) {
  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.type-tile {
  position: relative;
  display: block;
  cursor: pointer;
}

.type-tile input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.type-tile > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 86px;
  padding: 12px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--field-bg);
  text-align: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.type-tile .icon {
  width: 24px;
  height: 24px;
  color: var(--olive);
}

.type-name {
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--brown);
}

.type-tile:hover > span {
  border-color: var(--olive);
  background: var(--white);
}

.type-tile input:checked + span {
  border-color: var(--olive);
  background: var(--olive);
  box-shadow: 0 6px 16px -10px rgba(76, 55, 19, 0.6);
}

.type-tile input:checked + span .icon,
.type-tile input:checked + span .type-name {
  color: var(--white);
}

.type-tile input:focus-visible + span {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
}

.field.has-error .type-tile > span {
  border-color: #9a3b2a;
}

/* Phones: compact tiles with the icon beside the name */
@media (max-width: 700px) {
  .type-tile > span {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    min-height: 54px;
    padding: 8px 12px;
    text-align: left;
  }

  .type-tile .icon {
    flex: none;
    width: 20px;
    height: 20px;
  }
}

/* "Other" occasion box, shown under the tiles */
.other-field {
  padding: 16px;
  border-radius: 14px;
  background: var(--tint);
  animation: otherIn 0.25s var(--ease-out);
}

.other-field[hidden] {
  display: none;
}

@keyframes otherIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* Best way to reach you: segmented control */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--field-bg);
}

.segment {
  position: relative;
  display: block;
  cursor: pointer;
}

.segment input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.segment .icon {
  width: 17px;
  height: 17px;
}

.segment:hover span {
  color: var(--brown);
}

.segment input:checked + span {
  background: var(--white);
  color: var(--brown);
  box-shadow: 0 1px 2px rgba(76, 55, 19, 0.12), 0 4px 12px -6px rgba(76, 55, 19, 0.35);
}

.segment input:checked + span .icon {
  color: var(--olive);
}

.segment input:focus-visible + span {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

/* Services summary card */
.details-summary {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

@media (max-width: 960px) {
  .details-summary {
    position: static;
    margin-bottom: 16px;
  }
}

.summary-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.summary-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.summary-edit {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brown);
  cursor: pointer;
}

.summary-edit:hover {
  border-color: var(--olive);
}

.summary-list {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.summary-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.summary-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--tint);
  color: var(--olive);
}

.summary-icon .service-icon {
  width: 32px;
  height: 32px;
}

.summary-icon .icon {
  width: 18px;
  height: 18px;
}

.summary-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--brown);
}

.summary-name small {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-soft);
}

.summary-note {
  display: flex;
  gap: 8px;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.summary-note svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  fill: none;
  stroke: var(--olive);
  stroke-width: 1.7;
  stroke-linecap: round;
}

/* Phones: the summary becomes a compact strip of service names */
@media (max-width: 600px) {
  .summary-card {
    padding: 16px 18px;
  }

  .summary-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }

  .summary-list li {
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--field-bg);
  }

  .summary-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
  }

  .summary-icon .service-icon {
    width: 24px;
    height: 24px;
  }

  .summary-name {
    font-size: 0.82rem;
  }

  .summary-name small {
    display: none;
  }
}

/* Back / next: same quiet style as the category navigation */
.step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 clamp(40px, 8vw, 72px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.step-actions .btn-primary {
  gap: 10px;
  padding: 0 26px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 4px 12px 4px 4px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brown);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-back:hover {
  background: rgba(255, 253, 249, 0.8);
}

.btn-back:hover .pager-arrow {
  border-color: var(--olive);
  background: var(--olive);
  color: var(--white);
}

@media (max-width: 520px) {
  .step-actions .btn-primary {
    flex: 1;
    max-width: 260px;
    padding: 0 18px;
  }
}

/* ==========================================================================
   Step 3 — review
   ========================================================================== */
.review {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.review-block {
  padding: clamp(20px, 4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
}

.review-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.review-block h2 {
  margin: 0;
  font-size: 1.15rem;
}

.review-edit {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brown);
  cursor: pointer;
}

.review-edit:hover {
  border-color: var(--olive);
}

.review-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 16px;
  margin: 0;
}

.review-list dt {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.review-list dd {
  margin: 0;
  font-weight: 500;
  color: var(--brown);
  overflow-wrap: break-word;
}

@media (max-width: 560px) {
  .review-list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .review-list dt {
    font-size: 0.8rem;
  }

  .review-list dd {
    margin-bottom: 12px;
  }
}

.review-services {
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-services li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.review-services li:last-child {
  border-bottom: 0;
}

.review-services strong {
  font-weight: 600;
  color: var(--brown);
}

.review-services small {
  display: block;
  color: var(--ink-soft);
}

.review-qty {
  flex: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--olive);
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  font-size: 0.95rem;
  cursor: pointer;
}

.consent input {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  accent-color: var(--olive);
}

/* ==========================================================================
   Confirmation
   ========================================================================== */
.confirmation .page {
  padding-top: clamp(32px, 7vw, 72px);
  padding-bottom: clamp(40px, 8vw, 80px);
}

.confirmation-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(28px, 6vw, 48px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  text-align: center;
}

.confirmation-check {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--olive);
  color: var(--cream);
}

.confirmation-check svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirmation h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 4.6vw, 2.6rem);
  outline: none;
}

.confirmation-card > p {
  max-width: 46ch;
  color: var(--ink-soft);
}

.reference {
  margin: 6px 0 26px;
  padding: 14px 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--field-bg);
}

.reference strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--brown);
}

.confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

@media (max-width: 520px) {
  .confirmation-actions .btn {
    width: 100%;
  }
}

.prototype-note {
  margin: 20px 0 0;
  font-size: 0.8rem;
  text-align: center;
  color: var(--ink-soft);
}

/* Print fallback when the PDF library is unavailable */
@media print {
  .order-header,
  .cart-fab,
  .confirmation-actions,
  #newRequestBtn {
    display: none !important;
  }
}
