/* Clean WooCommerce Cart - Custom Styles */

/* Offcanvas & Backdrop */
#cleanCartOffcanvas {
    z-index: 99999999999 !important;
}

.offcanvas-backdrop {
    z-index: 99999999 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
}

/* Free Shipping Progress Bar */
.free-shipping-progress {
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
}

.free-shipping-progress-container {
    display: block !important;
}

.free-shipping-progress .progress {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    height: 10px;
    position: relative;
}

.free-shipping-progress .progress-bar {
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.free-shipping-progress .progress-bar.progress-bar-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.3) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.3) 75%,
        transparent 75%
    );
    background-size: 15px 15px;
    animation: progress-stripes 1.2s linear infinite;
}

.free-shipping-progress .progress-bar:not(.progress-bar-animated)::before {
    display: none;
}

@keyframes progress-stripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 15px 0;
    }
}

/* Cart Counter Badge - Base Styles */
.clean-cart-count {
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
}

/* Header Cart Button Badge */
#hy-mini-toggler .clean-cart-count.badge {
    position: absolute !important;
    top: 0 !important;
    left: 18px !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    color: #fff !important;
    background-color: rgb(var(--color-orange)) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    transform: none !important;
    transition: transform 0.2s ease, opacity 0.2s ease !important;
    z-index: 10 !important;
}

#hy-mini-toggler .clean-cart-count.badge[style*="display: none"] {
    display: none !important;
}

#hy-mini-toggler:hover .clean-cart-count.badge {
    transform: scale(1.1) !important;
}

/* Cart Toggle Button */
#hy-mini-toggler {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 16px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    position: relative !important;
    transition: all 0.3s ease !important;
}

#hy-mini-toggler svg {
    flex-shrink: 0 !important;
    transition: stroke 0.3s ease !important;
}

#hy-mini-toggler .cart-text {
    font-size: 16px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    line-height: 1 !important;
}

#hy-mini-toggler:hover {
    color: rgb(var(--color-orange)) !important;
}

#hy-mini-toggler:hover svg {
    stroke: rgb(var(--color-orange)) !important;
}

#hy-mini-toggler:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Cart Scroll Container */
.cart-scroll-container {
    max-height: calc(100vh - 250px);
    scrollbar-width: thin;
    scrollbar-color: #6c757d transparent;
}

.cart-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.cart-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.cart-scroll-container::-webkit-scrollbar-thumb {
    background-color: #6c757d;
    border-radius: 3px;
}

.cart-scroll-container::-webkit-scrollbar-thumb:hover {
    background-color: #495057;
}

/* Cart Loader */
.clean-cart-loader {
    border-radius: 8px;
    padding: 2rem;
    backdrop-filter: blur(2px);
}

/* Remove Item Button */
.clean-remove-item {
    transition: opacity 0.2s ease-in-out;
    font-size: 12px;
}

.clean-remove-item:hover {
    opacity: 1;
}

/* Cart Subtotal */
.clean-cart-subtotal {
    font-weight: bold;
    font-size: 1.2rem;
    color: rgb(var(--color-orange));
}

/* Cart Bottom Section */
.cart-bottom-section {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Orange Outline Button */
.outline-orange {
    color: rgb(var(--color-orange)) !important;
    border-color: rgb(var(--color-orange)) !important;
}

.outline-orange:hover {
    background-color: rgb(var(--color-orange)) !important;
    color: #fff !important;
}

/* Checkout Button */
.cart-checkout-btn {
    background-color: rgb(var(--color-orange)) !important;
    border-color: rgb(var(--color-orange)) !important;
    color: white !important;
}

.cart-checkout-btn:hover {
    background-color: rgb(var(--color-orange)) !important;
    border-color: rgb(var(--color-orange)) !important;
    opacity: 0.9;
    color: white !important;
}

.cart-checkout-btn:focus,
.cart-checkout-btn:active {
    background-color: rgb(var(--color-orange)) !important;
    border-color: rgb(var(--color-orange)) !important;
    color: white !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 165, 0, 0.25) !important;
}

/* Cart Items */
.cart-item {
    transition: all 0.3s ease;
}

.clean-cart-content .cart-item:not(:last-child) {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.cart-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Quantity Buttons */
.clean-quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    padding: 0;
}

.clean-quantity-btn svg {
    width: 22px;
    height: 22px;
}

/* Offcanvas Title */
.cart-canvas .offcanvas-title {
    font-size: 1.25rem !important;
    font-weight: semibold !important;
}

/* Cart Item Animations */
.cart-item.removing {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.cart-opening .offcanvas-body {
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.5s ease-out 0.3s forwards;
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quantity-display.updating {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.free-shipping-progress {
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Cart Notifications */
.cart-notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.form-control.is-invalid {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.discount-highlight {
    animation: discountPulse 0.8s ease-in-out;
}

@keyframes discountPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 15px rgba(40, 167, 69, 0.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Accessibility Styles */
.cart-item.focused {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 4px;
}

.touch-active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.hy-cart-header {
    background-color: rgb( var( --color-orange ) );
    position: absolute;
    top: 2px;
    left: 8px;
    transform: translate(50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    line-height: 1;
    z-index: 20;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.clean-cart-count.pulse {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: translate(50%, -50%) scale(1); }
    50% { transform: translate(50%, -50%) scale(1.2); }
    100% { transform: translate(50%, -50%) scale(1); }
}
