/* Zahra Trust Recurring Upsell Plugin Styles */

/* Modal Styles */
.ztrust-upsell-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.ztrust-upsell-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: ztrust-modal-slide-in 0.3s ease-out;
}

@keyframes ztrust-modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ztrust-upsell-modal-header {
    padding: 20px 30px 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

.ztrust-upsell-modal-header h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.ztrust-upsell-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.ztrust-upsell-close:hover {
    color: #333;
}

.ztrust-upsell-modal-body {
    padding: 30px;
}

.ztrust-upsell-modal-body p {
    margin: 0 0 25px 0;
    color: #666;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
}

/* Amount Section */
.ztrust-upsell-amount-section {
    margin-bottom: 30px;
}

.ztrust-upsell-amount-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.ztrust-amount-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    /* max-width: 200px; */
    margin: 0 auto;
}

.ztrust-amount-input-wrapper .currency-symbol {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #333;
    font-size: 18px;
    z-index: 1;
}

.ztrust-amount-input-wrapper input {
    width: 100%;
    padding: 15px 15px 15px 35px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.ztrust-amount-input-wrapper input:focus {
    outline: none;
    border-color: #00d5b4;
}

.ztrust-amount-range {
    display: none;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* Button Styles */
.ztrust-upsell-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ztrust-upsell-buttons .button {
    padding: 15px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}

.ztrust-convert-recurring {
    background-color: #00d5b4;
    color: #fff;
}

.ztrust-convert-recurring:hover {
    background-color: #00c4a3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 213, 180, 0.3);
}

.ztrust-continue-single {
    background-color: #f8f9fa;
    color: #333;
    border: 2px solid #00c4a3;
}

.ztrust-continue-single:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
}

/* Upsell Button Styles */
.ztrust-upsell-button-wrapper {
    margin: 20px 0;
}

.ztrust-upsell-button {
    width: 100%;
    padding: 15px 30px;
    background-color: #00d5b4;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.ztrust-upsell-button:hover {
    background-color: #00c4a3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 213, 180, 0.3);
}

/* Success Message */
.ztrust-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: #fff;
    padding: 15px 20px;
    border-radius: 6px;
    font-weight: 600;
    z-index: 9999999;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
    animation: ztrust-success-slide-in 0.3s ease-out;
}

@keyframes ztrust-success-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Body scroll lock when modal is open */
body.ztrust-modal-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ztrust-upsell-modal {
        padding: 10px;
    }
    
    .ztrust-upsell-modal-content {
        max-width: 100%;
    }
    
    .ztrust-upsell-modal-header,
    .ztrust-upsell-modal-body {
        padding: 20px;
    }
    
    .ztrust-upsell-modal-header h3 {
        font-size: 20px;
    }
    
    .ztrust-upsell-buttons {
        gap: 12px;
    }
    
    .ztrust-upsell-buttons .button {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .ztrust-amount-input-wrapper {
        max-width: 150px;
    }
    
    .ztrust-amount-input-wrapper input {
        padding: 12px 12px 12px 30px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .ztrust-upsell-modal-header h3 {
        font-size: 18px;
    }
    
    .ztrust-upsell-modal-body p {
        font-size: 14px;
    }
    
    .ztrust-amount-input-wrapper {
        max-width: 120px;
    }
    
    .ztrust-amount-input-wrapper input {
        padding: 10px 10px 10px 25px;
        font-size: 14px;
    }
    
    .ztrust-amount-range {
        font-size: 12px;
    }
}

/* Loading States */
.ztrust-upsell-buttons .button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Integration with existing theme styles */
.ztrust-upsell-button-wrapper .ztrust-upsell-button {
    margin: 0;
}

/* Ensure modal appears above other elements */
.ztrust-upsell-modal {
    z-index: 999999 !important;
}

/* Hide default add to cart when upsell is enabled */
.woocommerce div.product form.cart .ztrust-upsell-button-wrapper + .single_add_to_cart_button {
    display: none !important;
}
