/* Buchung im Shop-Stil: Vollbild-Kalender + Auswahl-Panel (Desktop rechts, Handy als Sheet) + Warenkorb + Kasse */

.page-book { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: var(--sand-light); }
.page-book .site-footer { display: none; }
.book-main { flex: 1; display: flex; min-height: 0; }

.shop { --panel-w: 420px; --radius-lg: 16px; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); min-height: 0; width: 100%; }

/* ---------- Kalender ---------- */
.shop-calendar { display: flex; flex-direction: column; min-height: 0; padding: 1.25rem 1.5rem 1rem; gap: .75rem; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; }
.cal-intro h1 { margin: 0; font-size: clamp(1.6rem, 2.4vw, 2.2rem); }
.cal-intro p { margin: .15rem 0 0; color: var(--taupe-dark); }
.cal-controls { display: flex; align-items: center; gap: .5rem; }
.cal-controls strong { min-width: 9.5rem; text-align: center; font-family: var(--font-head); font-weight: 400; font-size: 1.35rem; }
.icon-btn { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--sand); background: var(--white); color: var(--ink); font-size: 1.35rem; line-height: 1; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { border-color: var(--taupe-dark); }
.pill-btn { border: 1px solid var(--sand); background: var(--white); color: var(--ink); border-radius: 999px; padding: .5rem 1rem; font: inherit; font-size: .9rem; cursor: pointer; }
.pill-btn:hover { border-color: var(--taupe-dark); }

.cal-weekdays, .cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-weekdays span { text-align: left; padding-left: .6rem; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--taupe-dark); }
.cal-month { flex: 1; min-height: 420px; grid-auto-rows: minmax(64px, 1fr); }

