/* ===== STYLE KOSZYKA ===== */
/* Style dla koszyka i FAB */

/* Floating Action Button (FAB) */
.cart-fab {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 900;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s;
}
/* Szerokie ekrany: FAB w obrębie max-width contentu (800px) */
@media (min-width: 860px) {
    .cart-fab {
        right: calc(50% - 400px + 10px);
    }
}

/* =========================================================
   Switcher stolików (multi-stolik)
   ========================================================= */
.ts-fab{
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 92px; /* obok koszyka */
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 14px rgba(0,0,0,0.16);
    z-index: 905;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.ts-fab:active{ transform: scale(0.96); }
.ts-icon{ font-size: 1.4rem; line-height: 1; }

/* Szerokie ekrany: krzesło wyrównane do prawej krawędzi contentu */
@media (min-width: 860px) {
    /* Krzesło (switcher stolików) -- obok koszyka, zachowany oryginalny odstęp 72px */
    .ts-fab {
        right: calc(50% - 400px + 10px + 72px);
    }
}
.ts-badge{
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #7c3aed;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    border: 2px solid #fff;
}

.ts-overlay{
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 14px;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
}
.ts-overlay.is-hidden{ display:none; }
.ts-panel{
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 28px);
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
}
.ts-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.ts-title{
    font-size: 1.05rem;
    font-weight: 800;
    color: #111827;
}
.ts-close{
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.3rem;
}
.ts-body{
    padding: 12px 16px 16px;
    overflow: auto;
}
.ts-message{
    padding: 10px 12px;
    border-radius: 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #111827;
    font-size: 0.95rem;
    margin-bottom: 12px;
    white-space: pre-line;
}
.ts-message.is-hidden{ display:none; }
.ts-list{ display:flex; flex-direction:column; gap:10px; }
.ts-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding: 12px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
}
.ts-item.is-current{
    background: #f5f3ff; /* wyraźne zaznaczenie aktualnego stolika */
    border-color: rgba(124,58,237,0.35);
}
.ts-item:active{ transform: scale(0.99); }
.ts-item-main{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.ts-item-title{
    font-weight: 800;
    color:#111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ts-item-sub{
    font-size: 0.85rem;
    color:#6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ts-item-right{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.ts-item-stats{ display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.ts-stat{
    font-size: 0.78rem;
    font-weight: 800;
    color:#374151;
    background:#f9fafb;
    border: 1px solid #e5e7eb;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.ts-stat.is-muted{
    font-weight: 700;
    color:#6b7280;
    background:#ffffff;
}
.ts-pill{
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid #e5e7eb;
    color:#374151;
    background:#f9fafb;
}
.ts-pill.is-active{ border-color: rgba(124,58,237,0.35); background: rgba(124,58,237,0.08); color:#5b21b6; }
.ts-dot{
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #7c3aed;
}

.cart-fab.empty {
    background: #d7d7d7d9;
    color: #333;
    border: 2px solid #eee;
}

.cart-fab.active {
    background: #d7d7d7d9;
    color: #333;
    border: 2px solid #eee;
}

.cart-fab:active {
    transform: scale(0.95);
}

/* Animacja przyciągająca uwagę -- odpalana raz przy pierwszym dodaniu do koszyka */
@keyframes cartAttention {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.2); }
    60% { transform: scale(1); }
}
.cart-fab--attention {
    animation: cartAttention 1.2s ease-out;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #333;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.cart-icon {
    font-size: 2rem;
    line-height: 1;
    display: inline-block;
}

.cart-icon.shaking {
    display: inline-block;
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) translateY(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px) translateY(-1px); }
    20%, 40%, 60%, 80% { transform: translateX(2px) translateY(1px); }
}

.cart-counter {
    position: absolute;
    top: 44px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 6px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    border-radius: 10px;
    line-height: 1.1;
    text-shadow: 0 0 4px rgb(0 0 0);
    pointer-events: none;
}

.cart-counter.long {
    font-size: 1.1rem;
}

.order-reaction-time {
    font-size: 0.85rem;
    color: #666;
    margin-left: 6px;
}

/* Komunikaty akcji klienta (bez alert()) */
.client-action-message {
    margin: 10px 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.35;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #111827;
    white-space: pre-line;
}
.client-action-message.is-error {
    background: #fff3f3;
    border-color: #f3b1b1;
    color: #8a1f1f;
}
.client-action-message.is-success {
    background: #f0fff4;
    border-color: #b7f0c0;
    color: #1f6b2c;
}
.client-action-message.is-blocked {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #7c2d12;
}

