/* Contact Price for WooCommerce - Frontend Styles */

/* ===== Base ===== */
.cpw-price-text { font-weight: 700; color: #e74c3c; text-decoration: none; }
.cpw-buttons-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.cpw-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .2s;
    line-height: 1.4;
}

/* ===== Main Button ===== */
.cpw-btn-main { background: #1e73be; color: #fff; }
.cpw-btn-main:hover { background: #155fa0; color: #fff; }

/* ===== No Action (وقتی هیچ لینکی نیست) ===== */
.cpw-no-action {
    background: #bdc3c7;
    color: #fff;
    cursor: default;
    opacity: .7;
    pointer-events: none;
}

/* ===== Channel Buttons ===== */
.cpw-btn-whatsapp { background: #25D366; color: #fff; }
.cpw-btn-whatsapp:hover { background: #1da851; color: #fff; }
.cpw-btn-phone { background: #e74c3c; color: #fff; }
.cpw-btn-phone:hover { background: #c0392b; color: #fff; }
.cpw-btn-telegram { background: #0088cc; color: #fff; }
.cpw-btn-telegram:hover { background: #006da3; color: #fff; }
.cpw-btn-email { background: #8e44ad; color: #fff; }
.cpw-btn-email:hover { background: #7d3c98; color: #fff; }

.cpw-icon { width: 18px; height: 18px; flex-shrink: 0; }
.cpw-single-wrap { margin: 12px 0; }

/* ===== Popup Overlay ===== */
.cpw-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.6);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}
.cpw-overlay.active { display: flex; }
.cpw-popup {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    animation: cpwSlideIn .3s ease;
}
@keyframes cpwSlideIn { from { opacity:0; transform: translateY(30px); } to { opacity:1; transform: translateY(0); } }
.cpw-popup-close {
    position: absolute;
    top: 12px; left: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cpw-popup-close:hover { background: #f0f0f0; color: #333; }
.cpw-popup h2 { margin: 0 0 20px; font-size: 20px; color: #333; text-align: center; }
.cpw-popup .cpw-field { margin-bottom: 14px; }
.cpw-popup input, .cpw-popup textarea, .cpw-popup select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}
.cpw-popup input:focus, .cpw-popup textarea:focus {
    border-color: #1e73be;
    outline: none;
    box-shadow: 0 0 0 3px rgba(30,115,190,.15);
}
.cpw-popup textarea { resize: vertical; min-height: 80px; }
.cpw-popup .cpw-btn { width: 100%; justify-content: center; padding: 12px; font-size: 16px; }
.cpw-success {
    background: #eafaf1;
    border: 1px solid #27ae60;
    color: #27ae60;
    text-align: center;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 14px;
}
.cpw-error {
    background: #fdedec;
    border: 1px solid #e74c3c;
    color: #c0392b;
    text-align: center;
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* ===== Shortcode Form ===== */
.cpw-form-shortcode { max-width: 450px; margin: 16px auto; }
.cpw-form-shortcode .cpw-field { margin-bottom: 14px; }
.cpw-form-shortcode input,
.cpw-form-shortcode textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}
.cpw-form-shortcode input:focus, .cpw-form-shortcode textarea:focus {
    border-color: #1e73be;
    outline: none;
    box-shadow: 0 0 0 3px rgba(30,115,190,.15);
}
.cpw-form-shortcode textarea { resize: vertical; min-height: 80px; }
.cpw-form-shortcode .cpw-btn { width: 100%; justify-content: center; padding: 12px; font-size: 16px; }

/* ===== Body scroll lock ===== */
body.cpw-modal-open { overflow: hidden; }

/* ===== Loading spinner ===== */
.cpw-btn.loading { opacity: .7; pointer-events: none; }
.cpw-btn.loading::after {
    content: '';
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cpwSpin .6s linear infinite;
}
@keyframes cpwSpin { to { transform: rotate(360deg); } }

/* ===== Contact Info Page ===== */
.cpw-contact-page {
    max-width: 600px;
    margin: 40px auto;
    padding: 40px 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    text-align: center;
}
.cpw-contact-page h1 {
    font-size: 26px;
    color: #1a5276;
    margin-bottom: 8px;
}
.cpw-contact-page .cpw-contact-subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 30px;
}
.cpw-contact-channels {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 400px;
    margin: 0 auto;
}
.cpw-contact-channels a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    transition: transform .2s, box-shadow .2s;
}
.cpw-contact-channels a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.cpw-contact-channels a.cpw-ch-whatsapp { background: #25D366; }
.cpw-contact-channels a.cpw-ch-phone { background: #e74c3c; }
.cpw-contact-channels a.cpw-ch-telegram { background: #0088cc; }
.cpw-contact-channels a.cpw-ch-email { background: #8e44ad; }
.cpw-contact-channels a.cpw-ch-custom { background: #1e73be; }
.cpw-contact-channels .cpw-ch-icon {
    width: 40px; height: 40px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cpw-contact-channels .cpw-ch-icon svg { width: 22px; height: 22px; fill: #fff; }
.cpw-contact-channels .cpw-ch-text { display: flex; flex-direction: column; align-items: flex-start; }
.cpw-contact-channels .cpw-ch-label { font-size: 12px; opacity: .85; font-weight: 400; }
.cpw-contact-channels .cpw-ch-value { font-size: 15px; }

/* ===== RTL ===== */
[dir="rtl"] .cpw-popup-close { left: auto; right: 12px; }
[dir="rtl"] .cpw-contact-channels .cpw-ch-text { align-items: flex-end; }
