/* --- Cart Sidebar (Desktop) --- */
.cart-sidebar-container {
    position: sticky;
    top: 156px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
}

.cart-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-grey);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-black);
}

/* --- Cart Delivery Switch (Compact) --- */
.cart-delivery-switch {
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-grey);
}

.delivery-switch-compact {
    max-width: 100% !important;
}

.delivery-switch-compact .switch-option {
    padding: 8px 12px;
}

.delivery-switch-compact .switch-option span {
    font-size: 14px;
}

.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px;
}

/* --- Cart Items --- */
.cart-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-grey);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

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

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

.cart-item-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-black);
    margin-bottom: 8px;
}

.cart-item-extras {
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--text-dark);
    opacity: 0.8;
    line-height: 1.4;
}

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

.qty-number {
    font-weight: 700;
    font-size: 14px;
}

.cart-item-price {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-black);
    margin-left: 12px;
}

/* --- Cart Totals --- */
.cart-footer {
    padding: 24px;
    border-top: 1px solid var(--border-grey);
    background: var(--bg-light);
}

/* .price-row and .total-row in molecules/price-summary.css */

.cart-footer .total-row {
    margin-bottom: 20px;
}

/* --- Empty State --- */
.cart-empty {
    padding: 40px 24px;
    text-align: center;
}

.cart-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.cart-empty-text {
    font-size: 16px;
    font-weight: 600;
    opacity: 0.5;
}

/* --- Cart Upsell Section --- */
.cart-upsell-section {
    padding: 24px;
    background: #fdfdfb;
    border-top: 1px solid var(--border-grey);
}

.upsell-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-black);
}

.upsell-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.upsell-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-grey);
    cursor: pointer;
    transition: var(--transition);
}

.upsell-item:hover {
    border-color: var(--primary-green);
    transform: translateY(-2px);
}

.upsell-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upsell-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-black);
}

.upsell-item-desc {
    font-size: 12px;
    color: var(--text-dark);
    opacity: 0.8;
}

.upsell-item-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-green);
}

/* --- Sponsored Section --- */
.sponsor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sponsor-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--bg-grey);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-dark);
}

.upsell-horizontal-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.upsell-horizontal-list::-webkit-scrollbar {
    display: none;
}

.upsell-card {
    min-width: 140px;
    background: var(--white);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-grey);
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

.upsell-card-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-black);
    line-height: 1.2;
}

.upsell-card-desc {
    font-size: 11px;
    color: var(--text-dark);
    opacity: 0.7;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.upsell-card-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-green);
}

/* --- Mobile Cart Button --- */
#mobile-cart-button {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 500px;
    height: 51px;
    background-color: var(--primary-green);
    color: #ffffff;
    border: none;
    border-radius: 800px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 1001;
    cursor: pointer;
}

.mobile-cart-btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
}

.mobile-cart-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.mobile-cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
}

/* --- Cart Full-screen Modal (Mobile) --- */
#cart-drawer-overlay.full-screen-modal {
    padding: 0 5%;
}

.cart-full-content {
    display: flex;
    flex-direction: column;
    height: calc(100% - 72px);
    padding: 0;
    overflow-y: auto;
}

.cart-full-content .cart-content {
    padding: 20px 0;
    flex-shrink: 0;
    flex: none;
    overflow-y: visible;
}

.cart-full-content .upsell-container {
    flex-shrink: 0;
}

.cart-full-content .cart-footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 1;
}

@media (max-width: 992px) {
    #mobile-cart-button.visible {
        display: flex;
    }

    /* Fix: Hide sidebar containers (upsell, checkout, etc.) on mobile */
    .sidebar,
    #sidebar-container,
    .cart-sidebar-container,
    .sidebar-box,
    body.welcome-active #mobile-cart-button {
        display: none !important;
    }
}
