
/* --- Стили современной корзины --- */
.cart-items-container {
    padding-bottom: 140px; /* Увеличенное пространство для 2-рядной фиксированной панели оформления */
}

.modern-cart-item {
    display: flex;
    background: white;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.modern-cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    margin-right: 15px;
    background-color: #f5f5f5;
}

/* Fix for SVG placeholders in cart to prevent distortion/cropping */
img.cart-item-img[src$=".svg"] {
    object-fit: contain;
    padding: 10px;
    background-color: transparent;
    box-sizing: border-box;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 700;
    color: #3e2723;
    font-size: 16px;
    margin-bottom: 4px;
}

.cart-item-meta {
    font-size: 13px;
    color: #8d6e63;
    margin-bottom: 8px;
}

.cart-item-price {
    font-weight: 700;
    color: #5d4037;
    font-size: 15px;
}

.cart-quantity-controls {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 4px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #3e2723;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px; /* Larger symbol */
    touch-action: manipulation; /* Optimizes for touch */
}

.qty-btn:active {
    transform: scale(0.9);
    background-color: #f0f0f0;
}

.qty-val {
    margin: 0 15px;
    font-weight: 600;
    font-size: 16px;
    color: #3e2723;
    min-width: 20px;
    text-align: center;
}

.cart-remove-btn {
    margin-left: 15px;
    color: #ff5252;
    background: rgba(255, 82, 82, 0.1);
    border: none;
    cursor: pointer;
    opacity: 1;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-remove-btn:hover {
    background: rgba(255, 82, 82, 0.2);
    transform: scale(1.1);
}

.cart-remove-btn:hover {
    opacity: 1;
}

/* Фиксированная нижняя панель оформления - Обновлено для 2 рядов */
.fixed-checkout-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 12px 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 2000;
    display: flex;
    flex-direction: column; /* Разместить опции над итогом */
    gap: 12px;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.05);
    box-sizing: border-box;
}

.fixed-bar-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.fixed-bar-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.checkout-summary-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #5d4037;
    margin-bottom: 0;
    line-height: 1.2;
    min-width: 100px;
}

.checkout-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 18px;
    color: #3e2723;
    margin-bottom: 0;
    line-height: 1.2;
}

.checkout-btn-main {
    background: linear-gradient(135deg, #5d4037 0%, #3e2723 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    width: auto;
    min-width: 120px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(62, 39, 35, 0.3);
    transition: all 0.3s;
    margin-top: 0;
}

.checkout-btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(62, 39, 35, 0.4);
}

/* Компактный переключатель типа заказа */
.dining-toggle-compact {
    background: #f0f0f0;
    border-radius: 8px;
    padding: 3px;
    display: flex;
    position: relative;
    width: 140px;
    height: 32px;
}

.dining-option-compact {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: #757575;
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.dining-option-compact.active {
    color: #3e2723;
    text-decoration: none;
}

.dining-slider-compact {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 1;
}

/* Компактный переключатель оплаты */
.payment-toggle-compact {
    display: flex;
    gap: 8px;
    align-items: center;
}

.payment-option-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #5d4037;
    cursor: pointer;
    padding: 4px 8px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.payment-option-compact:has(input:checked) {
    background: #efebe9;
    border-color: #d7ccc8;
    color: #3e2723;
    font-weight: 600;
}

.payment-radio-compact {
    accent-color: #3e2723;
    margin: 0;
}

/* Скрыть FAB на странице корзины для предотвращения перекрытия */
.fab-cart {
    display: none !important;
}

@media (max-width: 400px) {
    .fixed-checkout-bar {
        bottom: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 10px 12px;
    }
    
    .dining-toggle-compact {
        width: 130px;
    }
    
    .payment-option-compact span {
        display: none; /* Скрыть текст на очень маленьких экранах при необходимости, или оставить коротким */
    }
    
    .payment-option-compact span {
        display: inline; /* Оставить видимым */
        font-size: 11px;
    }
}

/* Блок допродаж */
.upsell-block {
    margin-top: 30px;
    margin-bottom: 20px;
}

.upsell-title {
    font-size: 16px;
    font-weight: 700;
    color: #3e2723;
    margin-bottom: 15px;
}

.upsell-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.upsell-card {
    min-width: 140px;
    background: white;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.upsell-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
}

/* Fix for SVG placeholders in upsell to prevent distortion */
img.upsell-img[src$=".svg"] {
    object-fit: contain;
    padding: 8px;
    background-color: transparent;
    box-sizing: border-box;
}

.upsell-name {
    font-size: 13px;
    font-weight: 600;
    color: #3e2723;
    margin-bottom: 4px;
    line-height: 1.2;
}

.upsell-price {
    font-size: 12px;
    color: #8d6e63;
    margin-bottom: 8px;
}

.upsell-add-btn {
    background: #f5f5f5;
    border: none;
    color: #3e2723;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.upsell-add-btn:hover {
    background: #e0e0e0;
}

/* Time Selection Chips */
.time-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.time-chip {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    color: #5d4037;
    cursor: pointer;
    transition: all 0.2s;
}

.time-chip.active {
    background: #5d4037;
    color: white;
    border-color: #5d4037;
}

.custom-time-picker {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: none;
}

/* Time Slots Grid */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
}

.time-slot-chip {
    padding: 8px 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    color: #5d4037;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.time-slot-chip:hover {
    border-color: #8d6e63;
    background: #fff8f6;
}

.time-slot-chip.active {
    background: #5d4037;
    color: white;
    border-color: #5d4037;
    font-weight: 600;
}

.time-slot-chip.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f0f0f0;
    color: #aaa;
}