/* Dostawa: status płatności (aktualizowany automatycznie przez polling) */
.delivery-payment-status{
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.35;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #111827;
    white-space: normal;
}
.delivery-payment-status__title{
    font-weight: 800;
    margin-bottom: 4px;
}
.delivery-payment-status__desc{
    font-weight: 600;
}
.delivery-payment-status__hint{
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
}
.delivery-payment-status.is-pending{
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}
.delivery-payment-status.is-ok{
    background: #f0fff4;
    border-color: #b7f0c0;
    color: #1f6b2c;
}
.delivery-payment-status.is-failed{
    background: #fff3f3;
    border-color: #f3b1b1;
    color: #8a1f1f;
}
.delivery-payment-status.is-warn{
    background: #fff7ed;
    border-color: #fed7aa;
    color: #7c2d12;
}

/* QR do obsługi (pokazujemy przy banie/spamie) */
.client-action-qr {
    margin: -6px 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px dashed #fed7aa;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}
.client-action-qr-text {
    flex: 1;
    min-width: 0;
}
.client-action-qr-title {
    font-weight: 800;
    color: #7c2d12;
    margin-bottom: 4px;
}
.client-action-qr-hint {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.3;
}
.client-action-qr-img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #f1f5f9;
}
@media (max-width: 360px) {
    .client-action-qr-img {
        width: 104px;
        height: 104px;
    }
}

/* Modal Koszyka */
.cart-modal {
    background: #f9f9f9;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.cart-modal.active {
    transform: translateY(0);
}

/* =========================================================
   Dostawa: overlay ładowania statusu po płatności
   ========================================================= */
.cart-loading-overlay{
    position: absolute;
    inset: 0;
    z-index: 1400; /* nad header/body/footer koszyka */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(6px);
}
.cart-loading-overlay.is-hidden{ display:none; }
.cart-loading-overlay__sheet{
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.22);
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
}
.cart-loading-overlay__spinner{
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid #e5e7eb;
    border-top-color: #111827;
    animation: cartLoadingSpin 0.85s linear infinite;
}
.cart-loading-overlay__title{
    font-weight: 800;
    color: #111827;
    font-size: 1.05rem;
}
.cart-loading-overlay__desc{
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.35;
}
@keyframes cartLoadingSpin{
    to { transform: rotate(360deg); }
}

.cart-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.cart-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.cart-title-main {
    white-space: nowrap;
}

.cart-title-context {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.05;
    /* lekki offset, żeby wizualnie centrować względem "Twoje zamówienie" */
    margin-top: 1px;
    min-width: 0;
}

.cart-table-label{
    margin-left: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #4f46e5;
}

.cart-context-switch {
    background: none;
    border: none;
    padding: 0;
    margin: 2px 0 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    text-align: left;
}