.day {
    position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
    border: 1px solid transparent; border-radius: 12px; background: var(--white); color: var(--ink);
    padding: .55rem .6rem .7rem; font: inherit; text-align: left; cursor: pointer; overflow: hidden; min-width: 0;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.day:hover:not(:disabled) { border-color: var(--taupe-dark); box-shadow: 0 6px 18px rgba(76, 71, 67, .10); }
.day:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.day .num { font-size: 1.15rem; font-weight: 600; line-height: 1; }
.day .label { font-size: .78rem; color: var(--taupe-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.day .label-short { display: none; }
.day .bar { position: absolute; left: .6rem; right: .6rem; bottom: .35rem; height: 4px; border-radius: 4px; background: var(--sand-light); overflow: hidden; }
.day .bar i { display: block; height: 100%; background: var(--taupe-dark); border-radius: 4px; }
.day.is-partial .bar i { background: var(--taupe); }
.day.is-today .num::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-left: .35rem; vertical-align: middle; }
.day.is-full, .day.is-closed, .day.is-unavailable { background: transparent; border-color: rgba(150, 142, 136, .18); cursor: default; }
.day.is-full .num, .day.is-closed .num, .day.is-unavailable .num { color: #b5ada6; font-weight: 400; }
.day.is-full .label { text-decoration: line-through; color: #b5ada6; }
.day.is-blank { visibility: hidden; }
.day.is-selected { background: var(--ink); border-color: var(--ink); color: var(--white); }
.day.is-selected .label { color: rgba(255, 255, 255, .8); }
.day.is-selected .bar { background: rgba(255, 255, 255, .2); }
.day.is-selected .bar i { background: var(--white); }

.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .8rem; color: var(--taupe-dark); align-items: center; }
.cal-legend .lg { display: inline-block; width: 18px; height: 4px; border-radius: 4px; margin-right: .4rem; vertical-align: middle; }
.lg-open { background: var(--taupe-dark); } .lg-partial { background: var(--taupe); } .lg-full { background: #d9d3cd; }

/* ---------- Auswahl-Panel ---------- */
.shop-panel { background: var(--white); border-left: 1px solid var(--sand); display: flex; flex-direction: column; min-height: 0; max-height: 100%; position: relative; }
.panel-empty { margin: auto; padding: 2rem; text-align: center; color: var(--taupe-dark); max-width: 300px; }
.panel-empty img { width: 180px; height: auto; opacity: .85; margin-bottom: 1rem; }
.panel-content { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.25rem 1.5rem .75rem; border-bottom: 1px solid var(--sand-light); }
.panel-head h2 { margin: .1rem 0 0; font-size: 1.5rem; }
.kicker { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--taupe-dark); font-weight: 700; }
.panel-sub { margin: .2rem 0 0; font-size: .9rem; color: var(--taupe-dark); }
.panel-close { display: none; }
.panel-body { overflow-y: auto; padding: .5rem 1.5rem 7rem; flex: 1; overscroll-behavior: contain; }
.panel-section { padding: .9rem 0; border-bottom: 1px solid var(--sand-light); }
.panel-section:last-child { border-bottom: 0; }
.panel-section h3 { margin: 0 0 .6rem; font-family: var(--font-body); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--taupe-dark); font-weight: 700; }

.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: .5rem; }
.chip {
    display: grid; gap: .05rem; justify-items: center; padding: .55rem .4rem; border-radius: 12px;
    border: 1px solid var(--sand); background: var(--white); color: var(--ink); font: inherit; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.chip strong { font-size: .98rem; }
.chip small { font-size: .72rem; color: var(--taupe-dark); }
.chip:hover { border-color: var(--taupe-dark); }
.chip.is-selected { background: var(--ink); border-color: var(--ink); color: var(--white); }
.chip.is-selected small { color: rgba(255, 255, 255, .8); }
.chip.is-unavailable { border-style: dashed; background: var(--sand-light); color: #a39b94; }
.chip.is-unavailable small { color: #a39b94; }
.hint { margin: .75rem 0 0; background: var(--rose); border-radius: 12px; padding: .75rem .9rem; font-size: .9rem; }

/* Angebote als Produktkacheln */
.products { display: grid; gap: .75rem; }
.product {
    display: grid; grid-template-columns: 92px 1fr; gap: .9rem; align-items: center; padding: .7rem; border-radius: 14px;
    border: 1px solid var(--sand); background: var(--white); cursor: pointer; position: relative; text-align: left; font: inherit; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.product:hover { border-color: var(--taupe-dark); box-shadow: 0 6px 18px rgba(76, 71, 67, .08); }
.product.is-selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.product.is-selected::after { content: "✓"; position: absolute; top: .55rem; right: .65rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--ink); color: var(--white); display: grid; place-items: center; font-size: .8rem; }
.product-img { aspect-ratio: 1; border-radius: 10px; background: var(--sand-light) url("../img/couch.png") center / 82% no-repeat; }
.product-body { display: grid; gap: .15rem; min-width: 0; }
.product-body strong { font-size: 1rem; padding-right: 1.8rem; }
.product-body small { color: var(--taupe-dark); font-size: .8rem; }
.product-price { font-family: var(--font-head); font-size: 1.3rem; margin-top: .2rem; }
.product-rule { color: var(--ok); font-size: .8rem; }

.extras-list { display: grid; gap: .5rem; }
.extra { display: flex; gap: .7rem; align-items: center; padding: .65rem .8rem; border: 1px solid var(--sand); border-radius: 12px; cursor: pointer; }
.extra input { accent-color: var(--ink); width: 1.1rem; height: 1.1rem; }
.extra .grow { flex: 1; min-width: 0; }
.extra small { display: block; color: var(--taupe-dark); }

/* ---------- Warenkorb-Leiste ---------- */
.cart-bar {
    position: fixed; right: 0; bottom: 0; width: var(--panel-w); z-index: 30;
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "info total" "cta cta"; gap: .5rem 1rem; align-items: center;
    padding: .9rem 1.5rem calc(.9rem + env(safe-area-inset-bottom)); background: var(--white);
    border-top: 1px solid var(--sand); box-shadow: 0 -8px 24px rgba(76, 71, 67, .08);
}
.cart-info { grid-area: info; display: grid; min-width: 0; }
.cart-info strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-info span { font-size: .82rem; color: var(--taupe-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-total { grid-area: total; text-align: right; display: grid; }
.cart-total span { font-family: var(--font-head); font-size: 1.45rem; line-height: 1.1; }
.cart-total small { font-size: .7rem; color: var(--taupe-dark); }
.cart-bar .btn-cta { grid-area: cta; }
.btn-cta { background: var(--ink); border-color: var(--ink); border-radius: 999px; padding: .85rem 1.4rem; font-weight: 600; text-align: center; }
.btn-cta:hover { background: #2f2b28; border-color: #2f2b28; }
.btn-block { width: 100%; display: block; }

/* ---------- Kasse ---------- */
.checkout { grid-column: 1 / -1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; }
.checkout h1 { margin: .4rem 0 1rem; }
.link-back { background: none; border: 0; padding: 0; font: inherit; color: var(--taupe-dark); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.5rem; align-items: start; }
.checkout-main { display: grid; gap: 1.25rem; min-width: 0; }
.card-box { background: var(--white); border-radius: var(--radius-lg); padding: 1.25rem 1.4rem; border: 1px solid rgba(150, 142, 136, .2); }
.card-box h2 { margin: 0 0 .9rem; font-size: 1.3rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-grid .field { max-width: none; }
.form-grid .field-wide { grid-column: 1 / -1; }
.checkout .field input, .checkout .field textarea, .code-row input { border-radius: 10px; border-color: var(--sand); padding: .7rem .85rem; }
.code-row { display: flex; gap: .5rem; }
.code-row input { flex: 1; min-width: 0; font: inherit; border: 1px solid var(--sand); text-transform: uppercase; }
.order-summary { position: sticky; top: 1rem; }
.summary-lines { display: grid; gap: .45rem; margin-bottom: 1rem; }
.summary-lines .line { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; }
.summary-lines .line span:last-child { white-space: nowrap; }
.summary-lines .muted { color: var(--taupe-dark); font-size: .88rem; }
.summary-lines .total { border-top: 1px solid var(--sand); padding-top: .6rem; margin-top: .3rem; font-weight: 700; font-size: 1.1rem; }
.summary-lines .total span:last-child { font-family: var(--font-head); font-size: 1.5rem; font-weight: 400; }
.summary-lines .when { background: var(--sand-light); border-radius: 12px; padding: .7rem .85rem; display: grid; gap: .1rem; margin-bottom: .4rem; }
.summary-lines details { font-size: .85rem; color: var(--taupe-dark); }
.secure-note { font-size: .78rem; color: var(--taupe-dark); text-align: center; margin: .6rem 0 0; }
.code-ok { color: var(--ok); }
.page-book .legal-mini { display: flex; gap: 1rem; font-size: .78rem; margin-left: auto; }
.page-book .legal-mini a { color: var(--taupe-dark); }

/* ---------- Handy / Tablet ---------- */
.sheet-backdrop { display: none; }
@media (max-width: 999px) {
    .shop { grid-template-columns: 1fr; }
    .shop-calendar { padding: 1rem .75rem calc(1rem + env(safe-area-inset-bottom)); min-height: calc(100dvh - 70px); }
    .cal-toolbar { align-items: center; }
    .cal-intro p { font-size: .9rem; }
    .cal-month { gap: 4px; min-height: 0; grid-auto-rows: minmax(58px, 1fr); }
    .cal-weekdays { gap: 4px; }
    .cal-weekdays span { padding-left: 0; text-align: center; }
    .day { padding: .4rem .3rem .7rem; align-items: center; border-radius: 10px; }
    .day .label { display: none; }
    .day .label-short { display: block; font-size: .66rem; color: var(--taupe-dark); }
    .day.is-selected .label-short { color: rgba(255, 255, 255, .8); }
    .day .bar { left: .35rem; right: .35rem; bottom: .3rem; height: 3px; }

    /* Panel wird zum Sheet von unten */
    .shop-panel {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; max-height: 88dvh; border-left: 0;
        border-radius: 22px 22px 0 0; box-shadow: 0 -12px 40px rgba(40, 34, 30, .25);
        transform: translateY(105%); transition: transform .28s ease;
    }
    .shop-panel::before { content: ""; width: 42px; height: 5px; border-radius: 5px; background: var(--sand); margin: .55rem auto 0; flex: none; }
    .shop.sheet-open .shop-panel { transform: translateY(0); }
    .panel-empty { display: none; }
    .panel-close { display: inline-grid; }
    .panel-head { padding: .6rem 1.1rem .6rem; }
    .panel-body { padding: .25rem 1.1rem 9rem; }
    .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(40, 34, 30, .35); opacity: 0; pointer-events: none; transition: opacity .25s; }
    .shop.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
    .cart-bar { left: 0; width: auto; padding-left: 1.1rem; padding-right: 1.1rem; grid-template-columns: 1fr auto auto; grid-template-areas: "info total cta"; }
    .cart-bar .btn-cta { padding: .75rem 1.1rem; }

    .checkout { padding: 1rem .9rem 3rem; }
    .checkout-grid { grid-template-columns: 1fr; }
    .order-summary { position: static; }
}
@media (max-width: 520px) {
    .form-grid { grid-template-columns: 1fr; }
    .cal-controls strong { min-width: 8rem; font-size: 1.15rem; }
    .cal-intro h1 { font-size: 1.45rem; }
    .cart-bar { grid-template-columns: 1fr auto; grid-template-areas: "info total" "cta cta"; }
}
@media (prefers-reduced-motion: reduce) {
    .shop-panel, .sheet-backdrop, .day, .chip, .product { transition: none; }
}

.shop-toast { position: fixed; left: 50%; top: 1rem; transform: translateX(-50%); z-index: 50; max-width: min(92vw, 520px); background: var(--ink); color: var(--white); padding: .8rem 1.1rem; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); font-size: .92rem; }

/* Desktop: Seite fest auf Bildschirmhöhe – nur das Panel scrollt, der Kalender bleibt stehen */
@media (min-width: 1000px) {
    .page-book { height: 100vh; height: 100dvh; overflow: hidden; }
    .page-book.is-checkout { height: auto; overflow: visible; }
    .shop { height: 100%; }
    .shop-panel { height: 100%; overflow: hidden; }
}
