/* =========================================================
   The Doting Baker — menu, order and confirmation pages
   ========================================================= */

[hidden] { display: none !important; }
.nav__menu a[aria-current="page"]:not(.btn)::after { transform: scaleX(1); }
.muted { color: var(--muted); }
.link { padding: 0; border: 0; background: none; font: inherit; color: var(--plum); text-decoration: underline; cursor: pointer; }

.shop-page { padding-bottom: 90px; }

.shop-head {
  padding: calc(var(--nav-h) + 56px) 0 40px;
  margin-bottom: 40px;
  text-align: center;
  background:
    radial-gradient(circle at 85% 0%, rgba(199, 162, 107, 0.14), transparent 40%),
    var(--lavender);
}
.shop-head__title { font-size: clamp(2.3rem, 5vw, 3.6rem); color: var(--plum-deep); margin-bottom: 14px; }
.shop-head__title em { color: var(--plum-soft); }
.shop-head__lead { max-width: 620px; margin: 0 auto; color: var(--muted); }

.notice {
  margin-bottom: 24px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--lavender);
  color: var(--plum-deep);
  font-size: 0.95rem;
}
.notice--warn { background: #fbf2e3; color: #6d4c12; }
.notice--info { background: #eef4fb; color: #1f4a73; }

/* ---------- Order layout ---------- */
.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
}

.step {
  padding: 28px;
  margin-bottom: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: opacity 0.3s;
}
.step.is-locked { opacity: 0.5; }
.step.is-locked .checkout-form, .step.is-locked .slots { pointer-events: none; }
.step__head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.step__head h2 { font-size: 1.7rem; color: var(--plum-deep); }
.step__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--plum);
  color: var(--white);
  font-weight: 600;
}
.step__sub { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Calendar ---------- */
.calendar { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.calendar__loading, .calendar__empty { grid-column: 1 / -1; color: var(--muted); }
.calendar__empty { margin: 0; padding: 14px 16px; background: var(--lavender); border-radius: var(--radius-sm); }
.cal-month__name { margin: 0 0 10px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--plum-deep); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-bottom: 4px; }
.cal-day {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1;
}
.cal-day small { position: absolute; bottom: 3px; font-size: 0.55rem; letter-spacing: 0.04em; text-transform: uppercase; }
.cal-day--blank { visibility: hidden; }
.cal-day--closed { color: #c4bccb; }
.cal-day--booked { color: #a68a5b; background: #fbf4e8; }
.cal-day--open {
  background: var(--lavender);
  color: var(--plum-deep);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.cal-day--open:hover { border-color: var(--plum-soft); }
.cal-day--open:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.cal-day.is-selected { background: var(--plum); color: var(--white); border-color: var(--plum); }
.cal-day.is-today::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

.legend { display: flex; flex-wrap: wrap; gap: 18px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 0.82rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend__dot { width: 12px; height: 12px; border-radius: 4px; }
.legend__dot--open { background: var(--lavender); border: 1.5px solid var(--lavender-2); }
.legend__dot--booked { background: #fbf4e8; border: 1.5px solid #ecdcc0; }
.legend__dot--closed { background: var(--white); border: 1.5px solid var(--line); }

/* ---------- Day items ---------- */
.day-items { display: grid; gap: 16px; }
.day-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.day-item.is-soldout { opacity: 0.6; }
.day-item__media { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--lavender); }
.day-item__media img, .day-item__ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.day-item__ph--salted-caramel-entremet { background: linear-gradient(160deg, #f3dcc0, #d9a46b 55%, #a8683a); }
.day-item__ph--double-chocolate-cookie { background: linear-gradient(160deg, #8a5a44, #5b3326 55%, #2f1912); }
.badge--soldout {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--plum-deep); color: var(--white);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.day-item__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.day-item__top h3 { font-size: 1.45rem; color: var(--plum-deep); }
.day-item__price { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--plum-deep); white-space: nowrap; }
.day-item__unit { margin: 2px 0 10px; font-size: 0.85rem; color: var(--muted); }
.day-item__stock { margin: -4px 0 10px; font-size: 0.82rem; font-weight: 600; color: #a0611a; }
.day-item .sizes { margin: 0 0 12px; }
.qty-row { display: flex; align-items: center; gap: 12px; }
.qty-row .qty button { width: 36px; height: 36px; font-size: 1.1rem; }
.qty-row .qty span { min-width: 28px; font-size: 1rem; }

/* ---------- Slots ---------- */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.slot { position: relative; cursor: pointer; }
.slot input { position: absolute; opacity: 0; }
.slot span {
  display: block;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 500;
  color: var(--plum-deep);
  transition: border-color 0.2s, background 0.2s;
}
.slot:hover span { border-color: var(--lavender-2); }
.slot input:checked + span { border-color: var(--plum); background: var(--lavender); }
.slot input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Checkout form ---------- */
.checkout-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--plum-deep); }
.field small { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.field input, .field textarea, .phone-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: #fdfcfe;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .phone-input:focus-within {
  outline: none;
  border-color: var(--plum-soft);
  box-shadow: 0 0 0 4px rgba(109, 69, 144, 0.14);
}
.phone-input { display: flex; align-items: center; gap: 8px; padding: 0 0 0 14px; }
.phone-input > span { color: var(--muted); font-weight: 500; }
.phone-input input { border: 0; padding: 12px 14px 12px 0; background: transparent; box-shadow: none !important; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.has-error input, .has-error textarea, .has-error .phone-input { border-color: #b3261e; }
.policy.has-error { border-color: #b3261e; }

.policy {
  padding: 18px 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fdfbfe;
}
.policy__title { margin: 0 0 8px; font-weight: 600; color: var(--plum-deep); }
.policy ul { margin: 0 0 14px; padding-left: 1.2em; color: #4a4252; font-size: 0.94rem; }
.policy li { margin-bottom: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 0.95rem; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--plum); flex: none; }
.check--muted { color: var(--muted); font-size: 0.9rem; }
.privacy-note { margin: 0; font-size: 0.82rem; color: var(--muted); }

/* ---------- Summary ---------- */
.summary {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  padding: 26px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.summary__title { font-size: 1.7rem; color: var(--plum-deep); margin-bottom: 16px; }
.summary__meta { margin: 0 0 16px; display: grid; gap: 6px; }
.summary__meta div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; }
.summary__meta dt { color: var(--muted); }
.summary__meta dd { margin: 0; font-weight: 500; text-align: right; }
.summary__items { padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.summary__items .muted { margin: 0; }
.sum-line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.sum-line small { color: var(--muted); }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0; }
.summary__total span { font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.summary__total strong { font-family: var(--font-display); font-size: 2rem; color: var(--plum-deep); }
.summary__error { margin: 0 0 12px; min-height: 0; font-size: 0.9rem; color: #b3261e; }
.summary__error:empty { display: none; }
.summary__pay { width: 100%; }
.summary__secure { margin: 12px 0 0; text-align: center; font-size: 0.8rem; color: var(--muted); }

/* ---------- Menu page ---------- */
.menu-list { display: grid; gap: 32px; }
.menu-item {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 40px;
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.menu-item--skeleton { min-height: 360px; background: linear-gradient(100deg, var(--lavender) 30%, #faf6fc 50%, var(--lavender) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border: 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.menu-item__media { aspect-ratio: 4 / 3.4; border-radius: var(--radius); overflow: hidden; background: var(--lavender); }
.menu-item__media img, .menu-item__ph { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; }
.menu-item__ph span { font-family: var(--font-display); font-size: 2rem; font-style: italic; color: rgba(255,255,255,0.95); text-align: center; padding: 0 20px; }
.menu-item__ph--salted-caramel-entremet { background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.45), transparent 45%), linear-gradient(160deg, #f3dcc0, #d9a46b 55%, #a8683a); }
.menu-item__ph--double-chocolate-cookie { background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.18), transparent 45%), linear-gradient(160deg, #8a5a44, #5b3326 55%, #2f1912); }
.menu-item__ph:not([class*="--"]) { background: linear-gradient(150deg, var(--lavender), var(--blush)); }
.menu-item__unit { margin: 0 0 6px; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--plum-soft); }
.menu-item__name { font-size: 2.3rem; color: var(--plum-deep); margin-bottom: 10px; }
.menu-item__desc { margin: 0 0 18px; color: #4a4252; }
.menu-item__price { margin: 0 0 18px; font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; color: var(--plum-deep); }
.menu-sizes { width: 100%; margin-bottom: 18px; border-collapse: collapse; font-size: 0.95rem; }
.menu-sizes th, .menu-sizes td { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left; }
.menu-sizes th { font-size: 0.74rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.menu-sizes .num { text-align: right; font-weight: 600; color: var(--plum-deep); }
.menu-facts { display: grid; gap: 8px; margin: 0 0 20px; font-size: 0.92rem; }
.menu-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.menu-facts dt { color: var(--muted); }
.menu-facts dd { margin: 0; color: #4a4252; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { padding: 2px 10px; border-radius: 999px; background: #e6f4ec; color: #2e7d4f; font-size: 0.8rem; font-weight: 500; }
.menu-dates { margin-bottom: 22px; }
.menu-dates__label { margin: 0 0 8px; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--plum-deep); }
.menu-dates ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.menu-dates li { padding: 4px 10px; border-radius: 8px; background: var(--lavender); font-size: 0.82rem; color: var(--plum-deep); }
.menu-dates li.more { background: none; color: var(--muted); }
.menu-dates .muted { margin: 0; font-size: 0.9rem; }
.btn.is-disabled { opacity: 0.45; pointer-events: none; }
.menu-empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Confirmation ---------- */
.confirm { max-width: 680px; padding-top: calc(var(--nav-h) + 48px); }
.confirm__card {
  padding: 40px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}
.confirm__card h1 { font-size: 2.4rem; color: var(--plum-deep); margin-bottom: 10px; }
.confirm__loading { display: grid; justify-items: center; gap: 14px; padding: 30px 0; color: var(--muted); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--lavender-2); border-top-color: var(--plum); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.confirm__head { text-align: center; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.confirm__tick { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 50%; background: #e6f4ec; color: #2e7d4f; font-size: 1.6rem; }
.confirm__no { margin: 0; color: var(--muted); }
.confirm__no strong { color: var(--plum-deep); font-size: 1.1rem; letter-spacing: 0.04em; }
.confirm__section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.confirm__section h2 { font-size: 1.4rem; color: var(--plum-deep); margin-bottom: 12px; }
.confirm__dl { display: grid; gap: 8px; margin: 0 0 12px; }
.confirm__dl div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.confirm__dl dt { color: var(--muted); }
.confirm__dl dd { margin: 0; font-weight: 500; }
.confirm__note { margin: 6px 0 0; font-size: 0.9rem; color: #4a4252; }
.confirm__table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.confirm__table td, .confirm__table th { padding: 6px 0; text-align: left; }
.confirm__table .num { text-align: right; }
.confirm__table tfoot th { padding-top: 12px; border-top: 1px solid var(--line); font-size: 1.05rem; color: var(--plum-deep); }
.confirm__save { margin: 22px 0; font-size: 0.92rem; color: #4a4252; }
.confirm__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn--ghost { background: var(--white); border-color: var(--line); color: var(--plum-deep); }
.btn--ghost:hover { background: var(--lavender); }

/* ---------- Legal ---------- */
.legal { max-width: 760px; padding-top: calc(var(--nav-h) + 48px); }
.legal h1 { font-size: clamp(2.3rem, 5vw, 3.2rem); color: var(--plum-deep); margin-bottom: 24px; }

/* ---------- Home: upcoming days ---------- */
.upcoming { padding: 90px 0; }
.upcoming__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.upcoming-day {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.upcoming-day:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.upcoming-day__dow { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--plum-soft); }
.upcoming-day__date { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--plum-deep); margin-bottom: 10px; }
.upcoming-day ul { margin: 0 0 12px; padding: 0; list-style: none; font-size: 0.9rem; color: #4a4252; }
.upcoming-day li { padding: 2px 0; }
.upcoming-day li.is-soldout { color: var(--muted); text-decoration: line-through; }
.upcoming-day__cta { margin-top: auto; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--plum); }
.upcoming__empty { color: var(--muted); text-align: center; }
.upcoming__foot { margin-top: 28px; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .order-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .menu-item { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 600px) {
  .step { padding: 20px 16px; }
  .day-item { grid-template-columns: 96px 1fr; gap: 14px; padding: 12px; }
  .day-item__top { flex-direction: column; gap: 2px; }
  .field-row { grid-template-columns: 1fr; }
  .menu-item { padding: 18px; }
  .menu-item__name { font-size: 1.9rem; }
  .menu-facts div { grid-template-columns: 1fr; gap: 2px; }
  .confirm__card { padding: 26px 20px; }
}

@media print {
  .nav, .footer, .confirm__actions { display: none !important; }
  .confirm { padding-top: 0; }
  .confirm__card { border: 0; box-shadow: none; }
}
