/**
 * Quick Chat Checkout - Core Styles
 * * Clean, responsive modal and button styling with CSS variables
 * for easy theme integration.
 *
 * @version 1.0.0
 * @author Amjed Bellili (https://www.linkedin.com/in/amjed-bellili/)
 */

:root {
    --qcc-whatsapp: #25d366;
    --qcc-whatsapp-dark: #128c7e;
    --qcc-bg-overlay: rgba(0, 0, 0, 0.7);
    --qcc-white: #ffffff;
    --qcc-text-main: #2c3e50;
    --qcc-text-muted: #7f8c8d;
    --qcc-border: #dfe6e9;
    --qcc-radius: 8px;
    --qcc-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* --- Main Checkout Button --- */

.wpfcc-checkout-btn {
    display: inline-flex; 
    justify-content: center;
    gap: 10px;
    width: auto; 
    padding: 12px 20px; 
    background-color: var(--qcc-whatsapp) !important;
    color: var(--qcc-white) !important;
    border: none;
    border-radius: var(--qcc-radius);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s, box-shadow 0.3s;
    margin-left: 10px; 
    text-decoration: none;
    vertical-align: middle; 
}

.wpfcc-checkout-btn:hover {
    background-color: var(--qcc-whatsapp-dark);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
    transform: translateY(-2px);
}

.wpfcc-checkout-btn svg {
    fill: currentColor;
    width: 20px;
    height: 20px;
}

/* --- Modal Overlay --- */
.wpfcc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--qcc-bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(4px);
    padding: 20px;
}

/* --- Modal Content --- */
.wpfcc-modal-content {
    background: var(--qcc-white);
    width: 100%;
    max-width: 450px;
    border-radius: 12px;
    padding: 30px;
    position: relative;
    box-shadow: var(--qcc-shadow);
    animation: qccFadeIn 0.3s ease-out;
}

@keyframes qccFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.wpfcc-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--qcc-text-muted);
    cursor: pointer;
    line-height: 1;
}

.wpfcc-modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: var(--qcc-text-main);
    border-bottom: 2px solid var(--qcc-whatsapp);
    display: inline-block;
    padding-bottom: 5px;
}

/* --- Form Elements --- */
.wpfcc-product-details {
    background: #f9f9f9;
    padding: 15px;
    border-radius: var(--qcc-radius);
    margin-bottom: 20px;
    border-left: 4px solid var(--qcc-whatsapp);
}

.wpfcc-form-group {
    margin-bottom: 15px;
}

.wpfcc-form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--qcc-text-main);
}

.wpfcc-form-group input, 
.wpfcc-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--qcc-border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.wpfcc-form-group input:focus {
    border-color: var(--qcc-whatsapp);
    outline: none;
}

.wpfcc-required {
    color: #e74c3c;
}

/* --- Submit Button & Loader --- */
.wpfcc-submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--qcc-whatsapp);
    color: white;
    border: none;
    border-radius: var(--qcc-radius);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.wpfcc-submit-btn:disabled {
    background: var(--qcc-text-muted);
    cursor: not-allowed;
}

.wpfcc-btn-loader {
    display: inline-block;
    animation: qccPulse 1s infinite;
}

@keyframes qccPulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* --- Responsive Helpers --- */
@media (max-width: 480px) {
    .wpfcc-modal-content {
        padding: 20px;
    }
}