/* Enhanced Cart Styles (extracted from template-parts/sidebar-cart.php) */
#cart-sidebar {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#cart-overlay {
    transition: opacity 0.3s ease-in-out;
}

.cart-item {
    transition: all 0.3s ease-out;
}

.cart-item:hover {
    background-color: rgba(249, 250, 251, 0.5);
    border-radius: 0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Quantity input styling */
.cart-qty-input {
    transition: all 0.2s ease;
}

.cart-qty-input:focus {
    transform: scale(1.05);
}

.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-qty-input[type=number] {
    appearance: textfield;
    -moz-appearance: textfield;
}

/* Button animations */
.cart-qty-decrease,
.cart-qty-increase {
    transition: all 0.15s ease;
}

.cart-qty-decrease:active:not(:disabled),
.cart-qty-increase:active {
    transform: scale(0.85);
}

.cart-qty-decrease:hover:not(:disabled),
.cart-qty-increase:hover {
    background-color: rgba(243, 244, 246, 1);
}

/* Checkout button pulse */
.checkout-button {
    position: relative;
    overflow: hidden;
}

.checkout-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.checkout-button:hover::before {
    width: 300px;
    height: 300px;
}

/* Loading animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Empty cart animation */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(-10px);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }

    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Notification styles */
#cart-notification {
    transition: transform 0.3s ease-out;
}

/* Coupon form animation */
#coupon-form {
    transition: all 0.2s ease-out;
}

#toggle-coupon svg {
    transition: transform 0.2s ease;
}

.rotate-180 {
    transform: rotate(180deg);
}

/* Scale animation utilities */
.scale-0 {
    transform: scale(0);
}

.scale-75 {
    transform: scale(0.75);
}

.scale-100 {
    transform: scale(1);
}

/* Focus states */
button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    #cart-sidebar {
        max-width: 100%;
    }

    .cart-item {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Cart badge animation */
#cart-badge {
    transition: all 0.2s ease-out;
}

#cart-badge:not(.hidden) {
    animation: badge-pop 0.3s ease-out;
}

@keyframes badge-pop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Smooth scrollbar for cart items */
#cart-items-container {
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb #f9fafb;
}

#cart-items-container::-webkit-scrollbar {
    width: 6px;
}

#cart-items-container::-webkit-scrollbar-track {
    background: #f9fafb;
}

#cart-items-container::-webkit-scrollbar-thumb {
    background-color: #e5e7eb;
    border-radius: 3px;
}

#cart-items-container::-webkit-scrollbar-thumb:hover {
    background-color: #d1d5db;
}

/* Product image hover effect */
.cart-item img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cart-item:hover img {
    transform: scale(1.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Shipping progress bar animation */
#shipping-bar {
    position: relative;
    overflow: hidden;
}

#shipping-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Disabled state */
button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Cart item hover actions */
.cart-item .cart-item-remove {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.cart-item:hover .cart-item-remove {
    opacity: 1;
}

/* Responsive typography */
@media (max-width: 640px) {
    #cart-title {
        font-size: 1.125rem;
    }

    .cart-item-name {
        font-size: 0.875rem;
    }
}