.cart-context-switch:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.cart-context-switch:disabled {
    cursor: default;
    opacity: 0.6;
    text-decoration: none;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    color: #666;
}
/* Domyślnie (mobile): tekst ukryty, ikona X widoczna */
.cart-close__text {
    display: none;
}
.cart-close__icon {
    display: inline;
}
/* Desktop: pełny przycisk "Powrót do menu" zamiast X */
@media (min-width: 768px) {
    .cart-close__text {
        display: inline;
    }
    .cart-close__icon {
        display: none;
    }
    .cart-close {
        font-size: 0.9rem;
        font-weight: 600;
        color: #374151;
        background: #f3f4f6;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        padding: 8px 16px;
        transition: background 0.2s, border-color 0.2s;
    }
    .cart-close:hover {
        background: #e5e7eb;
        border-color: #9ca3af;
    }
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Stopka jest teraz kompaktowa - przyciski i summary */
.cart-footer {
    flex-shrink: 0;
}

/* Sekcje w koszyku */
.cart-section {
    margin-bottom: 25px;
}

.cart-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 15px;
    padding-left: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Elementy koszyka (bieżące zamówienie) */
.cart-item {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border: 1px solid #eee;
    flex-wrap: wrap; /* Pozwala elementom zawijać się */
}

.cart-item-info {
    flex: 1;
    min-width: 60%;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 1rem;
    color: #333;
}

.cart-item-options {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 6px;
    font-style: italic;
}

.cart-item-price {
    font-weight: 700;
    color: #e63946;
    margin-bottom: 8px;
}

.cart-item-price--set {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.cart-bundle {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #fff;
}

.cart-item--bundle-head {
    background: #f8fafc;
    border: none;
    border-radius: 0;
}

.cart-bundle-items {
    padding: 8px;
    display: grid;
    gap: 8px;
}

.cart-item--bundle-sub {
    border: 1px solid #eef2f7;
    border-radius: 12px;
}

.cart-item-controls--disabled .qty-btn {
    display: none;
}

.cart-item-price-old {
    color: #8a8a8a;
    text-decoration: line-through;
    font-weight: 700;
}

.cart-item-price-new {
    color: #e63946;
    font-weight: 800;
}

.cart-item-note {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #555;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s;
}

.cart-item-note:focus {
    border-color: #ccc;
    background: #fff;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    color: #333;
    user-select: none;
}

.qty-btn:active {
    background: #f0f0f0;
}

.qty-val {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    color: #333;
}

/* Historia zamówień */
.order-history-item {
    background: #fff;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: hidden;
    border-left: 5px solid #ccc; /* Domyślny kolor (szary) */
}

.order-header-row {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.02);
    border-bottom: 1px solid #eee;
}

.order-id {
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

/* Badge źródła zamówienia (wspólna historia: "Dostawa", "Stolik VIP" itd.) */
.order-context-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #666;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 10px;
    vertical-align: middle;
    white-space: nowrap;
}

/* Podtytuł zamówienia: numer rachunku QR + data */
.order-subtitle {
    padding: 2px 15px 6px;
    font-size: 0.8rem;
    color: #888;
    background: rgba(0,0,0,0.02);
    border-bottom: 1px solid #eee;
}

.order-status {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.order-items-list {
    padding: 15px;
}

/* Akcje zamówienia (np. anulowanie przez klienta) */
.order-actions-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 0 15px;
    margin: 10px 0 0;
}

.btn-cancel-order {
    border: 1px solid rgba(220, 38, 38, 0.35);
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.12), rgba(220, 38, 38, 0.05));
    color: #b91c1c;
    padding: 9px 12px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn-retry-payment {
    border: 1px solid rgba(22, 163, 74, 0.35);
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.12), rgba(22, 163, 74, 0.05));
    color: #166534;
    padding: 9px 12px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn-cancel-order:hover {
    border-color: rgba(220, 38, 38, 0.55);
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.16), rgba(220, 38, 38, 0.07));
}

.btn-retry-payment:hover {
    border-color: rgba(22, 163, 74, 0.55);
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.16), rgba(22, 163, 74, 0.07));
}

.btn-cancel-order:active {
    transform: translateY(1px);
}

.btn-retry-payment:active {
    transform: translateY(1px);
}

.btn-cancel-order:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-retry-payment:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 480px) {
    .order-actions-row {
        justify-content: stretch;
    }
    .btn-cancel-order {
        width: 100%;
        text-align: center;
    }
    .btn-retry-payment {
        width: 100%;
        text-align: center;
    }
}

.order-dish-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.order-dish-row:last-child {
    margin-bottom: 0;
}

/* Koszt dostawy w liście pozycji -- lekko wyciszony, z separatorem */
.order-dish-row--fee {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #ddd;
    color: #888;
    font-size: 0.88rem;
}

.order-dish-name {
    color: #333;
    flex: 1;
    padding-right: 10px;
}

