/* Overlay Styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    visibility: hidden;
    opacity: 0;
    z-index: 999;
    transition: visibility 0.3s ease, opacity 0.3s ease;
}

.overlay.active {
    visibility: visible;
    opacity: 1;
    z-index: 8888;
}

/* Cart Sidebar Styles */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -800px;
    width: 800px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.cart-sidebar.open {
    right: 0;
    z-index: 9999;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0e3d6;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cart-header h3 {
    font-size: 1.3rem;
    color: #1e3a2f;
}

.cart-header h3 span {
    font-size: 0.9rem;
    color: #6b6b64;
}

/* Two Column Layout */
.cart-two-columns {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* LEFT COLUMN - Recommendations */
.cart-left {
    width: 35%;
    background: #fefaf5;
    border-right: 1px solid #f0e3d6;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.recommendations-section {
    padding: 20px 16px;
    flex: 1;
}

.rec-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: #c57f1e;
}

.rec-header i {
    font-size: 1.2rem;
}

.rec-header h4 {
    font-size: 1rem;
    color: #1e3a2f;
    margin: 0;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    border: 1px solid #f0e3d6;
    transition: 0.2s;
}

.rec-item:hover {
    transform: translateX(4px);
    border-color: #c57f1e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.rec-icon {
    font-size: 2rem;
    background: #eae1d3;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.rec-info {
    flex: 1;
}

.rec-name {
    font-weight: 600;
    color: #1e3a2f;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.rec-price {
    font-size: 0.8rem;
    color: #c57f1e;
    font-weight: 600;
    margin-bottom: 8px;
}

.rec-add-btn {
    background: #1e3a2f;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.2s;
    width: auto;
}

.rec-add-btn:hover {
    background: #c57f1e;
    transform: scale(1.02);
}

/* RIGHT COLUMN - Cart Items & Summary */
.cart-right {
    width: 65%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Cart Items Section */
.cart-items-section {
    flex: 1;
    padding: 20px 20px;
    overflow-y: auto;
    max-height: 55vh;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fefaf5;
    border-radius: 12px;
    border: 1px solid #f0e3d6;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: #1e3a2f;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.cart-item-unit {
    font-size: 0.65rem;
    color: #6b6b64;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    background: #f0e3d6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    color: #1e3a2f;
    transition: 0.2s;
}

.qty-btn:hover {
    background: #c57f1e;
    color: white;
}

.cart-item-price {
    font-weight: 700;
    color: #c57f1e;
    min-width: 70px;
    text-align: right;
    font-size: 0.85rem;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #c57f1e;
    cursor: pointer;
    padding: 4px;
    transition: 0.2s;
}

.cart-item-remove:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #6b6b64;
}

/* Order Summary Section */
.cart-summary {
    padding: 16px 20px;
    background: #fefaf5;
    border-top: 1px solid #f0e3d6;
    margin-top: auto;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: #5a6557;
    font-size: 0.85rem;
}

.summary-row.total {
    font-weight: 800;
    font-size: 1rem;
    color: #1e3a2f;
    border-top: 1px solid #f0e3d6;
    margin-top: 6px;
    padding-top: 10px;
}

.checkout-btn {
    width: 100%;
    background: #c57f1e;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 40px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 12px;
}

.checkout-btn:hover {
    background: #9b6017;
    transform: translateY(-2px);
}

.free-shipping-note {
    font-size: 0.65rem;
    text-align: center;
    margin-top: 10px;
    color: #5a6557;
}

/* Scrollbar Styling */
.cart-sidebar::-webkit-scrollbar,
.cart-items-section::-webkit-scrollbar,
.cart-left::-webkit-scrollbar {
    width: 4px;
}

.cart-sidebar::-webkit-scrollbar-track,
.cart-items-section::-webkit-scrollbar-track,
.cart-left::-webkit-scrollbar-track {
    background: #f0e3d6;
}

.cart-sidebar::-webkit-scrollbar-thumb,
.cart-items-section::-webkit-scrollbar-thumb,
.cart-left::-webkit-scrollbar-thumb {
    background: #c57f1e;
    border-radius: 4px;
}

/* Toast Message */
.toast-msg {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #1e3a2f;
    color: white;
    padding: 12px 24px;
    border-radius: 40px;
    z-index: 1100;
    font-size: 0.85rem;
    animation: slideUp 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cart Count Animation */
.cart-count-pop {
    animation: countPop 0.3s ease-out;
}

@keyframes countPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); background: #f7c35c; }
    100% { transform: scale(1); }
}

/* Cart Icon Animation */
.cart-icon-bounce {
    animation: cartBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes cartBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); color: #c57f1e; }
    50% { transform: scale(1.1); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 900px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-two-columns {
        flex-direction: column;
    }
    
    .cart-left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f0e3d6;
        max-height: 40vh;
    }
    
    .cart-right {
        width: 100%;
    }
    
    .recommendations-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .rec-item {
        min-width: 200px;
        flex-shrink: 0;
    }
    
    .rec-item:hover {
        transform: translateY(-2px);
        transform: translateX(0);
    }
    
    .cart-items-section {
        max-height: 40vh;
    }
    
    .toast-msg {
        left: 16px;
        right: 16px;
        bottom: 16px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cart-header {
        padding: 16px 20px;
    }
    
    .cart-header h3 {
        font-size: 1.1rem;
    }
    
    .cart-items-section {
        padding: 16px;
    }
    
    .cart-summary {
        padding: 12px 16px;
    }
    
    .rec-item {
        min-width: 180px;
    }
    
    .rec-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .rec-name {
        font-size: 0.75rem;
    }
}