/* ==========================================================================
   Samowar Restaurant Menu – Frontend
   ========================================================================== */

.samowar-speisekarte,
.samowar-getraenkekarte {
    max-width: 820px;
    margin: 0 auto;
    font-family: inherit;
    color: inherit;
}

/* ── Kostform-Filter ──────────────────────────────────────────────────────── */

.samowar-diet-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 36px;
}

.samowar-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 22px;
    border: 2px solid #8b1a1a;
    background: transparent;
    color: #8b1a1a;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: background 0.22s ease, color 0.22s ease;
    line-height: 1.3;
}

.samowar-filter-btn:hover,
.samowar-filter-btn.active {
    background: #8b1a1a;
    color: #fff;
}

/* ── Kategorie-Abschnitt ─────────────────────────────────────────────────── */

.samowar-category-section,
.samowar-drink-category-section {
    margin-bottom: 44px;
}

.samowar-category-title {
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8b1a1a;
    padding-bottom: 10px;
    border-bottom: 2px solid #8b1a1a;
    margin: 0 0 18px;
}

/* ── Speise-Zeile ─────────────────────────────────────────────────────────── */

.samowar-dish-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: opacity 0.25s ease;
}

.samowar-dish-item:last-child {
    border-bottom: none;
}

.samowar-dish-info {
    flex: 1;
    min-width: 0;
}

.samowar-dish-name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
}

.samowar-dish-description {
    display: block;
    font-size: 0.85rem;
    color: #777;
    font-style: italic;
    margin-top: 3px;
    line-height: 1.4;
}

.samowar-dish-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding-top: 2px;
}

.samowar-dish-price {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}

/* ── Foto-Button ──────────────────────────────────────────────────────────── */

.samowar-photo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: 1.5px solid #ccc;
    border-radius: 50%;
    cursor: pointer;
    color: #888;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.samowar-photo-btn:hover {
    border-color: #8b1a1a;
    color: #8b1a1a;
    background: rgba(139, 26, 26, 0.06);
}

/* ── Getränke-Zeile ───────────────────────────────────────────────────────── */

.samowar-drink-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.samowar-drink-item:last-child {
    border-bottom: none;
}

.samowar-drink-info {
    flex: 1;
    min-width: 0;
}

.samowar-drink-name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
}

.samowar-drink-description {
    display: block;
    font-size: 0.85rem;
    color: #777;
    margin-top: 4px;
    line-height: 1.5;
}

/* Langer Beschreibungstext (z.B. Weine) – vollen Block nutzen */
.samowar-drink-description p {
    margin: 4px 0 0;
}

.samowar-drink-prices {
    flex-shrink: 0;
    text-align: right;
}

.samowar-drink-price {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}

/* ── Preistabelle (mehrere Varianten, z.B. Wodka) ─────────────────────────── */

.samowar-price-variants {
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 110px;
}

.samowar-price-variants td {
    padding: 2px 0 2px 10px;
}

.samowar-price-variants tr td:first-child {
    padding-left: 0;
    color: #777;
    white-space: nowrap;
}

.samowar-variant-price {
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
}

/* ── Filter: ausgeblendete Elemente ──────────────────────────────────────── */

.samowar-dish-item.samowar-hidden {
    display: none;
}

.samowar-category-section.samowar-section-empty {
    display: none;
}

/* ── Allergene / Zusatzstoff-Badges ──────────────────────────────────────── */

.samowar-badge {
    position: relative;
    display: inline-block;
    font-size: 0.6em;
    font-weight: 700;
    vertical-align: super;
    line-height: 1;
    margin-left: 1px;
    color: #8b1a1a;
    cursor: help;
    white-space: nowrap;
}

/* Tooltip-Pfeil */
.samowar-badge::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(25, 25, 25, 0.92);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 10001;
}

/* Tooltip-Box */
.samowar-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(25, 25, 25, 0.92);
    color: #fff;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.45;
    padding: 6px 10px;
    border-radius: 5px;
    white-space: normal;
    width: max-content;
    max-width: 230px;
    text-align: left;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 10000;
}

/* Sichtbar bei Hover (Desktop) und is-active (Touch) */
.samowar-badge:hover::before,
.samowar-badge:hover::after,
.samowar-badge.is-active::before,
.samowar-badge.is-active::after {
    opacity: 1;
}

/* Tooltip kippt nach rechts wenn Badge am linken Rand ist */
.samowar-badge:first-of-type::after {
    left: 0;
    transform: none;
}
.samowar-badge:first-of-type::before {
    left: 8px;
    transform: none;
}

/* ── Legende ──────────────────────────────────────────────────────────────── */

.samowar-legend {
    margin-top: 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 16px;
}

.samowar-legend-details {
    margin-bottom: 10px;
}

.samowar-legend-summary {
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: #666;
    letter-spacing: 0.02em;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.samowar-legend-summary::-webkit-details-marker {
    display: none;
}

.samowar-legend-summary::before {
    content: '▸';
    font-size: 0.8em;
    transition: transform 0.2s;
    display: inline-block;
}

details[open] .samowar-legend-summary::before {
    transform: rotate(90deg);
}

.samowar-legend-body {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 14px 0 6px;
}

.samowar-legend-section {
    flex: 1;
    min-width: 240px;
}

.samowar-legend-section strong {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #555;
    margin-bottom: 8px;
}

.samowar-legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
    color: #555;
    line-height: 1.8;
}

.samowar-legend-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.samowar-legend-key {
    display: inline-block;
    min-width: 22px;
    font-weight: 700;
    color: #8b1a1a;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.samowar-legend-disclaimer {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    margin: 6px 0 0;
}

/* ── Foto-Popup Overlay ───────────────────────────────────────────────────── */

.samowar-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.samowar-popup-overlay.is-active {
    opacity: 1;
    pointer-events: all;
}

.samowar-popup-inner {
    position: relative;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    max-width: 500px;
    width: 92%;
    transform: scale(0.88);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.samowar-popup-overlay.is-active .samowar-popup-inner {
    transform: scale(1);
}

#samowar-popup-img {
    width: 100%;
    height: auto;
    max-height: 65vh;
    object-fit: cover;
    display: block;
}

#samowar-popup-title {
    margin: 0;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    border-top: 1px solid #eee;
    color: inherit;
}

.samowar-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    padding: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.samowar-popup-close:hover {
    background: rgba(0, 0, 0, 0.82);
}

/* Fortschrittsbalken zeigt die 3-Sekunden-Zeit an */
.samowar-popup-progress {
    height: 3px;
    background: #8b1a1a;
    width: 100%;
    transform-origin: left;
    animation: samowarProgress 3s linear forwards;
}

@keyframes samowarProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

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

@media (max-width: 600px) {
    .samowar-filter-btn {
        padding: 7px 16px;
        font-size: 0.82rem;
    }

    .samowar-dish-item,
    .samowar-drink-item {
        flex-wrap: wrap;
    }

    .samowar-dish-meta,
    .samowar-drink-prices {
        width: 100%;
        justify-content: flex-end;
    }
}
