/* ==========================================================================
   Villa Breakfast - dialog components
   Split out of components.css so the always-open page does not pay for the
   sheets that are closed on first paint (WP-CONVERSION 14). Byte-for-byte the
   same rules: the sheet shell, the product sheet, option groups, the cart
   drawer, the upsell rail, the slot picker, the delivery place row and the
   address combobox, in their original order.
   ========================================================================== */

/* ---------- Dialog shell: bottom sheet on mobile, modal on desktop ---------- */
/* height:auto is load-bearing on iOS. The UA stylesheet gives every dialog height:fit-content,
   which is min(max-content, max(min-content, stretch)); inset leaves top auto, and iOS Safari
   resolves that stretch term to nothing where Blink resolves it to the viewport. The min-content
   term is nothing too, because the form and the body below are both flex:1 with a basis of zero
   and are free to shrink away, so the whole expression came out at zero: a sheet with its
   backdrop up, its content built and its height collapsed, parked under the bottom of the screen.
   The cart drawer never showed it because it sets a height of its own further down this file.
   Content height capped by max-height is what was always meant, and it is what auto says. */
.cb-sheet{position:fixed;inset:auto 0 0;width:100%;height:auto;max-height:92dvh;margin:0;border-radius:28px 28px 0 0;background:var(--paper);box-shadow:var(--sh-up);overflow:hidden;overscroll-behavior:contain}
.cb-sheet[open]{display:flex;flex-direction:column;animation:cb-sheet-in var(--dur-3) var(--ease-out)}
.cb-sheet.is-closing{animation:cb-sheet-out var(--dur-2) ease-in forwards}
.cb-sheet[open]::backdrop{animation:cb-fade var(--dur-2)}
@keyframes cb-sheet-in{from{transform:translateY(100%)}}
@keyframes cb-sheet-out{to{transform:translateY(100%)}}
/* The escape hatch settle() in product-sheet.js reaches for when the slide-up has not happened
   400ms after the sheet opened. Taking the animation off the element drops it onto its resting
   state, which is the sheet where it belongs; :not(.is-closing) so that the way out is never
   also the thing that stops the sheet animating shut again. It restores the height too, since a
   sheet measuring nothing is the other way the slide-up can fail to arrive. */
.cb-sheet.is-stuck:not(.is-closing){animation:none!important;height:auto!important}
@keyframes cb-fade{from{opacity:0}}
.cb-sheet form{display:flex;flex-direction:column;flex:1;min-height:0}
.cb-sheet__grab{position:absolute;top:0;left:64px;right:64px;z-index:2;height:28px;touch-action:none;cursor:grab}
.cb-sheet__grab::before{content:"";display:block;width:44px;height:5px;margin:10px auto 0;border-radius:3px;background:rgba(42,27,20,.3)}
.cb-sheet__head{display:flex;align-items:center;gap:12px;padding:26px 16px 12px 20px;touch-action:none}
.cb-sheet__head h2{flex:1;font-size:1.75rem;font-variation-settings:"wdth" 80}
.cb-sheet__body{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:0 20px 24px}
.cb-sheet__foot{padding:12px 16px max(12px,env(safe-area-inset-bottom));background:var(--paper);box-shadow:0 -1px 0 var(--line),0 -12px 20px -16px rgba(42,27,20,.3)}
.cb-sheet__close{position:absolute;top:12px;right:12px;z-index:3;background:var(--paper);box-shadow:var(--sh-1)}
@media (min-width:768px){.cb-sheet{inset:0;margin:auto;width:min(600px,calc(100% - 48px));height:fit-content;max-height:min(860px,calc(100dvh - 48px));border-radius:var(--r-xl)}.cb-sheet[open]{animation:cb-modal-in var(--dur-2) var(--ease-out)}.cb-sheet.is-closing{animation:cb-modal-out var(--dur-1) ease-in forwards}.cb-sheet__grab{display:none}.cb-sheet__head{padding-top:16px}}
@keyframes cb-modal-in{from{opacity:0;transform:translateY(24px) scale(.97)}}
@keyframes cb-modal-out{to{opacity:0;transform:translateY(12px) scale(.98)}}

