/**
 * CQ Booking Widget — Frontend Styles
 *
 * Verwendet die Theme Design-Tokens (--gold, --ease, etc.)
 * Fallback-Werte eingebaut falls außerhalb des Themes geladen.
 *
 * @package CQ_Booking
 * @since 2.0.0
 */

/* Fallback Tokens (werden vom Theme überschrieben) */
.cq-book {
    --gold: #B29474;
    --gold-light: #C8A886;
    --gold-dark: #9B7E62;
    --glass: rgba(255, 255, 255, 0.02);
    --glass-heavy: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    --ok: #18c27e;
    --warn: #FFA500;
    --ease: cubic-bezier(0.23, 1, 0.32, 1);
    --elevated: #111111;
    --black: #000000;
    --white: #ffffff;
}

/* ══════════════════════════════════════════════════
   WIDGET CONTAINER
   ══════════════════════════════════════════════════ */
.cq-book {
    position: sticky;
    top: 90px;
    width: var(--sidebar-width, 380px);
}

.cq-book-inner {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

/* ── Header ────────────────────────────────────── */
.cq-book-header {
    padding: 1.6rem 1.8rem;
    border-bottom: 1px solid var(--glass-border);
}

.cq-book-price {
    font-size: 1.8rem;
    font-weight: 100;
    color: var(--gold-light);
    margin-bottom: 0.15rem;
}

.cq-book-price small {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    font-weight: 300;
}

.cq-book-price-sub {
    font-size: 0.65rem;
    font-weight: 300;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.1em;
}

/* ── Steps ─────────────────────────────────────── */
.cq-book-step {
    padding: 1.4rem 1.8rem;
    border-bottom: 1px solid var(--glass-border);
}

.cq-book-step:last-of-type { border-bottom: none; }

.cq-book-step-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.cq-book-step-num {
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.55rem; font-weight: 600;
    color: var(--black);
    background: var(--gold);
    flex-shrink: 0;
}

.cq-book-step-num.completed { background: var(--ok); }

.cq-book-step-label {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}

/* ── Calendar ──────────────────────────────────── */
.cq-cal { user-select: none; }

.cq-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.cq-cal-nav-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--white);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.cq-cal-nav-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.cq-cal-month {
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.cq-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cq-cal-weekday {
    text-align: center;
    font-size: 0.5rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65); /* a11y: vorher 0.25 = 2.09 ratio (AA-fail) */
    padding: 0.4rem 0 0.6rem;
}

.cq-cal-day {
    aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 300;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.cq-cal-day:hover:not(.disabled):not(.empty) {
    background: var(--glass-heavy);
    color: var(--white);
}

.cq-cal-day.available { color: var(--white); }

.cq-cal-day.available::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 3px; height: 3px;
    background: var(--ok);
    border-radius: 50%;
}

.cq-cal-day.selected {
    background: var(--gold);
    color: var(--black);
    font-weight: 600;
}

.cq-cal-day.selected::after { display: none; }
.cq-cal-day.today { border: 1px solid var(--gold); }

.cq-cal-day.disabled {
    color: rgba(255,255,255,0.5); /* a11y: vorher 0.1 = 1.22 ratio. 0.5 = ~5.0 (AA) + cursor:default differenziert weiterhin vom aktiven .available (var(--white)) */
    cursor: default;
}

.cq-cal-day.empty { cursor: default; }

.cq-cal-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255,255,255,0.03);
}

.cq-cal-legend-item {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.5rem;
    color: rgba(255,255,255,0.65); /* a11y: vorher 0.25 = 2.09 ratio (AA-fail) */
    letter-spacing: 0.05em;
}

.cq-cal-legend-dot { width: 4px; height: 4px; border-radius: 50%; }
.cq-cal-legend-dot.green { background: var(--ok); }
.cq-cal-legend-dot.gold { background: var(--gold); width: 8px; height: 8px; border-radius: 0; }

/* ── Time Slots ────────────────────────────────── */
.cq-slots { display: flex; flex-wrap: wrap; gap: 6px; }

