/* Modern Quantity Selector Styling */
div.product .cart div.quantity {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0;
    margin-right: 12px;
    height: 50px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

div.product .cart div.quantity:hover {
    border-color: #88e995;
    box-shadow: 0 4px 8px rgba(136, 233, 149, 0.2);
}

div.product .cart div.quantity input[type="number"] {
    width: 60px;
    height: 46px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding: 0;
    margin: 0;
    outline: none;
    -moz-appearance: textfield;
}

div.product .cart div.quantity input[type="number"]::-webkit-outer-spin-button,
div.product .cart div.quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

div.product .cart div.quantity button.babystreet-qty-plus,
div.product .cart div.quantity button.babystreet-qty-minus {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 46px;
    border: none;
    background: #88e995;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    user-select: none;
}

div.product .cart div.quantity button.babystreet-qty-plus:hover,
div.product .cart div.quantity button.babystreet-qty-minus:hover {
    background: #6dd47e;
    transform: scale(1.05);
}

div.product .cart div.quantity button.babystreet-qty-plus:active,
div.product .cart div.quantity button.babystreet-qty-minus:active {
    transform: scale(0.95);
}

/* Modern Add to Cart Button */
button.single_add_to_cart_button, 
div.product a.single_add_to_cart_button {
    height: 50px;
    background: linear-gradient(135deg, #88e995 0%, #6dd47e 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 0 30px;
    text-align: center;
    line-height: 50px;
    vertical-align: top;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(136, 233, 149, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
}

button.single_add_to_cart_button:hover, 
div.product a.single_add_to_cart_button:hover {
    background: linear-gradient(135deg, #6dd47e 0%, #5bc66a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(136, 233, 149, 0.4);
    color: #fff;
    text-decoration: none;
}

button.single_add_to_cart_button:active, 
div.product a.single_add_to_cart_button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(136, 233, 149, 0.3);
}

/* Wishlist Heart Icon - Next to Add to Cart */
.summary.entry-summary .yith-wcwl-add-to-wishlist {
    width: 50px !important;
    height: 50px !important;
    margin-left: 12px;
    vertical-align: top;
    position: relative;
}

.summary.entry-summary .yith-wcwl-add-to-wishlist a {
    width: 50px;
    height: 50px;
    color: #dc3545;
    font-size: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.summary.entry-summary .yith-wcwl-add-to-wishlist a:hover {
    background: #fff;
    color: #dc3545;
    border-color: #dc3545;
    transform: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary.entry-summary .yith-wcwl-add-to-wishlist a:before {
    font-family: "Font Awesome 5 Free" !important;
    content: "\f004" !important;
    font-weight: 900;
    font-size: 18px;
    line-height: 1;
}

/* Hide default wishlist text and show only icon */
.summary.entry-summary .yith-wcwl-add-to-wishlist .feedback {
    display: none !important;
}

.summary.entry-summary .yith-wcwl-add-to-wishlist a span {
    display: none !important;
}

/* Wishlist added state - filled red heart */
.summary.entry-summary .yith-wcwl-add-to-wishlist a.added,
.summary.entry-summary .yith-wcwl-add-to-wishlist a.wishlist-added {
    background: #dc3545 !important;
    color: #fff !important;
    border-color: #dc3545 !important;
}

.summary.entry-summary .yith-wcwl-add-to-wishlist a.added:before,
.summary.entry-summary .yith-wcwl-add-to-wishlist a.wishlist-added:before {
    font-family: "Font Awesome 5 Free" !important;
    content: "\f004" !important;
    font-weight: 900;
    font-size: 18px;
    line-height: 1;
    color: #fff !important;
}

/* Cart and Wishlist Container */
.summary.entry-summary .cart {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* Force wishlist to appear next to cart */
.summary.entry-summary .cart + .yith-wcwl-add-to-wishlist {
    vertical-align: top;
}

/* Override any conflicting styles */
.summary.entry-summary .yith-wcwl-add-to-wishlist {
    float: none !important;
    clear: none !important;
    margin: 0 0 0 12px !important;
}

/* Ensure wishlist appears in the right place */
.summary.entry-summary form.cart {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .summary.entry-summary .cart {
        flex-direction: column;
        align-items: stretch;
    }
    
    div.product .cart div.quantity {
        margin-right: 0;
        margin-bottom: 12px;
        justify-content: center;
    }
    
    button.single_add_to_cart_button, 
    div.product a.single_add_to_cart_button {
        width: 100%;
        margin-bottom: 12px;
    }
    
    .summary.entry-summary .yith-wcwl-add-to-wishlist {
        margin-left: 0;
        align-self: center;
    }
}

/* Loading State */
button.single_add_to_cart_button.loading,
div.product a.single_add_to_cart_button.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* Disabled State */
div.product .cart div.quantity button.babystreet-qty-plus:disabled,
div.product .cart div.quantity button.babystreet-qty-minus:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Focus States for Accessibility */
div.product .cart div.quantity button.babystreet-qty-plus:focus,
div.product .cart div.quantity button.babystreet-qty-minus:focus,
button.single_add_to_cart_button:focus,
div.product a.single_add_to_cart_button:focus,
.summary.entry-summary .yith-wcwl-add-to-wishlist a:focus {
    outline: 2px solid #88e995;
    outline-offset: 2px;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Loading States */
button.single_add_to_cart_button.loading,
div.product a.single_add_to_cart_button.loading {
    position: relative;
    color: transparent !important;
}

button.single_add_to_cart_button.loading:after,
div.product a.single_add_to_cart_button.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Wishlist Loading State */
.yith-wcwl-add-to-wishlist a.loading {
    opacity: 0.7;
    pointer-events: none;
}

.yith-wcwl-add-to-wishlist a.success {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: #fff !important;
}

/* Click Animation */
.babystreet-qty-plus.clicked,
.babystreet-qty-minus.clicked {
    transform: scale(0.9);
}

/* Enhanced Hover Effects */
div.product .cart div.quantity:hover input[type="number"] {
    color: #88e995;
}

/* Success Animation for Add to Cart */
button.single_add_to_cart_button.success,
div.product a.single_add_to_cart_button.success {
    background: #28a745 !important;
    animation: success-pulse 0.6s ease-in-out;
}

@keyframes success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