/* ---------- Product sheet ---------- */
.cb-product-sheet__hero{position:relative;height:210px;margin:0 -20px;background:radial-gradient(circle at 50% 70%,#FFD66E 0 34%,transparent 34.5%),var(--sun);display:grid;place-items:center;overflow:hidden}
.cb-product-sheet__hero img{width:auto;height:92%;max-width:92%;object-fit:contain;filter:drop-shadow(0 16px 16px rgba(42,27,20,.3));transform:rotate(-4deg)}
/* See components.css: a photograph fills its frame. The hero already clips,
   so this only has to undo the floating. */
.cb-product-sheet__hero img.is-photo{width:100%;height:100%;max-width:none;object-fit:cover;filter:none;transform:none}
.cb-product-sheet__intro{padding:18px 0 6px}
.cb-product-sheet__intro h2{font-size:2.25rem;font-variation-settings:"wdth" 80;overflow-wrap:anywhere}
.cb-product-sheet__intro p{margin:8px 0 0;color:var(--ink-2)}
.cb-product-sheet__price{margin-top:10px;display:flex;gap:10px;align-items:center}
.cb-product-sheet__qty{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 0 4px;font-weight:800}
.cb-add-bar__note{margin:0 0 8px;font-size:.8125rem;font-weight:700;color:var(--terracotta-dark);text-align:center}

/* ---------- Option group ---------- */
.cb-option-group{margin:18px 0 0;padding:0;border:0;min-width:0}
.cb-option-group__head{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:12px 0 8px;border-bottom:2px solid var(--espresso)}
.cb-option-group legend{float:left;width:100%;padding:0}
.cb-option-group legend+*{clear:both}
.cb-option-group__title{font:800 1.25rem/1.1 var(--font-display);font-variation-settings:"wdth" 82;letter-spacing:-.02em}
.cb-option-group__title small{display:block;margin-top:2px;font:600 .8125rem/1.3 var(--font-body);letter-spacing:0;color:var(--ink-2)}
.cb-option-group__req{flex:0 0 auto;padding:4px 10px;border-radius:var(--r-pill);background:var(--cream);font-size:.6875rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}
.cb-option-group.is-required .cb-option-group__req{background:var(--sun)}
.cb-option-group.is-complete .cb-option-group__req{background:var(--olive);color:var(--paper)}
.cb-option-group.is-error .cb-option-group__req{background:var(--terracotta);color:var(--paper)}
.cb-option-group.is-error .cb-option-group__head{border-color:var(--terracotta)}
.cb-option-group__error{display:none;margin:8px 0 0;font-size:var(--fs-sm);font-weight:700;color:var(--error)}
.cb-option-group.is-error .cb-option-group__error{display:block}
.cb-option{position:relative;display:flex;align-items:center;gap:12px;min-height:56px;padding:6px 0;border-bottom:1px solid var(--line);cursor:pointer}
.cb-option input{position:absolute;opacity:0;width:1px;height:1px}
.cb-option__ind{flex:0 0 26px;width:26px;height:26px;border-radius:50%;border:2px solid var(--espresso);background:var(--paper);display:grid;place-items:center;transition:background-color var(--dur-1)}
.cb-option__ind::after{content:"";width:10px;height:10px;border-radius:50%;background:var(--sun);transform:scale(0);transition:transform var(--dur-1) var(--ease-spring)}
.cb-option input[type=checkbox]+.cb-option__ind{border-radius:8px}
.cb-option input[type=checkbox]+.cb-option__ind::after{width:12px;height:7px;border-radius:0;background:none;border:solid var(--sun);border-width:0 0 3px 3px;transform:rotate(-45deg) scale(0);margin-top:-3px}
.cb-option input:checked+.cb-option__ind{background:var(--espresso)}
.cb-option input:checked+.cb-option__ind::after{transform:scale(1)}
.cb-option input[type=checkbox]:checked+.cb-option__ind::after{transform:rotate(-45deg) scale(1)}
.cb-option input:focus-visible+.cb-option__ind{outline:3px solid var(--focus);outline-offset:2px}
.cb-option input:disabled~*{opacity:.45}
.cb-option__name{flex:1;font-weight:700;line-height:1.25}
.cb-option__name small{display:block;font-weight:600;font-size:.8125rem;color:var(--ink-2)}
.cb-option__price{font-weight:800;color:var(--terracotta-dark);white-space:nowrap}
.cb-option--count{cursor:default}
.cb-option--count .cb-stepper{background:transparent;padding:0}
.cb-option--count .cb-stepper button{background:var(--cream)}
.cb-option--count.is-on .cb-option__name{font-weight:800}
.cb-option--count.is-on .cb-stepper output{color:var(--terracotta)}

/* ---------- Cart drawer ---------- */
.cb-cart-drawer{height:92dvh}
@media (min-width:768px){.cb-cart-drawer{inset:0 0 0 auto;width:min(460px,100%);height:100dvh;max-height:100dvh;margin:0;border-radius:var(--r-xl) 0 0 var(--r-xl)}.cb-cart-drawer[open]{animation:cb-drawer-in var(--dur-3) var(--ease-out)}.cb-cart-drawer.is-closing{animation:cb-drawer-out var(--dur-2) ease-in forwards}}
@keyframes cb-drawer-in{from{transform:translateX(100%)}}
@keyframes cb-drawer-out{to{transform:translateX(100%)}}
.cb-cart{display:flex;flex-direction:column;min-height:100%}
.cb-cart__items{list-style:none}
.cb-cart-item{display:grid;grid-template-columns:56px 1fr auto;gap:4px 12px;padding:14px 0;border-bottom:1px solid var(--line)}
.cb-cart-item__img{grid-row:span 2;width:56px;height:56px;border-radius:14px;background:var(--cream);display:grid;place-items:center}
.cb-cart-item__img img{width:86%;height:86%;object-fit:contain}
.cb-cart-item__img img.is-photo{width:100%;height:100%;border-radius:inherit;object-fit:cover}
.cb-cart-item__name{margin:0;font-weight:800;line-height:1.25;overflow-wrap:break-word}
.cb-cart-item__opts{margin:2px 0 0;font-size:.8125rem;color:var(--ink-2);line-height:1.4}
.cb-cart-item__price{font-weight:800;white-space:nowrap;text-align:right}
.cb-cart-item__row{grid-column:2/-1;display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:6px}
.cb-cart-item__remove{display:inline-flex;align-items:center;gap:4px;min-height:var(--tap);padding:0 6px;border:0;background:none;font-size:.8125rem;font-weight:800;color:var(--espresso-2);text-decoration:underline;text-underline-offset:3px}
.cb-cart-item.is-sold-out{background:var(--error-bg);margin:0 -12px;padding:14px 12px;border-radius:var(--r-md);border:0}
.cb-cart-item.is-sold-out .cb-cart-item__img img{filter:grayscale(1) opacity(.5)}
.cb-cart-item__alert{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;margin-top:8px;font-size:var(--fs-sm);font-weight:800;color:var(--terracotta-dark)}
.cb-cart-item__alert .cb-btn{min-height:40px}
.cb-free-delivery{margin:16px 0 4px;padding:14px 16px;border-radius:var(--r-md);background:var(--pool-soft)}
.cb-free-delivery p{margin:0 0 10px;font-size:var(--fs-sm);font-weight:700}
.cb-free-delivery p strong{color:var(--espresso)} /* pool-deep on pool-soft is 4.4:1 */
.cb-progress{height:10px;border-radius:5px;background:rgba(14,124,118,.16);overflow:hidden}
.cb-progress span{display:block;height:100%;width:var(--p,0%);border-radius:inherit;background:var(--pool-deep);transition:width var(--dur-3) var(--ease-out)}
.cb-free-delivery.is-reached{background:var(--olive-soft)}
.cb-free-delivery.is-reached .cb-progress span{background:var(--olive)}
.cb-totals{display:grid;gap:6px;margin:16px 0 0;font-size:.9375rem}
.cb-totals div{display:flex;justify-content:space-between;gap:12px}
.cb-totals dt{color:var(--ink-2);font-weight:600}
.cb-totals dd{margin:0;font-weight:800;font-variant-numeric:tabular-nums}
.cb-totals .is-total{margin-top:6px;padding-top:10px;border-top:2px solid var(--espresso);font-size:1.125rem}
.cb-totals .is-total dt{color:var(--espresso);font-weight:800}
.cb-totals .is-free dd{color:var(--olive)}
.cb-cart__empty{display:grid;justify-items:center;gap:14px;padding:32px 8px 40px;text-align:center}
.cb-cart__empty img{width:150px}
.cb-cart__empty h3{font-size:1.75rem}
.cb-cart__empty p{margin:0;color:var(--ink-2);max-width:30ch}
.cb-cart__min{margin-top:12px}

/* ---------- Upsell ---------- */
.cb-upsell{margin-top:18px;padding:14px;border-radius:var(--r-lg);background:var(--sun-soft)}
.cb-upsell .cb-product-row__price{color:var(--espresso)} /* terracotta on sun-soft is 4.05:1 */
.cb-upsell__kicker{margin:0 0 4px;font-size:.6875rem;font-weight:800;letter-spacing:.14em;text-transform:uppercase}
.cb-upsell .cb-product-row{border:0;padding:4px 0 0}
.cb-upsell .cb-product-row__line{flex-wrap:wrap;gap:2px 8px}
.cb-upsell .cb-product-row__dots{display:none}
.cb-upsell .cb-product-row__img{background:var(--paper)}

/* ---------- Slot picker ---------- */
.cb-slot-picker__days{display:flex;gap:8px;overflow-x:auto;margin:0 -20px;padding:4px 20px 12px;scrollbar-width:none}
.cb-slot-picker__days::-webkit-scrollbar{display:none}
.cb-day{position:relative;flex:0 0 auto}
.cb-day input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer}
.cb-day span{display:grid;place-items:center;min-width:78px;min-height:60px;padding:6px 14px;border-radius:var(--r-md);background:var(--cream);font-weight:800;line-height:1.1;text-align:center;border:2px solid transparent}
.cb-day small{display:block;font-size:.75rem;font-weight:700;color:var(--ink-2)}
.cb-day input:checked+span{background:var(--espresso);color:var(--sun)}
.cb-day input:checked+span small{color:var(--cream)}
.cb-day input:focus-visible+span{outline:3px solid var(--focus);outline-offset:2px}
.cb-day.is-closed span{opacity:.5}
.cb-slot-picker__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
@media (min-width:480px){.cb-slot-picker__grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
.cb-slot{position:relative}
.cb-slot input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer}
.cb-slot input:disabled{cursor:not-allowed}
.cb-slot__tile{display:grid;gap:2px;min-height:64px;padding:10px 12px;border-radius:var(--r-md);border:2px solid var(--line-strong);background:var(--paper);transition:all var(--dur-1)}
.cb-slot__time{font:800 1.125rem/1.1 var(--font-body);font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.cb-slot__state{font-size:.75rem;font-weight:800;color:var(--olive)}
.cb-slot[data-cb-slot-state="almost"] .cb-slot__tile{border-color:var(--sun-deep);background:var(--sun-soft)}
.cb-slot[data-cb-slot-state="almost"] .cb-slot__state{color:var(--terracotta-dark)}
.cb-slot[data-cb-slot-state="full"] .cb-slot__tile{border-style:dashed;background:var(--cream);color:var(--espresso-3)}
.cb-slot[data-cb-slot-state="full"] .cb-slot__time{text-decoration:line-through}
.cb-slot[data-cb-slot-state="full"] .cb-slot__state,.cb-slot[data-cb-slot-state="blocked"] .cb-slot__state{color:var(--espresso-2)}
.cb-slot[data-cb-slot-state="blocked"] .cb-slot__tile{border-color:transparent;background:repeating-linear-gradient(-45deg,var(--cream) 0 8px,#F3E6CC 8px 16px);color:var(--espresso-3)}
.cb-slot input:checked+.cb-slot__tile{border-color:var(--espresso);background:var(--espresso);color:var(--sun);box-shadow:0 4px 0 var(--terracotta)}
.cb-slot input:checked+.cb-slot__tile .cb-slot__state{color:var(--cream)}
.cb-slot input:focus-visible+.cb-slot__tile{outline:3px solid var(--focus);outline-offset:2px}
@media (hover:hover){.cb-slot input:enabled:not(:checked):hover+.cb-slot__tile{border-color:var(--espresso)}}
.cb-slot-picker__set{min-width:0;margin:0 0 18px;padding:0;border:0}
.cb-slot-picker__set legend{padding:0;margin-bottom:10px}
.cb-slot--wide{grid-column:1/-1}
.cb-slot--wide .cb-slot__tile{grid-template-columns:1fr auto;align-items:center;min-height:56px}
.cb-slot-picker__legend{display:flex;flex-wrap:wrap;gap:6px 14px;margin:12px 0 0;font-size:.75rem;font-weight:700;color:var(--ink-2)}
.cb-slot-picker__empty{display:grid;gap:10px;justify-items:start;padding:18px;border-radius:var(--r-md);background:var(--sun-soft)}
.cb-slot-picker__empty h3{font-size:1.375rem}
.cb-slot-picker__empty p{margin:0}

/* ---------- Delivery dialog: place row ---------- */
.cb-when__place{display:grid;gap:10px;margin:4px 0 22px}
.cb-when__summary{display:flex;gap:12px;align-items:center;padding:14px 16px;border-radius:var(--r-md);background:var(--pool-soft);font-size:var(--fs-sm);font-weight:600}
.cb-when__summary .i{width:26px;height:26px;color:var(--pool-deep)}
.cb-when__summary strong{display:block;font-size:1rem;overflow-wrap:anywhere}
.cb-when__place .cb-link{justify-self:start;min-height:36px;font-size:var(--fs-sm)}
.cb-when__check{display:grid;gap:10px}

/* ---------- Address combobox ---------- */
.cb-combo{position:relative}
.cb-combo__list{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:30;max-height:320px;overflow:auto;list-style:none;padding:6px;border-radius:var(--r-md);background:var(--paper);box-shadow:var(--sh-3)}
.cb-combo__list [role=option]{display:flex;gap:10px;align-items:center;min-height:52px;padding:8px 12px;border-radius:12px;font-weight:700;cursor:pointer}
.cb-combo__list [role=option][aria-selected=true],.cb-combo__list [role=option]:hover{background:var(--cream)}
.cb-combo__list .i{width:20px;height:20px;color:var(--terracotta)}
.cb-combo__list small{display:block;font-size:.8125rem;font-weight:500;color:var(--ink-2)}
.cb-combo__none{padding:12px;font-size:var(--fs-sm);color:var(--ink-2)}

