/* ==========================================================================
   Samowar Tischreservierung Pro – Frontend
   Design-Engineering: Custom-Easing, Mikro-Interaktionen, sanftes Popup.
   ========================================================================== */

:root {
    /* Starke Custom-Kurven – die CSS-Standard-Easings wirken kraftlos */
    --sr-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --sr-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    /* Semantische z-index-Stufen */
    --sr-z-button: 2147483640;
    --sr-z-overlay: 2147483645;
}

/* ── Schwebender Button ───────────────────────────────────────────────────── */

.samowar-resv-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: var(--sr-z-button);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 14px 22px;
    border: none;
    border-radius: 12px;            /* leicht abgerundet */
    background: var(--sr-bg, #8b1a1a) !important;
    color: var(--sr-fg, #fff) !important;
    font-family: var(--sr-font, inherit) !important;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 10px 24px -8px rgba(0, 0, 0, 0.45);
    transition: transform 180ms var(--sr-ease-out), box-shadow 180ms var(--sr-ease-out);
    animation: sr-fab-in 440ms var(--sr-ease-out);
}

@keyframes sr-fab-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}

.samowar-resv-fab:active {
    transform: scale(0.97);   /* spürbares Press-Feedback */
}

.samowar-resv-fab__icon {
    flex-shrink: 0;
}

/* ── Inline-Button (Shortcode / eigene Stellen) ───────────────────────────── */

.samowar-resv-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 22px;
    border: none;
    border-radius: 12px;
    background: var(--sr-bg, #8b1a1a) !important;
    color: var(--sr-fg, #fff) !important;
    font-family: var(--sr-font, inherit) !important;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: transform 160ms var(--sr-ease-out), box-shadow 160ms var(--sr-ease-out);
}

.samowar-resv-btn:active {
    transform: scale(0.97);
}

/* Hover nur auf echten Zeigegeräten (verhindert Klebe-Hover auf Touch) */
@media (hover: hover) and (pointer: fine) {
    .samowar-resv-fab:hover {
        transform: translateY(-2px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), 0 16px 34px -10px rgba(0, 0, 0, 0.5);
    }
    .samowar-resv-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.35);
    }
}

.samowar-resv-fab:focus-visible,
.samowar-resv-btn:focus-visible,
.samowar-resv-close:focus-visible {
    outline: 2px solid var(--sr-bg, #8b1a1a);
    outline-offset: 3px;
}

/* ── Overlay (Backdrop) ───────────────────────────────────────────────────── */

.samowar-resv-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--sr-z-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(12, 12, 14, 0.55);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    backdrop-filter: blur(6px) saturate(120%);
    opacity: 0;
    visibility: hidden;
    /* Schließen (Exit) – etwas schneller als das Öffnen */
    transition: opacity 200ms var(--sr-ease-out), visibility 0s linear 200ms;
}

/* Fallback, falls JS deaktiviert ist: Popup bleibt erreichbar */
.samowar-resv-overlay[hidden] {
    display: flex;
}

.samowar-resv-overlay.is-open {
    opacity: 1;
    visibility: visible;
    /* Öffnen (Enter) */
    transition: opacity 260ms var(--sr-ease-out), visibility 0s;
}

/* ── Modal ────────────────────────────────────────────────────────────────── */

.samowar-resv-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.3), 0 30px 70px -20px rgba(0, 0, 0, 0.5);
    /* Nichts erscheint aus dem Nichts: Start bei 0.96, nicht 0.
       Leichter Blur, der beim Öffnen „scharfstellt" – maskiert die Überblendung. */
    transform: translateY(10px) scale(0.96);
    opacity: 0;
    filter: blur(8px);
    will-change: transform, opacity, filter;
    transition: transform 200ms var(--sr-ease-out), opacity 200ms var(--sr-ease-out), filter 200ms var(--sr-ease-out);
}

.samowar-resv-overlay.is-open .samowar-resv-modal {
    transform: none;
    opacity: 1;
    filter: blur(0);
    transition: transform 300ms var(--sr-ease-out), opacity 240ms var(--sr-ease-out), filter 260ms var(--sr-ease-out);
}

.samowar-resv-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.samowar-resv-title {
    font-family: var(--sr-font, inherit);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: #1a1a1a;
}

.samowar-resv-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    margin: -6px -6px -6px 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #6b6b6b;
    cursor: pointer;
    transition: background 160ms var(--sr-ease-out), color 160ms var(--sr-ease-out), transform 160ms var(--sr-ease-out);
}

.samowar-resv-close:active {
    transform: scale(0.9);
}

@media (hover: hover) and (pointer: fine) {
    .samowar-resv-close:hover {
        background: rgba(0, 0, 0, 0.06);
        color: #1a1a1a;
    }
}

.samowar-resv-body {
    padding: 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Zweite Ebene: Inhalt setzt minimal verzögert nach (Stagger-Gefühl) */
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 200ms var(--sr-ease-out), transform 200ms var(--sr-ease-out);
}

.samowar-resv-overlay.is-open .samowar-resv-body {
    opacity: 1;
    transform: none;
    transition: opacity 320ms var(--sr-ease-out) 90ms, transform 320ms var(--sr-ease-out) 90ms;
}

.samowar-resv-body::-webkit-scrollbar {
    width: 10px;
}
.samowar-resv-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    border: 3px solid #fff;
}

body.samowar-resv-noscroll {
    overflow: hidden;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .samowar-resv-fab {
        right: 16px;
        bottom: 16px;
        padding: 13px 18px;
        font-size: 15px;
    }
    .samowar-resv-modal {
        max-width: 100%;
        max-height: 90vh;
    }
}

/* ── Reduced Motion: Bewegung raus, Überblendung bleibt ───────────────────── */

@media (prefers-reduced-motion: reduce) {
    .samowar-resv-fab {
        animation: none;
    }
    .samowar-resv-fab,
    .samowar-resv-btn,
    .samowar-resv-close {
        transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
    }
    .samowar-resv-fab:hover,
    .samowar-resv-fab:active,
    .samowar-resv-btn:hover,
    .samowar-resv-btn:active,
    .samowar-resv-close:active {
        transform: none;
    }
    .samowar-resv-overlay {
        transition: opacity 160ms ease, visibility 0s linear 160ms;
    }
    .samowar-resv-overlay.is-open {
        transition: opacity 160ms ease, visibility 0s;
    }
    .samowar-resv-modal,
    .samowar-resv-overlay.is-open .samowar-resv-modal {
        transform: none;
        filter: none;
        transition: opacity 160ms ease;
    }
    .samowar-resv-body,
    .samowar-resv-overlay.is-open .samowar-resv-body {
        transform: none;
        transition: opacity 160ms ease;
    }
}
