
/* ENHANCED CART MODAL */
.cart-backdrop {
    background: rgba(30,10,5,0.6) !important;
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.cart-backdrop.show {
    display: flex;
    opacity: 1;
}

.cart-flip-container {
    perspective: 1000px;
    width: 100%;
    max-width: 480px;
    margin: 0 20px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.cart-backdrop.show .cart-flip-container {
    transform: translateY(0);
}
.cart-backdrop.show .cart-flip-container.shake-warning {
    animation: shakeWarn 0.4s ease;
}
@keyframes shakeWarn {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.cart-flipper {
    position: relative;
    width: 100%;
    height: auto;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.cart-flipper.flipped {
    transform: rotateY(180deg);
}

.cart-front, .cart-back {
    width: 100%;
    backface-visibility: hidden;
    background: #FFFDF8;
    border-radius: 32px;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    border: 2px solid #F5ECD7;
    position: absolute;
    top: 0; left: 0;
}
.cart-front {
    position: relative;
}
.cart-back {
    transform: rotateY(180deg);
    padding-top: 60px;
}

/* Header */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cart-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #2C1810;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cart-icon-anim {
    display: inline-block;
    animation: bounceIcon 0.5s ease backwards 0.2s;
}
@keyframes bounceIcon {
    0% { transform: scale(0) rotate(-20deg); }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0); }
}
.close-btn {
    background: #FFF0E5;
    border: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: #C0392B;
    cursor: pointer;
    transition: all 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.close-btn:hover {
    background: #C0392B;
    color: white;
    transform: rotate(90deg);
}
.cart-divider {
    height: 1px;
    background: linear-gradient(90deg, #E67E22, transparent);
    margin: 20px 0;
}
.cart-divider.thick { height: 2px; margin: 15px 0; }

/* Empty State */
.empty-cart-state {
    text-align: center;
    padding: 30px 0;
}
.empty-bowl {
    font-size: 4rem;
    display: inline-block;
    animation: rockBowl 3s infinite ease-in-out;
}
@keyframes rockBowl { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
.empty-cart-state h3 { font-family: 'Playfair Display', serif; font-style: italic; color: #2C1810; margin: 10px 0; }
.empty-cart-state p { color: #E67E22; margin-bottom: 25px; }
.floating-bg-emojis {
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}
.f-emoji { position: absolute; font-size: 2rem; opacity: 0; animation: floatUpEmoji 4s infinite linear; }
@keyframes floatUpEmoji { 0% { transform: translateY(100px) rotate(0deg); opacity: 0; } 20% { opacity: 0.3; } 80% { opacity: 0.3; } 100% { transform: translateY(-200px) rotate(180deg); opacity: 0; } }
.btn-explore {
    background: linear-gradient(135deg, #C0392B, #E74C3C);
    color: white; border: none; padding: 12px 24px; border-radius: 50px;
    font-weight: bold; cursor: pointer; animation: gentleBounce 2s infinite;
    transition: all 0.3s;
}
.btn-explore:hover { padding-right: 30px; box-shadow: 0 10px 20px rgba(192,57,43,0.3); }

/* Cart Items */
.cart-items-wrapper {
    max-height: 40vh; overflow-y: auto; padding-right: 5px;
}
.cart-items-wrapper::-webkit-scrollbar { width: 4px; }
.cart-items-wrapper::-webkit-scrollbar-thumb { background: #FFCC80; border-radius: 10px; }

.c-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 0; border-bottom: 1px dashed #E67E22;
    animation: slideInRight 0.4s ease backwards;
    transition: all 0.3s;
}
@keyframes slideInRight { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.c-item-left { display: flex; align-items: center; gap: 15px; flex: 1; }
.c-item-img {
    width: 60px; height: 60px; border-radius: 12px; object-fit: contain;
    background: #FFF8E1; padding: 5px; transition: transform 0.3s; cursor: help;
}
.c-item-img:hover { transform: scale(1.1); }
.c-item-info strong { color: #2C1810; display: block; font-size: 1rem; }
.c-item-info small { color: #7F8C8D; font-size: 0.75rem; }

.qty-ctrl {
    display: flex; align-items: center; gap: 10px;
    background: #FFF8E1; padding: 5px; border-radius: 50px; border: 1px solid #FFE0B2;
}
.qty-btn {
    width: 24px; height: 24px; border-radius: 50%; border: 1px solid #C0392B;
    background: transparent; color: #C0392B; cursor: pointer; font-weight: bold;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.qty-btn:hover { background: #C0392B; color: white; }
.qty-val { font-weight: bold; font-size: 0.9rem; width: 15px; text-align: center; }

.c-item-price { font-weight: bold; color: #C0392B; font-size: 1.1rem; margin-left: 15px; min-width: 60px; text-align: right; }

.c-item-remove {
    background: none; border: none; color: #E74C3C; font-size: 1.2rem;
    margin-left: 10px; cursor: pointer; opacity: 0; transition: all 0.3s; transform: scale(0.5);
}
.c-item:hover .c-item-remove { opacity: 1; transform: scale(1); }

/* Promo & Summary */
.promo-toggle { font-size: 0.9rem; color: #E67E22; cursor: pointer; margin: 15px 0; font-weight: 500; }
.promo-input-container { display: flex; gap: 10px; margin-bottom: 10px; }
.promo-input-container input {
    flex: 1; padding: 10px 15px; border-radius: 50px; border: 1px solid #E67E22; outline: none; font-family: 'Poppins';
}
.promo-input-container button {
    padding: 10px 20px; border-radius: 50px; background: #E67E22; color: white; border: none; cursor: pointer; font-weight: bold;
}
.promo-input-container.shake { animation: shakeError 0.4s; }
@keyframes shakeError { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; color: #7F8C8D; font-size: 0.95rem; }
.delivery-row { color: #E67E22; }
.discount-row { color: #27AE60; font-weight: bold; animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.total-row { font-size: 1.3rem; color: #2C1810; font-family: 'Playfair Display', serif; align-items: flex-end; }
.total-price-col { text-align: right; }
.total-price-col #cart-total-price { color: #C0392B; font-size: 1.6rem; display: block; }
.total-price-col small { font-size: 0.6rem; color: #7F8C8D; font-family: 'Poppins'; display: block; margin-top: -5px; }

/* Checkout Action Area */
.checkout-action-area { margin-top: 20px; }
.btn-checkout-smart {
    width: 100%; padding: 18px; border-radius: 50px; background: linear-gradient(135deg, #E67E22, #C0392B);
    color: white; border: none; font-size: 1.1rem; font-weight: bold; cursor: pointer;
    box-shadow: 0 8px 20px rgba(192,57,43,0.3); transition: all 0.3s;
    display: flex; justify-content: center; align-items: center; gap: 10px;
}
.btn-checkout-smart:hover { transform: scale(1.02); box-shadow: 0 12px 25px rgba(192,57,43,0.4); }
.btn-checkout-smart.logged-in { background: linear-gradient(135deg, #C0392B, #A93226); }

.split-choice-panel {
    background: #FFF8E1; border-radius: 20px; padding: 20px; margin-top: 15px;
    animation: slideDownPanel 0.4s ease forwards; text-align: center;
}
@keyframes slideDownPanel { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.split-choice-panel p { margin-bottom: 15px; color: #2C1810; font-weight: 500; }
.btn-login-choice {
    width: 100%; padding: 14px; border-radius: 50px; background: #C0392B; color: white; border: none; font-weight: bold; cursor: pointer; margin-bottom: 15px;
}
.choice-divider { position: relative; margin: 10px 0 20px 0; text-align: center; }
.choice-divider::before { content: ''; position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: #E67E22; opacity: 0.3; }
.choice-divider span { background: #FFF8E1; padding: 0 10px; position: relative; z-index: 1; color: #E67E22; font-size: 0.8rem; }
.btn-guest-choice {
    width: 100%; padding: 14px; border-radius: 50px; background: transparent; color: #2C1810; border: 2px dashed #E67E22; font-weight: bold; cursor: pointer; margin-bottom: 10px;
}
.split-choice-panel small { color: #7F8C8D; font-size: 0.75rem; }

/* Login Back Panel */
.back-to-cart-btn {
    position: absolute; top: 20px; left: 20px; background: #FFF0E5; border: none; width: 40px; height: 40px; border-radius: 50%; color: #C0392B; cursor: pointer;
}
.login-inner h2 { font-family: 'Playfair Display', serif; color: #C0392B; margin-bottom: 30px; font-size: 2rem; }
.login-inner .input-group { margin-bottom: 20px; position: relative; }
.login-inner .input-group input { width: 100%; padding: 15px; border: 2px solid #FFE0B2; border-radius: 12px; outline: none; }
.login-inner .input-group label { position: absolute; left: 15px; top: 15px; color: #7F8C8D; transition: 0.3s; pointer-events: none; }
.login-inner .input-group input:focus + label, .login-inner .input-group input:not(:placeholder-shown) + label { top: -10px; left: 10px; background: #FFFDF8; padding: 0 5px; font-size: 0.8rem; color: #E67E22; }
.login-inner .forgot-link { text-align: right; margin-bottom: 20px; }
.login-inner .forgot-link a { color: #C0392B; text-decoration: none; font-size: 0.85rem; border-bottom: 1px solid #C0392B; }
.btn-submit-login { width: 100%; padding: 16px; border-radius: 50px; background: linear-gradient(135deg, #C0392B, #E74C3C); color: white; border: none; font-weight: bold; font-size: 1.1rem; cursor: pointer; }
.login-inner .new-here { text-align: center; margin-top: 20px; font-size: 0.9rem; }
.login-inner .new-here a { color: #C0392B; font-weight: bold; }

@media (max-width: 768px) {
    .cart-flip-container { margin: 0; max-width: 100%; transform: translateY(100%); margin-top: auto; }
    .cart-front, .cart-back { border-radius: 32px 32px 0 0; padding: 20px 15px; border-bottom: none; max-height: 85vh; overflow-y: auto; }
    
    .c-item-info strong { font-size: 0.9rem; }
    .c-item-price { font-size: 1rem; margin-left: 5px; min-width: auto; }
    .qty-ctrl { padding: 3px; gap: 5px; }
    .qty-btn { width: 20px; height: 20px; font-size: 0.8rem; }
    
    .promo-input-container { gap: 5px; }
    .promo-input-container input { padding: 10px; font-size: 0.85rem; }
    .promo-input-container button { padding: 10px 15px; font-size: 0.85rem; }
    
    .summary-row { font-size: 0.85rem; flex-wrap: wrap; }
    .tooltiptext { display: none !important; } /* Hide large tooltips on mobile */
    .delivery-row i { margin-left: 5px; }
    
    .total-row { font-size: 1.1rem; }
    .total-price-col #cart-total-price { font-size: 1.3rem; }
    
    .cart-header h2 { font-size: 1.4rem; }
    .close-btn { width: 35px; height: 35px; }
}
