/**
 * WooCommerce Product Hover Effects
 * Indian Wraps Theme
 */

/* Product Card Hover Container */
.product-card-hover {
    position: relative;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.product-card-hover:hover {
    /* transform: translateY(-5px); */
    /* box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); */
}

/* Product Image Hover Effect */
.product-image {
    transition: all 0.3s ease;
    border-radius: 5px;
}

.product-card-hover:hover .product-image {
    /* transform: scale(1.05); */
    /* box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); */
}

/* Product Actions Container */
.product-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    flex-direction: column;
}


/* Out of Stock */
.out-of-stock {
    text-align: center;
    padding: 10px;
    margin-bottom: 10px;
}

.out-of-stock-text {
    color: #d32f2f;
    font-weight: bold;
    font-size: 16px;
}

/* Add to Cart Button */
.add-to-cart-btn,
.add-to-cart-btn-alt {
    background: #ffc715;
    color: #000 !important;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 2px solid #ffc715;
    flex: 1;
    min-width: 140px;
    justify-content: center;
    text-align: center;
}

.add-to-cart-btn i {
    font-size: 16px;
}

.add-to-cart-btn:hover,
.add-to-cart-btn-alt:hover {
    background: #ffd54f;
    border-color: #ffd54f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 199, 21, 0.4);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

/* Checkout Button (Hidden by default, shows on hover) */
.checkout-btn {
    background: #FFC715;
    color: #000 !important;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 2px solid #ffc715;
    flex: 1;
    width: 190px;
    justify-content: center;
    text-align: center;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    text-decoration: none;
    border-radius: 20px;
    margin-top: 0px;
}

.checkout-btn i {
    font-size: 16px;
}

/* .product-card-hover:hover .checkout-btn {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
} */

.checkout-btn:hover {
    background: #ffd54f;
    border-color: #ffd54f;
    transform: translateX(0) translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 199, 21, 0.4);
    text-decoration: none;
}

.checkout-btn:active {
    transform: translateX(0) translateY(0);
}

/* Product Details Hover Effect */
.product-card-hover:hover .D-box h2 {
    color: #241c00;
    transition: color 0.3s ease;
}

.product-card-hover:hover .price {
    color: #000;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-actions {
        flex-direction: column;
    }

    .add-to-cart-btn,
    .checkout-btn {
        width: 100%;
        min-width: 100%;
    }

    .checkout-btn {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }

    .product-card-hover:hover {
        transform: translateY(0);
    }
}

/* Animation for Button Appearance */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* .product-card-hover:hover .checkout-btn {
    animation: slideInFromLeft 0.3s ease;
} */

/* Loading State for Buttons */
.add-to-cart-btn.loading,
.checkout-btn.loading {
    opacity: 0.6;
    pointer-events: none;
    cursor: wait;
}

.add-to-cart-btn.loading::after,
.checkout-btn.loading::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success State */
.add-to-cart-btn.added,
.checkout-btn.added {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff !important;
}

.add-to-cart-btn.added::before,
.checkout-btn.added::before {
    content: "✓ ";
    font-weight: bold;
}

/* Hover Effect for Product Card Border */
/* .product-card-hover {
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 10px;
    margin: 10px;
} */

/* .product-card-hover:hover {
    border-color: #ffc715;
} */

/* Icon Animations */
.add-to-cart-btn:hover i {
    animation: cartBounce 0.6s ease;
}

.checkout-btn:hover i {
    animation: cardShake 0.6s ease;
}

@keyframes cartBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes cardShake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

/* Focus States for Accessibility */
.add-to-cart-btn:focus,
.checkout-btn:focus {
    outline: 3px solid #ffc715;
    outline-offset: 2px;
}

/* Flying Animation */
@keyframes flyToCart {
    0% {
        transform: scale(1) translate(0, 0) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: scale(0.5) translate(200px, -100px) rotate(180deg);
        opacity: 0.8;
    }

    100% {
        transform: scale(0.1) translate(400px, -200px) rotate(360deg);
        opacity: 0;
    }
}

.flying-image {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    animation: flyToCart 1s ease-in-out forwards;
}

/* Sticky Message */
.sticky-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.5s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    min-width: 250px;
}

.sticky-message.show {
    transform: translateX(0);
    opacity: 1;
}

.sticky-message.error {
    background: #f44336;
}

.sticky-message .message-icon {
    font-size: 20px;
}

.sticky-message .message-text {
    flex: 1;
}

.sticky-message .close-message {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sticky-message .close-message:hover {
    opacity: 0.7;
}

/* Cart Counter Animation */
.cart-counter-animation {
    animation: cartBounce 0.6s ease;
}

@keyframes cartBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
        color: #4caf50;
    }
}

/* Product Added Animation */
.product-added-animation {
    animation: productAdded 0.8s ease;
}

@keyframes productAdded {
    0% {
        transform: scale(1);
        background: #ffc715;
    }

    25% {
        transform: scale(1.1);
        background: #4caf50;
    }

    50% {
        transform: scale(1.05);
        background: #4caf50;
    }

    100% {
        transform: scale(1);
        background: #4caf50;
    }
}

/* Quantity Button Disabled State */
.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.quantity-btn:disabled:hover {
    transform: none;
    background: #fff;
    color: #ffc715;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .quantity-controls {
        margin-bottom: 15px;
    }

    .quantity-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .quantity-input {
        width: 70px;
        height: 40px;
        font-size: 18px;
    }

    .sticky-message {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        transform: translateY(-100px);
    }

    .sticky-message.show {
        transform: translateY(0);
    }
}

/* Loading Overlay */
.product-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.product-card-hover.loading .product-loading-overlay {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #ffc715;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Print Styles */
@media print {
    .product-actions {
        display: none;
    }

    .sticky-message {
        display: none;
    }
}

/* Cart Counter Styles */
.header-cart .count {
    background: #000000;
    color: #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-left: 5px;
    transition: all 0.3s ease;
}

.cart-counter-animation {
    animation: cartBounce 0.6s ease-in-out;
}

@keyframes cartBounce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

a.cart-contents {
    padding: 5px 10px;
    line-height: 1;
}

.cart-icon svg {
    fill: #000000;
    transition: all 0.3s ease-in-out;
    margin-top: -10px;
}

.cart-icon:hover svg {
    fill: #ffffff;
}

.wrap-roll:last-child {
    border-bottom: 0 !important;
}

.header-cart span.cart-icon {
    font-size: 30px;
}

.shipping-calculator-form p:last-child {
    margin-bottom: 0;
}