/* Cart Drawer Styles */

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 90%;
    max-width: 400px;
    height: 100%;
    background-color: var(--white);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
}

.cart-drawer.active {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.cart-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.3s ease;
}

.cart-close:hover {
    color: var(--gray-dark);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.cart-empty i {
    font-size: 3rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.cart-empty p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.cart-item {
    display: flex;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 1rem;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.cart-item-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

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

.cart-item-sticker {
    width: 30px;
    height: 30px;
    margin-left: 8px;
    flex-shrink: 0;
}

.cart-item-sticker img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-scent {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.cart-item-price {
    font-weight: 500;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.quantity-btn {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.quantity-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.quantity-input {
    width: 40px;
    height: 28px;
    text-align: center;
    border: none;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    margin: 0;
    padding: 0;
}

.remove-item {
    margin-left: 1rem;
    font-size: 0.9rem;
    color: var(--gray);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.remove-item:hover {
    color: #ff6b6b;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.cart-summary {
    margin-bottom: 1.5rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkout-btn {
    background-color: var(--turquoise);
    color: white;
    border: 1px solid var(--turquoise);
    padding: 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.checkout-btn:hover {
    background: none;
    color: var(--turquoise);
}

.continue-shopping {
    background-color: var(--turquoise);
    color: white;
    border: 1px solid var(--turquoise);
    padding: 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.continue-shopping:hover {
    background: none;
    color: var(--turquoise);
}

/* Cart item enter/leave animations */
.cart-item-enter {
    opacity: 0;
    transform: translateX(20px);
}

.cart-item-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s, transform 0.3s;
}

.cart-item-exit {
    opacity: 1;
}

.cart-item-exit-active {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s, transform 0.3s;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .cart-drawer {
        width: 100%;
    }
}

/* Cart item highlighting effect */
@keyframes highlight-fade {
    0% {
        background-color: rgba(64, 224, 208, 0);
    }
    50% {
        background-color: rgba(64, 224, 208, 0.3);
    }
    100% {
        background-color: rgba(64, 224, 208, 0);
    }
}

.item-highlighted {
    animation: highlight-fade 2s ease-in-out;
    border-radius: 4px;
    position: relative;
    z-index: 10;
    outline: 2px solid var(--turquoise);
}

/* Cart item updating/removing states */
.cart-item.updating,
.cart-item.removing {
    position: relative;
    pointer-events: none;
}

.cart-item.updating::before,
.cart-item.removing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 5;
    border-radius: 4px;
}

.cart-item.updating::after,
.cart-item.removing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--turquoise);
    border-radius: 50%;
    z-index: 6;
    animation: spin 1s linear infinite;
}

.cart-item.removing::after {
    border-top-color: #ff6b6b;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}