/*
 * Aperina Delivery Schedule — checkout picker and the delivery time on order pages.
 * Builds on the design system's .datepicker / .day / .choice / .badge (theme components.css) and its tokens.
 */

/* =========================================================
   Checkout picker
   ========================================================= */
.delivery-picker { container-type: inline-size; margin-block: 0 var(--space-8, 32px); }
.delivery-picker__title { margin: 0 0 var(--space-1, 4px); font-size: var(--text-title, 1.25rem); font-weight: 600; line-height: 1.6; }
.delivery-picker__hint { margin: 0 0 var(--space-4, 16px); font-size: var(--text-small, 0.9375rem); line-height: 1.8; color: var(--text-muted, #6B6159); }
.delivery-picker__layout { display: grid; gap: var(--space-4, 16px); }
@container (min-width: 600px) {
  .delivery-picker__layout { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; }
}

/* Calendar: full width of its column, flat inside the checkout, 44px days */
.delivery-picker .datepicker { width: 100%; box-shadow: none; }
.delivery-picker .datepicker-head .btn-icon { width: 44px; min-height: 44px; }
.delivery-picker .datepicker-head .btn-icon svg { width: 18px; height: 18px; }
.delivery-picker .day { height: 44px; }
.delivery-picker .day:disabled { text-decoration: none; }
.delivery-picker .day.is-full { text-decoration: line-through; }
.delivery-picker .day.is-outside { color: color-mix(in oklab, var(--text-subtle, #8A7E73) 55%, transparent); }
.delivery-picker .legend-selected { background: var(--primary, #72383D); }
.delivery-picker .legend-limited { width: 6px !important; height: 6px !important; border-radius: 50% !important; background: var(--warning, #7A5718); }
.delivery-picker .legend-full { border: 1px solid var(--border-strong, #8A7E73); }

/* Windows of the chosen day: choice cards */
.delivery-slots__day { margin: 0 0 var(--space-2, 8px); font-size: var(--text-label, 0.875rem); font-weight: 600; }
.delivery-slots__list { display: grid; gap: var(--space-2, 8px); }
.delivery-slots__empty { margin: 0; color: var(--text-muted, #6B6159); }
.delivery-slot { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3, 12px); min-height: 56px; padding: var(--space-3, 12px) var(--space-4, 16px); }
.delivery-slot__time { font-size: var(--text-body, 1rem); font-weight: 600; }
.delivery-slot__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2, 8px); }
.delivery-slot__fee { font-size: var(--text-caption, 0.8125rem); color: var(--text-muted, #6B6159); }
.delivery-slot:has(input:disabled):not(.is-busy) { cursor: not-allowed; background: transparent; border-style: dashed; }
.delivery-slot:has(input:disabled):not(.is-busy):hover { border-color: var(--border, #D1C7BD); }
.delivery-slot:has(input:disabled):not(.is-busy) .delivery-slot__time { color: var(--text-subtle, #8A7E73); }
.delivery-slot.is-full .delivery-slot__time { text-decoration: line-through; }
.delivery-slot.is-busy { opacity: 0.6; cursor: progress; }

.delivery-picker__summary {
  display: flex; align-items: center; gap: var(--space-2, 8px); margin: var(--space-4, 16px) 0 0; padding: var(--space-3, 12px) var(--space-4, 16px);
  border-radius: var(--radius-panel, 12px); background: var(--bg-sunken, #E6DED5); font-size: var(--text-small, 0.9375rem); line-height: 1.8; color: var(--text-muted, #6B6159);
}
.delivery-picker__summary.is-set { background: var(--accent-tint, #E7D8D5); color: var(--on-accent-tint, #72383D); }
.delivery-picker__summary svg { flex: none; width: 18px; height: 18px; }
.delivery-picker__summary b { font-weight: 600; }
.delivery-picker__error { margin: var(--space-2, 8px) 0 0; font-size: var(--text-caption, 0.8125rem); line-height: 1.7; color: var(--error, #A1302A); }
.delivery-picker.has-error .datepicker { border-color: var(--error, #A1302A); }

/* =========================================================
   Delivery time on order received / order pages
   ========================================================= */
.delivery-time { display: flex; align-items: center; gap: var(--space-3, 12px); margin: 0 0 var(--space-5, 20px); padding: var(--space-4, 16px); border: 1px solid var(--border, #D1C7BD); background: var(--bg-raised, #F7F3EE); }
.delivery-time svg { flex: none; width: 28px; height: 28px; fill: none; stroke: var(--primary, #72383D); stroke-width: 1.5; stroke-linecap: round; }
.delivery-time p { margin: 0; }
.delivery-time__label { font-size: var(--text-caption, 0.8125rem); color: var(--text-muted, #6B6159); }
.delivery-time__value { font-size: var(--text-body, 1rem); font-weight: 600; line-height: 1.7; }
