/**
 * BWR Reorder Styles
 */

/* Reorder Button Wrapper */
.bwr-reorder-wrapper {
    margin: 20px 0;
    text-align: left;
}

/* Reorder Button */
.bwr-reorder-button,
.button[name="reorder"] {
    background-color: #0073aa;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.bwr-reorder-button:hover,
.button[name="reorder"]:hover {
    background-color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bwr-reorder-button:disabled,
.button[name="reorder"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading State */
.bwr-reorder-button.bwr-loading:before,
.button[name="reorder"].bwr-loading:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10px;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 0;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: bwr-spin 0.8s linear infinite;
}

.bwr-reorder-button.bwr-loading,
.button[name="reorder"].bwr-loading {
    padding-left: 40px;
}

/* Success State */
.bwr-reorder-button.bwr-success {
    background-color: #46b450;
}

.bwr-reorder-button.bwr-success:before {
    content: '✓';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    animation: none;
    border: none;
    width: auto;
    height: auto;
    margin: 0;
}

/* Notification Styles */
.bwr-notification {
    position: fixed;
    top: 100px;
    right: -400px;
    max-width: 350px;
    padding: 15px 20px;
    background: #ffffff;
    border-left: 4px solid #0073aa;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: right 0.3s ease;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.bwr-notification-show {
    right: 20px;
}

.bwr-notification-success {
    border-left-color: #46b450;
    background-color: #f0f8f0;
}

.bwr-notification-error {
    border-left-color: #dc3232;
    background-color: #fef7f7;
}

.bwr-notification-warning {
    border-left-color: #ffb900;
    background-color: #fffdf0;
}

/* Spinner Animation */
@keyframes bwr-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .bwr-notification {
        right: -100%;
        left: auto;
        max-width: calc(100% - 40px);
    }
    
    .bwr-notification-show {
        right: 20px;
    }
    
    .bwr-reorder-button,
    .button[name="reorder"] {
        width: 100%;
        text-align: center;
    }
    
    .bwr-reorder-wrapper {
        text-align: center;
    }
}

/* Integration with WooCommerce Order View */
.woocommerce-MyAccount-content .bwr-reorder-wrapper {
    margin-top: 30px;
}

.woocommerce-order-details + .bwr-reorder-wrapper {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

/* Alternative button style for existing buttons */
.woocommerce-button.reorder,
.woocommerce-Button.reorder,
a.button.reorder,
button.button.reorder {
    background-color: #0073aa;
    color: #ffffff;
}

.woocommerce-button.reorder:hover,
.woocommerce-Button.reorder:hover,
a.button.reorder:hover,
button.button.reorder:hover {
    background-color: #005a87;
}