.cart-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.cart-btn:hover {
    background: var(--color-primary-light-bg);
}

.cart-btn:hover svg {
    color: var(--color-primary);
}

.cart-btn svg {
    width: 24px;
    height: 24px;
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.cart-btn.highlight {
    animation: cartHighlight 0.3s ease;
}

@keyframes cartHighlight {
    0%, 100% { background: transparent; }
    50% { background: var(--color-primary-light-bg); }
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.cart-header h3 {
    font-size: 1.25rem;
    color: #1f2937;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 150px;
}

.cart-empty {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: background-color 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.cart-item.highlight-item {
    animation: itemHighlight 0.6s ease forwards;
    background-color: var(--color-primary-light-bg);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light-bg), 0 0 12px rgba(37, 99, 235, 0.3);
}

@keyframes itemHighlight {
    0% { transform: scale(1); }
    30% { transform: scale(1); }
    75% { transform: scale(1.05); }
    85% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.cart-item-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: #1f2937;
}

.cart-item-info p {
    font-size: 0.85rem;
    color: #6b7280;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-controls button {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.cart-item-controls button:hover {
    background: #f3f4f6;
}

.cart-item-controls span {
    min-width: 24px;
    text-align: center;
    font-weight: 500;
}

.cart-item-controls .remove-btn {
    color: #ef4444;
    border-color: #fca5a5;
    margin-left: 0.5rem;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.cart-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.checkout-btn:hover {
    background: #1d4ed8;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

/* Add to Cart Button */
.add-to-cart {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.add-to-cart:hover {
    background: #1d4ed8;
    transform: scale(1.02);
}