.order-item-options {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

.order-item-note {
    font-size: 0.8rem;
    color: #888;
    margin-top: 3px;
    font-style: italic;
}

.order-dish-price {
    font-weight: 600;
    color: #555;
}

/* Anulowane/Odrzucone pozycje w historii */
.dish-cancelled .order-dish-name,
.dish-cancelled .order-dish-price {
    text-decoration: line-through;
    color: #999;
}

/* =====================================================
   Feedback klienta (oceny + wiadomość)
   ===================================================== */

.client-feedback-section {
    display: none; /* domyślnie ukryte; JS pokazuje tylko gdy feedback jest dozwolony */
}

.cf-dish-rating {
    margin-top: 6px;
}

.cf-stars {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.cf-star {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 1.15rem;
    line-height: 1;
    color: #bdbdbd;
    cursor: pointer;
    user-select: none;
}

.cf-star.is-on {
    color: #f5b301;
}

.cf-stars.is-disabled .cf-star,
.cf-star:disabled {
    cursor: default;
    opacity: 0.65;
}

.client-feedback-section .cf-block {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 12px;
}

.client-feedback-section .cf-label {
    font-weight: 700;
    color: #444;
    margin-bottom: 10px;
}

.client-feedback-section .cf-muted {
    color: #666;
    font-size: 0.95rem;
}

.cf-waiter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.cf-waiter-row:last-child {
    border-bottom: none;
}

.cf-waiter-meta {
    min-width: 0;
}
.cf-waiter-name {
    font-weight: 800;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cf-waiter-sub {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

.cf-message-input {
    width: 100%;
    min-height: 96px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.35;
    outline: none;
    resize: vertical;
}
.cf-message-input:focus {
    border-color: #667eea;
}

.cf-message-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.cf-message-count {
    font-size: 0.85rem;
    color: #666;
}

.cf-message-send {
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: #667eea;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}
.cf-message-send:disabled {
    cursor: default;
    opacity: 0.7;
}

.cf-inline-message {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.35;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #111827;
    white-space: pre-line;
}
.cf-inline-message.is-error {
    background: #fff3f3;
    border-color: #f3b1b1;
    color: #8a1f1f;
}
.cf-inline-message.is-success {
    background: #f0fff4;
    border-color: #b7f0c0;
    color: #1f6b2c;
}

/* Kolory stanów zamówień */
/* 1. Szary – złożone, niepotwierdzone */
.status-pending {
    border-left-color: #999;
}
.status-pending .order-status {
    background: #eee;
    color: #666;
}

/* 1b. Szary – zamówione (potwierdzone) */
.status-ordered {
    border-left-color: #b0b0b0;
}
.status-ordered .order-status {
    background: #f2f2f2;
    color: #444;
}

/* 2. Żółty – w trakcie realizacji */
.status-processing {
    border-left-color: #f1c40f;
}
.status-processing .order-status {
    background: #fff3cd;
    color: #856404;
}

/* 2b. Niebieski – w doręczeniu (kurier przejął zamówienie) */
.status-in-transit {
    border-left-color: #2d7ff9;
}
.status-in-transit .order-status {
    background: #e7f1ff;
    color: #154a9a;
}

/* 3. Zielony (nieopłacone) – wydane */
.status-delivered {
    border-left-color: #2ecc71;
}
.status-delivered .order-status {
    background: #d4edda;
    color: #155724;
}

/* 4. Zielony (opłacone) */
.status-paid {
    border-left-color: #27ae60;
}
.status-paid .order-status {
    background: #c3e6cb;
    color: #0f5132;
}

/* 5. Czerwony – anulowane / odrzucone */
.status-cancelled {
    border-left-color: #c0392b;
}
.status-cancelled .order-status {
    background: #f8d7da;
    color: #842029;
}

/* Stopka koszyka */
.cart-footer {
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    border-top: 1px solid #eee;
    background: #fff;
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

.billing-container {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.billing-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

.billing-input:focus {
    border-color: #667eea;
}

.billing-input.is-invalid {
    border-color: rgba(220, 53, 69, 0.65);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.10);
}

.billing-inline-error {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(220, 53, 69, 0.35);
    background: rgba(220, 53, 69, 0.08);
    color: #8a1c2c;
    font-size: 0.9rem;
    line-height: 1.35;
    white-space: pre-line;
}

.delivery-container {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Dostawa / Odbiór osobisty (przełącznik) */
.delivery-mode{
    display:flex;
    gap: 8px;
    margin: 0;
    padding: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.7);
}
.delivery-mode__option{
    flex: 1 1 50%;
    display:flex;
    align-items:center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fff;
    cursor: pointer;
    user-select:none;
}
.delivery-mode__option input{
    width: 18px;
    height: 18px;
}
.delivery-mode.is-disabled{
    opacity: 0.6;
}
.delivery-mode.is-disabled .delivery-mode__option{
    cursor: not-allowed;
}
.delivery-mode.is-disabled .delivery-mode__option input{
    pointer-events: none;
}

/* Checkbox "Zapisz adres dostawy w przeglądarce" */
.delivery-remember{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
    margin-top: 6px;
}
.delivery-remember input[type="checkbox"]{
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
}

/* Regulamin + polityka prywatności (1 checkbox) */
.delivery-terms{
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.85);
    font-size: 0.92rem;
    color: #111827;
    cursor: pointer;
    user-select: none;
    margin-top: 6px;
}
.delivery-terms input[type="checkbox"]{
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
    cursor: pointer;
    margin-top: 2px;
}
.delivery-terms a{
    color: #2563eb;
    font-weight: 800;
    text-decoration: none;
}
.delivery-terms a:hover{
    text-decoration: underline;
}
.delivery-terms.is-invalid{
    border-color: rgba(220, 53, 69, 0.65);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.10);
}

.delivery-info {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.28);
    background: rgba(102, 126, 234, 0.08);
    color: #1f2a6b;
    font-size: 0.95rem;
    line-height: 1.35;
    white-space: pre-line;
}

.delivery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 520px) {
    .delivery-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Pole formularza z labelem */
.delivery-field {
    display: flex;
    flex-direction: column;
}

.delivery-field--full {
    grid-column: 1 / -1;
}

.delivery-field__label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* Grid adresowy - chowamy przy pickup */
.delivery-grid--address.is-collapsed {
    display: none;
}

.delivery-input,
.delivery-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

.delivery-textarea {
    resize: vertical;
    min-height: 74px;
}

.delivery-input:focus,
.delivery-textarea:focus {
    border-color: #667eea;
}

.delivery-input.is-invalid,
.delivery-textarea.is-invalid {
    border-color: rgba(220, 53, 69, 0.65);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.10);
}

/* Presety napiwku */
.tip-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.tip-preset {
    flex: 1 1 auto;
    min-width: 52px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #f9fafb;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-align: center;
}
.tip-preset:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}
.tip-preset.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.delivery-inline-error {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(220, 53, 69, 0.35);
    background: rgba(220, 53, 69, 0.08);
    color: #8a1c2c;
    font-size: 0.9rem;
    line-height: 1.35;
    white-space: pre-line;
}

.delivery-label{
    font-size: 0.9rem;
    font-weight: 800;
    color: #111827;
    margin: 8px 0 6px;
}

/* delivery-address-toggle - usunięto, pola adresu zawsze widoczne */

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.call-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-order, .btn-call, .btn-cancel-call {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.btn-cancel-call {
    background: #374151;
    font-size: 1.05rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.1;
}

.btn-order {
    background: #333;
}

.btn-pay-order {
    background: #16a34a; /* zielony (CTA) */
}

.btn-pay-order.btn-pay-order--retry{
    background: #059669; /* mocniejszy zielony dla ponowienia */
}

.btn-call {
    background: #e63946;
}

.btn-order:hover, .btn-call:hover, .btn-cancel-call:hover {
    opacity: 0.9;
}

.btn-order:disabled, .btn-call:disabled, .btn-cancel-call:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.call-cancel-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cancel-label {
    font-size: 1.02rem;
}

.cancel-time {
    font-size: 0.9rem;
    color: #e5e7eb;
    letter-spacing: 0.03em;
}

/* Pusty stan */
.empty-cart-msg {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-cart-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

/* =========================================================
   Zamówienie poza godzinami – modal akceptacji (always_active)
   ========================================================= */
.oh-accept{
    position: fixed;
    inset: 0;
    z-index: 2000; /* nad koszykiem */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 14px;
    background: rgba(0,0,0,0.40);
    backdrop-filter: blur(6px);
}
.oh-accept.is-hidden{ display:none; }
.oh-accept__sheet{
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 28px);
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0,0,0,0.25);
    padding: 16px;
}
.oh-accept__title{
    font-size: 1.05rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 10px;
}
.oh-accept__body{
    font-size: 0.95rem;
    line-height: 1.35;
    color: #374151;
    white-space: pre-line;
}
.oh-accept__actions{
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
}
.oh-accept__btn{
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
}
.oh-accept__btn--cancel{
    background: #f3f4f6;
    color: #111827;
}
.oh-accept__btn--confirm{
    background: #7c3aed;
    color: #fff;
}

/* Dostawa: dane adresowe w historii rachunku */
.order-delivery-info{
    margin: 8px 0 10px;
    padding: 8px 10px;
    border: 1px solid rgba(0,0,0,0.06);
    background: rgba(0,0,0,0.02);
    border-radius: 12px;
}
.order-delivery-line{
    font-size: 0.92rem;
    line-height: 1.25;
    color: #374151;
}
.order-delivery-muted{
    color: #6b7280;
    font-size: 0.9em;
}

/* Zablokowane przyciski dodawania (gdy dostawa/odbiór nieaktywne) */
.is-disabled-delivery,
.is-disabled-delivery:hover{
    opacity: 0.45;
    cursor: not-allowed !important;
    pointer-events: none;
}
