/* ===== CART STYLES ===== */

/* Add-to-cart button on each menu item */
.add-to-cart-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: #c41e3a;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
    margin-left: 8px;
}

.add-to-cart-btn:hover {
    background: #e63946;
    transform: scale(1.15);
    box-shadow: 0 2px 10px rgba(196, 30, 58, 0.4);
}

.add-to-cart-btn:active {
    transform: scale(0.95);
}

.add-to-cart-btn.added {
    background: #25D366;
}

/* Red highlight flash when item is added */
.cart-item-flash {
    animation: itemFlashRed 0.7s ease;
}

@keyframes itemFlashRed {
    0% { background-color: transparent; }
    20% { background-color: rgba(196, 30, 58, 0.35); }
    100% { background-color: rgba(196, 30, 58, 0.08); }
}

/* Persistent red tint for items already in cart */
.cart-item-added {
    background-color: rgba(196, 30, 58, 0.25);
    border-radius: 6px;
}

.menu-item.cart-item-flash,
.menu-item.cart-item-added {
    border-radius: 6px;
}

.drink-item.cart-item-flash,
.drink-item.cart-item-added {
    border-radius: 6px;
}

/* Floating cart toggle button */
.cart-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    box-shadow: 0 4px 20px rgba(196, 30, 58, 0.5);
    transition: all 0.3s ease;
}

.cart-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 25px rgba(196, 30, 58, 0.6);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fff;
    color: #c41e3a;
    font-size: 12px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.cart-badge.bump {
    animation: badgeBump 0.3s ease;
}

@keyframes badgeBump {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.cart-badge:empty,
.cart-badge[data-count="0"] {
    display: none;
}

/* Cart overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1199;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Cart panel */
.cart-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    background: #1a1a1a;
    z-index: 1200;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-panel.open {
    transform: translateY(0);
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(196, 30, 58, 0.3);
    flex-shrink: 0;
}

.cart-title {
    color: #fff;
    font-size: 1.1em;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cart-title span {
    color: #c41e3a;
}

.cart-close {
    background: none;
    border: 1px solid rgba(196, 30, 58, 0.4);
    color: #c41e3a;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cart-close:hover {
    background: #c41e3a;
    color: #fff;
}

/* Cart body (scrollable items) */
.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px;
    -webkit-overflow-scrolling: touch;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 0.95em;
    letter-spacing: 1px;
}

.cart-empty-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Individual cart item */
.cart-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 12px;
}

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

.cart-item-image {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.cart-item-name {
    color: #f0f0f0;
    font-size: 0.88em;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    color: #999;
    font-size: 0.78em;
    margin-top: 2px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cart-qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(196, 30, 58, 0.5);
    background: transparent;
    color: #c41e3a;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.cart-qty-btn:hover {
    background: #c41e3a;
    color: #fff;
}

.cart-item-qty {
    color: #fff;
    font-size: 0.95em;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.cart-item-subtotal {
    color: #c41e3a;
    font-size: 0.9em;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.cart-item-delete {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.cart-item-delete:hover {
    color: #e63946;
}

/* Cart footer */
.cart-footer {
    padding: 14px 20px 20px;
    border-top: 1px solid rgba(196, 30, 58, 0.3);
    flex-shrink: 0;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.cart-total-label {
    color: #999;
    font-size: 0.9em;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cart-total-value {
    color: #fff;
    font-size: 1.3em;
    font-weight: 700;
}

.cart-total-value span {
    color: #c41e3a;
}

.cart-actions {
    display: flex;
    gap: 10px;
}

.cart-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.cart-btn-clear {
    background: rgba(255,255,255,0.08);
    color: #999;
    border: 1px solid rgba(255,255,255,0.1);
}

.cart-btn-clear:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.cart-btn-waiter {
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
}

.cart-btn-waiter:hover {
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.5);
    transform: translateY(-1px);
}

/* ===== WAITER VIEW (fullscreen summary) ===== */
.waiter-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111312;
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.waiter-view.active {
    display: flex;
}

.waiter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid #c41e3a;
    flex-shrink: 0;
}

.waiter-title {
    color: #fff;
    font-size: 1.3em;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.waiter-title span {
    color: #c41e3a;
}

.waiter-close {
    background: none;
    border: 2px solid #c41e3a;
    color: #c41e3a;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.waiter-close:hover {
    background: #c41e3a;
    color: #fff;
}

.waiter-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    -webkit-overflow-scrolling: touch;
}

.waiter-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.waiter-item-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.waiter-item-left {
    flex: 1;
    min-width: 0;
}

.waiter-item-name {
    color: #f0f0f0;
    font-size: 1.1em;
    font-weight: 500;
}

.waiter-item-qty {
    color: #999;
    font-size: 0.9em;
    margin-top: 2px;
}

.waiter-item-subtotal {
    color: #c41e3a;
    font-size: 1.2em;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 16px;
}

.waiter-footer {
    padding: 20px 24px;
    border-top: 2px solid #c41e3a;
    flex-shrink: 0;
}

.waiter-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.waiter-total-label {
    color: #fff;
    font-size: 1.2em;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.waiter-total-value {
    color: #c41e3a;
    font-size: 1.8em;
    font-weight: 700;
}

.waiter-note {
    text-align: center;
    margin-top: 16px;
    color: #666;
    font-size: 0.8em;
    letter-spacing: 1px;
}

/* Item count in waiter view */
.waiter-count {
    text-align: center;
    padding: 10px;
    color: #666;
    font-size: 0.85em;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Responsive */
@media (max-width: 768px) {
    .cart-toggle {
        bottom: 30px;
        left: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .cart-panel {
        max-height: 90vh;
    }

    .cart-header {
        padding: 14px 16px 10px;
    }

    .cart-title {
        font-size: 0.95em;
    }

    .cart-body {
        padding: 8px 16px;
    }

    .cart-footer {
        padding: 12px 16px 16px;
    }

    .cart-item-name {
        font-size: 0.82em;
    }

    .add-to-cart-btn {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 16px;
    }

    .waiter-header {
        padding: 16px 18px;
    }

    .waiter-title {
        font-size: 1.05em;
    }

    .waiter-body {
        padding: 16px 18px;
    }

    .waiter-item-name {
        font-size: 1em;
    }

    .waiter-total-value {
        font-size: 1.5em;
    }

    .waiter-footer {
        padding: 16px 18px;
    }
}