.cq-slot {
    padding: 0.55rem 1rem;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.6);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.2s;
}

.cq-slot:hover {
    border-color: rgba(178,148,116,0.4);
    color: var(--white);
    background: var(--glass-heavy);
}

.cq-slot.selected {
    /* Massiv gold mit schwarzer Schrift — dieselbe Auszeichnung wie der
       gewaehlte Kalendertag darueber und wie auf /buchen. Vorher war der
       gewaehlte Tag gefuellt, die gewaehlte Uhrzeit nur getoent: zwei
       Auszeichnungen fuer denselben Vorgang im selben Widget. */
    background: var(--gold);
    border-color: var(--gold);
    color: var(--black);
}

.cq-slot.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(255,255,255,0.04);
}

.cq-slot.disabled.past {
    text-decoration: line-through;
    opacity: 0.2;
}

.cq-slot.disabled.booked {
    opacity: 0.35;
    position: relative;
}

.cq-slot.disabled.booked::after {
    content: '•';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 8px;
    color: rgba(178,148,116,0.5);
}

.cq-slot.disabled:hover {
    border-color: rgba(255,255,255,0.04);
    background: transparent;
    color: rgba(255,255,255,0.15);
}

.cq-slots-empty,
.cq-slots-loading {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.65); /* a11y: vorher 0.2 = 1.71 ratio (AA-fail) */
    text-align: center;
    padding: 1rem 0;
    width: 100%;
}

.cq-slots-hint {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.2);
    margin-top: 0.6rem;
    width: 100%;
}

/* ── Players Stepper ───────────────────────────── */
.cq-players {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cq-players-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--white);
    font-size: 1.2rem; font-weight: 200;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.cq-players-btn:hover:not(:disabled) {
    border-color: var(--gold);
    color: var(--gold);
}

.cq-players-btn:disabled { opacity: 0.15; cursor: default; }

.cq-players-display { flex: 1; text-align: center; }

.cq-players-count {
    font-size: 1.6rem; font-weight: 100;
    color: var(--white); line-height: 1;
}

.cq-players-label {
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65); /* a11y: vorher 0.35 = 3.09 ratio (AA-fail) */
    margin-top: 0.2rem;
}

.cq-players-price {
    font-size: 0.65rem;
    color: var(--gold); /* a11y: opacity: 0.7 entfernt — ergab #7d6851 = 3.97 ratio. Voll --gold = 6.96 (AA) */
    margin-top: 0.5rem;
    text-align: center;
    letter-spacing: 0.05em;
}

/* ── Summary ───────────────────────────────────── */
.cq-book-summary {
    padding: 1.4rem 1.8rem;
    background: rgba(178,148,116,0.03);
    border-top: 1px solid var(--glass-border);
}

.cq-book-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
}

.cq-book-summary-row.total {
    padding-top: 0.8rem;
    margin-top: 0.8rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.85rem;
}

.cq-book-summary-label { color: rgba(255,255,255,0.4); }

.cq-book-summary-value {
    color: rgba(255,255,255,0.7);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.cq-book-summary-row.total .cq-book-summary-label {
    color: var(--white); font-weight: 400;
}

.cq-book-summary-row.total .cq-book-summary-value {
    color: var(--gold-light);
    font-size: 1.1rem; font-weight: 300;
    font-family: inherit;
}

.cq-book-summary-detail {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.2);
    margin-top: 0.4rem;
    text-align: right;
    letter-spacing: 0.05em;
}

/* ── CTA Button ────────────────────────────────── */
.cq-book-cta { padding: 0 1.8rem 1.5rem; }

.cq-book-btn {
    display: flex;
    align-items: center; justify-content: center;
    gap: 10px; width: 100%;
    padding: 1.1rem 2rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: 2px solid var(--gold);
    color: var(--black);
    font-family: inherit;
    font-size: 0.8rem; font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative; overflow: hidden;
    transition: all 0.3s var(--ease);
    box-shadow: 0 5px 25px rgba(178,148,116,0.3);
}

