/* 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;
    border: none;
}

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

.cart-fab.active {
    background: #e63946;
    color: white;
    border: none;
}

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

.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: 1.5rem;
}

/* 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);
}

.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;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    color: #666;
}

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

/* 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-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;
}

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

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

.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;
}

.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;
}

/* 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;
}

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

/* 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;
}

/* 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;
}

.nip-container {
    margin-bottom: 15px;
}

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

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

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

.btn-order, .btn-call {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    color: #fff;
}

.btn-order {
    background: #333;
}

.btn-call {
    background: #e63946;
}

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

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

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

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