/* Ordering / checkout / reservation styles.
   Loaded only on /bestellung and /reservierung via {% block page_css %}.
   Global cart badge + add-button styles live in cart-ui.css. */

/* ===== Checkout (/bestellung) ================================== */

.order-page main {
  padding-bottom: 4rem;
}

.checkout {
  max-width: 880px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.checkout__head {
  margin-bottom: 1.5rem;
}

.checkout__title {
  font-size: 2rem;
  margin: 0.5rem 0;
}

.checkout__lead {
  color: var(--color-muted);
  max-width: 56ch;
}

.checkout__notice {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  text-align: center;
}

.checkout__success {
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, #f7fff0, #fff);
  border: 2px solid var(--color-cardamom);
  border-radius: var(--radius-lg);
}

.checkout__success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-cardamom);
  color: #fff;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.checkout__success-code {
  font-family: var(--font-display);
  font-size: 4rem;
  letter-spacing: 0.4rem;
  margin: 1rem 0;
  color: var(--color-masala);
}

.checkout__success-total {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.checkout__success-hint {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.checkout__empty,
.checkout__cart,
.checkout__form {
  margin-top: 1.5rem;
}

.checkout__validation {
  margin: 0 0 1rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th,
.cart-table td {
  padding: 0.6rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.cart-table tfoot th,
.cart-table tfoot td {
  border-bottom: none;
  border-top: 2px solid var(--color-border);
  font-weight: 700;
  padding-top: 0.85rem;
}

.cart-row__name {
  width: 45%;
}

.cart-row__qty,
.cart-row__price,
.cart-row__line,
.cart-row__remove {
  white-space: nowrap;
}

.cart-row__variant {
  color: var(--color-muted);
  font-weight: normal;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0 4px;
}

.qty-control__btn {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  color: var(--color-masala);
}

.qty-control__value {
  min-width: 1.4rem;
  text-align: center;
}

.cart-row__remove-btn {
  border: 0;
  background: transparent;
  color: var(--color-chili);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
}

.checkout__add-more {
  margin-top: 1rem;
  text-align: right;
}

.checkout__fieldset {
  margin: 1.5rem 0 0;
  padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.checkout__fieldset legend {
  padding: 0 0.5rem;
  font-weight: 700;
  color: var(--color-masala);
}

.form-row {
  display: flex;
  flex-direction: column;
  margin: 0.6rem 0;
}

.form-row--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-row label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.form-row input,
.form-row select {
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-size: 1rem;
  background: var(--color-rice);
  width: 100%;
  box-sizing: border-box;
}

.form-row--split>div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.form-hint {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.payment-option {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin: 0.5rem 0;
  cursor: pointer;
}

.payment-option:hover {
  background: var(--color-cream);
}

.payment-option.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.payment-option--disabled {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-muted);
  cursor: not-allowed;
}

.payment-option__title {
  display: block;
  font-weight: 700;
}

.payment-option__hint {
  display: block;
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.checkout__threshold-notice {
  background: #fff5e3;
  border: 1px solid #f2aa2f;
  color: #5a3700;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin: 0 0 1rem;
}

.checkout__cash-section,
.checkout__paypal-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--color-border);
}

.checkout__paypal {
  min-height: 60px;
  margin-bottom: 0.5rem;
}

.checkout-status {
  margin: 0.75rem 0 0;
  min-height: 1.2em;
  font-weight: 600;
}

.checkout-status--error {
  color: var(--color-chili);
}

.checkout-status--info {
  color: var(--color-muted);
  font-weight: 500;
}

.btn--sm {
  min-height: 36px;
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
}

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

@media (max-width: 720px) {
  .checkout {
    padding: 1.25rem;
    margin: 1rem auto;
  }

  .cart-table thead {
    display: none;
  }

  .cart-table,
  .cart-table tbody,
  .cart-table tr,
  .cart-table td {
    display: block;
    width: 100%;
  }

  .cart-table tbody tr {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .cart-table tbody td {
    border: 0;
    padding: 0.25rem 0;
    display: flex;
    justify-content: space-between;
  }

  .cart-row__name {
    width: auto;
    font-weight: 700;
  }

  .form-row--split {
    grid-template-columns: 1fr;
  }
}

/* ============ Reservation page ============ */
.reservation {
  max-width: 720px;
  margin: 0 auto 3rem;
}

.reservation__head {
  margin: 1.5rem 0 1rem;
}

.reservation__title {
  font-size: 1.8rem;
  margin: 0.25rem 0;
}

.reservation__lead {
  color: var(--color-muted);
}

.reservation__errors {
  background: #fde7e7;
  border: 1px solid #f1a4a4;
  color: #7a1717;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin: 1rem 0;
}

.reservation__errors ul {
  margin: 0.25rem 0 0 1.2rem;
}

.reservation__notice {
  background: #fff5e3;
  border: 1px solid #f2c87a;
  color: #6c4500;
  padding: 1rem;
  border-radius: var(--radius-md);
}

.reservation__success {
  background: #ecf7e3;
  border: 1px solid #a3c98b;
  color: #2e5a18;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.reservation__success-icon {
  font-size: 2rem;
  background: #fff;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  line-height: 3rem;
  margin: 0 auto 0.5rem;
}

.reservation__success-title {
  margin: 0.25rem 0 0.5rem;
}

.reservation__form {
  background: #fff;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.reservation__fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}

.reservation__fieldset legend {
  font-weight: 700;
  color: var(--color-masala);
  padding: 0;
  margin-bottom: 0.25rem;
}

.reservation__fieldset textarea {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-rice);
  font: inherit;
}

.reservation__consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  background: #fff8e8;
  padding: 0.75rem 1rem;
  border-radius: 8px;
}

.reservation__consent input {
  margin-top: 0.25rem;
}

.reservation__actions {
  margin: 1rem 0;
}

.reservation__hint {
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* ============ Reservation calendar + slot picker ============ */
.resv-picker {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1.1fr);
  gap: 1.25rem;
  margin: 0.5rem 0 1rem;
}

@media (max-width: 720px) {
  .resv-picker {
    grid-template-columns: 1fr;
  }
}

.resv-picker__calendar,
.resv-picker__slots {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Calendar */
.resv-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.resv-cal__title {
  font-weight: 700;
  color: var(--color-masala);
  font-size: 1.05rem;
}

.resv-cal__nav {
  border: 1px solid var(--color-border);
  background: #fff;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-masala);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.resv-cal__nav:hover:not(:disabled) {
  background: var(--color-cream);
  border-color: var(--color-saffron);
}

.resv-cal__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.resv-cal__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  font-size: 0.75rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  margin-bottom: 0.35rem;
}

.resv-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.resv-cal__cell {
  appearance: none;
  border: 1px solid transparent;
  background: var(--color-rice, #fdfaf2);
  color: var(--color-masala);
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
  position: relative;
}

.resv-cal__cell:hover:not(:disabled) {
  background: #fff7e9;
  border-color: var(--color-saffron);
  transform: translateY(-1px);
}

.resv-cal__cell:focus-visible {
  outline: 2px solid var(--color-saffron);
  outline-offset: 2px;
}

.resv-cal__cell--blank {
  background: transparent;
  border: 0;
  cursor: default;
}

.resv-cal__cell--today {
  border-color: var(--color-saffron);
}

.resv-cal__cell--today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-saffron);
}

.resv-cal__cell--past,
.resv-cal__cell--closed {
  background: transparent;
  color: #bcb3a4;
  cursor: not-allowed;
  text-decoration: line-through;
  font-weight: 400;
}

.resv-cal__cell--closed:not(.resv-cal__cell--past) {
  background: repeating-linear-gradient(135deg,
      transparent 0 6px,
      rgba(0, 0, 0, 0.04) 6px 8px);
}

.resv-cal__cell--selected,
.resv-cal__cell--selected:hover {
  background: var(--color-chili, #c65a1f);
  border-color: var(--color-chili, #c65a1f);
  color: #fff;
  transform: none;
}

.resv-cal__cell--selected.resv-cal__cell--today::after {
  background: #fff;
}

.resv-cal__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--color-muted);
  margin: 0.8rem 0 0;
}

.resv-cal__dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  margin-right: 0.25rem;
  vertical-align: middle;
  border: 1px solid var(--color-border);
}

.resv-cal__dot--available {
  background: var(--color-rice, #fdfaf2);
  border-color: var(--color-saffron);
}

.resv-cal__dot--closed {
  background: repeating-linear-gradient(135deg, #f6f1e6 0 4px, #eee4cf 4px 6px);
}

.resv-cal__dot--selected {
  background: var(--color-chili, #c65a1f);
  border-color: var(--color-chili, #c65a1f);
}

/* Slots */
.resv-picker__slots {
  display: flex;
  flex-direction: column;
}

.resv-slots__placeholder {
  color: var(--color-muted);
  margin: auto 0;
  text-align: center;
  font-style: italic;
}

.resv-slots__title {
  font-weight: 600;
  color: var(--color-masala);
  margin: 0 0 0.5rem;
}

.resv-slots__window+.resv-slots__window {
  margin-top: 0.9rem;
}

.resv-slots__window-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.4rem;
}

.resv-slots__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 0.4rem;
}

.resv-slot {
  appearance: none;
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 0.4rem;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-masala);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.resv-slot:hover:not(:disabled) {
  background: #fff7e9;
  border-color: var(--color-saffron);
  transform: translateY(-1px);
}

.resv-slot:focus-visible {
  outline: 2px solid var(--color-saffron);
  outline-offset: 2px;
}

.resv-slot--selected,
.resv-slot--selected:hover {
  background: var(--color-chili, #c65a1f);
  border-color: var(--color-chili, #c65a1f);
  color: #fff;
  transform: none;
}

.resv-slot--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Submit-blocked attention flash */
.resv-needs-attention {
  animation: resv-attention 0.6s ease;
}

@keyframes resv-attention {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(198, 90, 31, 0);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(198, 90, 31, 0.35);
  }
}
/* ===== Checkout stepper ====================================== */

.checkout-stepper {
  margin: 1.5rem 0 0.5rem;
}

.checkout-stepper__list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  counter-reset: none;
}

.checkout-stepper__step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  position: relative;
  font-size: 0.88rem;
  color: var(--color-muted);
  font-weight: 500;
}

/* connector line between steps */
.checkout-stepper__step + .checkout-stepper__step::before {
  content: '';
  display: block;
  height: 2px;
  width: 1.5rem;
  flex-shrink: 0;
  background: var(--color-border);
  margin-right: 0.5rem;
  border-radius: 1px;
}

.checkout-stepper__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.checkout-stepper__step.is-active {
  color: var(--color-masala);
  font-weight: 700;
}

.checkout-stepper__step.is-active .checkout-stepper__num {
  background: var(--color-saffron);
  border-color: var(--color-saffron);
  color: #fff;
}

.checkout-stepper__step.is-done {
  color: var(--color-cardamom);
}

.checkout-stepper__step.is-done .checkout-stepper__num {
  background: var(--color-cardamom);
  border-color: var(--color-cardamom);
  color: #fff;
}

/* ===== Checkout step navigation ============================== */

.checkout-step__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

/* ===== Payment choice cards ================================== */

.payment-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}

.payment-choice {
  display: block;
  position: relative;
  cursor: pointer;
}

.payment-choice input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.payment-choice__content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.payment-choice:hover .payment-choice__content {
  border-color: var(--color-saffron);
  background: var(--color-cream);
}

.payment-choice.is-selected .payment-choice__content,
.payment-choice:has(input:checked) .payment-choice__content {
  border-color: var(--color-saffron);
  box-shadow: 0 0 0 3px rgba(var(--color-saffron-rgb, 198, 120, 31), 0.15);
  background: #fff8ef;
}

.payment-choice.is-disabled .payment-choice__content {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.payment-choice--unavailable {
  cursor: default;
}

.payment-choice--unavailable .payment-choice__content {
  background: rgba(0, 0, 0, 0.03);
  border-style: dashed;
}

.payment-choice__icon {
  flex-shrink: 0;
  color: var(--color-saffron);
  display: flex;
  align-items: center;
}

.payment-choice__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.payment-choice__title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-masala);
}

.payment-choice__desc {
  font-size: 0.82rem;
  color: var(--color-muted);
}

/* keyboard focus-visible ring on the hidden radio shows on the label */
.payment-choice input[type="radio"]:focus-visible + .payment-choice__content {
  outline: 2px solid var(--color-saffron);
  outline-offset: 2px;
}

/* ===== Checkout consent ===================================== */

.checkout__consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 1rem 0 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkout__consent input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

@media (max-width: 480px) {
  .payment-choices {
    grid-template-columns: 1fr;
  }

  .checkout-stepper__label {
    display: none;
  }

  .checkout-stepper__step {
    flex: 0 0 auto;
  }
}