.cq-book-btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.cq-book-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(178,148,116,0.5), inset 0 0 20px rgba(255,255,255,0.2);
}

.cq-book-btn:hover:not(:disabled)::before { transform: translateX(100%); }
.cq-book-btn span { position: relative; z-index: 2; }

.cq-book-btn:disabled {
    opacity: 0.35; cursor: default;
    transform: none; box-shadow: none;
}

.cq-book-hint {
    text-align: center;
    margin-top: 0.7rem;
    font-size: 0.55rem;
    color: rgba(255,255,255,0.65); /* a11y: vorher 0.2 = 1.71 ratio (AA-fail) */
    letter-spacing: 0.08em;
}

/* ── Live Indicator ────────────────────────────── */
.cq-book-live {
    display: flex;
    align-items: center; justify-content: center;
    gap: 6px;
    padding: 0.55rem;
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ok);
    background: rgba(24,194,126,0.04);
    border-top: 1px solid rgba(24,194,126,0.12);
}

.cq-book-live-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--ok);
    animation: cqWidgetPulse 2s infinite;
}

@keyframes cqWidgetPulse {
    0% { box-shadow: 0 0 0 0 rgba(24,194,126,0.6); }
    70% { box-shadow: 0 0 0 6px rgba(24,194,126,0); }
    100% { box-shadow: 0 0 0 0 rgba(24,194,126,0); }
}

/* ── Nächster freier Termin (Quick-Pick) ───────── */
.cq-nextfree {
    display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left;
    background: rgba(178,148,116,0.08); border: 1px solid rgba(178,148,116,0.35);
    padding: 0.7rem 0.85rem; margin-bottom: 0.85rem; cursor: pointer;
    color: inherit; font-family: inherit; transition: all 0.25s var(--ease, ease);
}
.cq-nextfree:hover:not(:disabled) { border-color: var(--gold); background: rgba(178,148,116,0.14); }
.cq-nextfree:disabled, .cq-nextfree.loading { opacity: 0.6; cursor: progress; }
.cq-nextfree-ico {
    width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(178,148,116,0.15); color: var(--gold-light);
}
.cq-nextfree-ico svg { width: 14px; height: 14px; }
.cq-nextfree-txt { flex: 1; font-size: 0.72rem; font-weight: 500; color: #fff; letter-spacing: 0.02em; }
.cq-nextfree-arrow { flex-shrink: 0; color: var(--gold-light); font-size: 0.9rem; transition: transform 0.25s var(--ease, ease); }
.cq-nextfree:hover:not(:disabled) .cq-nextfree-arrow { transform: translateX(3px); }

/* ── Sektempfang-Upsell ────────────────────────── */
.cq-upsell-card {
    display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left;
    background: var(--glass-heavy); border: 1px solid var(--glass-border);
    padding: 0.65rem 0.8rem; cursor: pointer; color: inherit; font-family: inherit;
    transition: all 0.25s var(--ease, ease);
}
.cq-upsell-card:hover { border-color: var(--gold); }
.cq-upsell-card[aria-pressed="true"] { border-color: var(--gold); background: rgba(178,148,116,0.1); }
.cq-upsell-ico {
    width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(178,148,116,0.15); color: var(--gold-light);
}
.cq-upsell-ico svg { width: 15px; height: 15px; }
.cq-upsell-info { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.cq-upsell-info b { font-size: 0.76rem; color: #fff; font-weight: 500; }
.cq-upsell-info span { font-size: 0.58rem; color: rgba(255,255,255,0.45); line-height: 1.3; }
.cq-upsell-price { flex-shrink: 0; font-size: 0.7rem; color: var(--gold-light); white-space: nowrap; }
.cq-upsell-check {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
    border: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; color: transparent; transition: all 0.2s var(--ease, ease);
}
.cq-upsell-card[aria-pressed="true"] .cq-upsell-check { background: var(--ok); border-color: var(--ok); color: #000; }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 1024px) {
    .cq-book {
        position: static;
        width: 100%;
        max-width: 480px;
        margin: 2rem auto 0;
    }
}


/* ──────────────────────────────────────────────────────────────
   Spielsprache.
   Bewusst kein eigener nummerierter Schritt: Die Voreinstellung
   passt fuer die grosse Mehrheit, und ein vierter Schritt wuerde
   den Weg zur Buchung laenger aussehen lassen, als er ist.
   ────────────────────────────────────────────────────────────── */
.cq-book-lang {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    /* Seitlicher Abstand wie bei .cq-book-step — sonst steht die Zeile
       als einzige buendig am Rahmen. */
    padding: 1.1rem 1.8rem 1.2rem;
    border-top: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
}

.cq-book-lang-label {
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.cq-book-lang-opts {
    display: flex;
    gap: 0;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
}

.cq-book-lang-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    padding: 0.5rem 0.95rem;
    min-height: 38px;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.cq-book-lang-btn + .cq-book-lang-btn {
    border-left: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
}

.cq-book-lang-btn:hover {
    color: #fff;
}

.cq-book-lang-btn.is-on {
    background: var(--gold, #B29474);
    color: #000;
    font-weight: 600;
}

/* ── Reservierungs-Overlay — 1:1 das Modal der /buchen/-Strecke ──────────
   Klassen und Werte identisch zu theme css/booking-v2.css (cq-bf-hold-*),
   Vorgabe Viktor 26.08.2026: beide Buchungswege sehen gleich aus. Die
   --bf-Variablen kommen dort aus dem Seiten-:root und werden hier lokal
   gescopet, damit die kopierten Regeln auf Raumseiten identisch aufloesen. */
.cq-bf-hold-overlay {
    --bf-elevated: #111111;
    --bf-glass: rgba(255,255,255,0.02);
    --bf-glass-border: rgba(255,255,255,0.1);
    --bf-warn: #d98a3a;
    position: fixed; inset: 0; background: rgba(0,0,0,0.78); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; padding: 1.5rem; z-index: 9999;
}
.cq-bf-hold-overlay.show { display: flex; }
.cq-bf-hold-modal {
    background: var(--bf-elevated); border: 1px solid var(--bf-glass-border);
    max-width: 380px; width: 100%; padding: 2rem 1.8rem; text-align: center;
    color: #fff;
}
.cq-bf-hold-ico { width: 38px; height: 38px; margin: 0 auto 1rem; stroke: var(--gold-light, #C8A886); fill: none; display: block; }
.cq-bf-hold-modal h3 { font-size: 1.05rem; font-weight: 100; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.cq-bf-hold-sub { font-size: 0.72rem; color: rgba(255,255,255,0.5); line-height: 1.6; margin-bottom: 1.3rem; }
.cq-bf-hold-timer { font-size: 2.4rem; font-weight: 100; color: var(--gold-light, #C8A886); letter-spacing: 0.08em; margin-bottom: 0.3rem; font-variant-numeric: tabular-nums; }
.cq-bf-hold-timer.expired { color: var(--bf-warn); }
.cq-bf-hold-timer-l { font-size: 0.5rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 1.5rem; }
.cq-bf-hold-detail { background: var(--bf-glass); border: 1px solid var(--bf-glass-border); padding: 0.9rem 1rem; font-size: 0.72rem; color: rgba(255,255,255,0.7); line-height: 1.7; margin-bottom: 1.4rem; text-align: left; }
.cq-bf-hold-detail b { color: #fff; font-weight: 400; }
.cq-bf-hold-cta { width: 100%; padding: 0.95rem; background: linear-gradient(135deg, var(--gold-dark, #9B7E62), var(--gold-light, #C8A886)); color: #000; cursor: pointer; font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 600; margin-bottom: 0.7rem; border: none; font-family: inherit; }
.cq-bf-hold-cta:disabled { opacity: 0.4; cursor: default; }
.cq-bf-hold-cancel { width: 100%; padding: 0.7rem; font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.45); cursor: pointer; background: none; border: none; font-family: inherit; }
.cq-bf-hold-cancel:hover { color: #fff; }
