/* ============================================================
   Обгортка хука
   ============================================================ */
.ap-trigger-wrap {
    clear: both;
    display: block;
    padding: 5px 19px 13px;
}

/* ============================================================
   Кнопка "Запитати про товар" — outline версія .exclusive (-33%)
   ============================================================ */
.askproduct-btn {
    padding: 0;
    border-top: 1px solid #0B8C0E;
    border-right: 1px solid #0a7d0d;
    border-left: 1px solid #0a7d0d;
    border-bottom: 1px solid #054807;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    -ms-border-radius: 5px;
    -o-border-radius: 5px;
    border-radius: 5px;
    position: relative;
    display: block;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    box-sizing: border-box;
    -webkit-transition: background 0.3s ease;
    -moz-transition: background 0.3s ease;
    -o-transition: background 0.3s ease;
    transition: background 0.3s ease;
}

/* Іконка зліва */
.askproduct-btn::before {
    font-family: "FontAwesome";
    content: "\f059";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    color: #0B8C0E;
    font-size: 16px;
    line-height: 31px;
    z-index: 2;
    width: 34px;
    text-align: center;
    border: 1px solid #0B8C0E;
    -webkit-border-radius: 5px 0 0 5px;
    -moz-border-radius: 5px 0 0 5px;
    border-radius: 5px 0 0 5px;
    -webkit-transition: color 0.3s ease, border-color 0.3s ease;
    transition: color 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 991px) {
    .askproduct-btn::before {
        display: none;
    }
}

/* Роздільник */
.askproduct-btn::after {
/* Роздільник прибрано */
    position: absolute;
    top: 0;
    bottom: 0;
    left: 34px;
    content: "";
    width: 1px;
    z-index: 2;
}

@media (max-width: 991px) {
    .askproduct-btn::after {
        display: none;
    }
}

/* Текст кнопки */
.askproduct-btn span {
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 13px;
    line-height: 15px;
    border-top: 1px solid #2DAC30;
    border-right: 1px solid #2DAC30;
    border-left: 1px solid #2DAC30;
    border-bottom: 1px solid #2DAC30;
    padding: 6px 20px 7px 46px;
    color: #0B8C0E;
    display: block !important;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    -webkit-transition: color 0.3s ease, border-color 0.3s ease;
    -moz-transition: color 0.3s ease, border-color 0.3s ease;
    -o-transition: color 0.3s ease, border-color 0.3s ease;
    transition: color 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 1199px) {
    .askproduct-btn span {
        padding: 6px 14px 7px 46px;
        font-size: 13px;
    }
}

@media (max-width: 991px) {
    .ap-trigger-wrap {
        padding: 5px 19px 13px;
    }
    .askproduct-btn span {
        padding: 6px 20px 7px;
        text-align: center;
        white-space: nowrap;
    }
}

/* Hover */
.askproduct-btn:hover {
    background: #0B8C0E;
}

.askproduct-btn:hover::before {
    color: #fff;
    border-color: #2DAC30;
}

.askproduct-btn:hover span {
    color: #fff;
    border-color: #2DAC30;
}


/* ============================================================
   Модальне вікно
   ============================================================ */
.ap-modal-backdrop {
    display: none;
    position: fixed;
    z-index: 999999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    font-family: Arial, Helvetica, sans-serif;
}

.ap-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 25px;
    border-radius: 6px;
    width: 360px;
    max-width: 94vw;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.ap-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #95a5a6;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
}

.ap-modal-close:hover {
    color: #34495e;
}

.ap-modal-title {
    margin-top: 0;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: bold;
    text-align: center;
    font-size: 17px;
}

.ap-modal-desc {
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
    margin-bottom: 18px;
    line-height: 1.5;
}

/* Поля вводу */
.ap-input-group {
    margin-bottom: 12px;
}

.ap-field-text,
.ap-field-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    color: #2c3e50;
    outline: none;
    -webkit-transition: border-color 0.2s ease;
    transition: border-color 0.2s ease;
}

.ap-field-text:focus,
.ap-field-textarea:focus {
    border-color: #007ab7;
}

.ap-field-textarea {
    height: 72px;
    resize: none;
}

/* Заголовок вибору месенджера */
.ap-messenger-label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    margin-top: 6px;
    text-align: center;
}

/* Контейнер кнопок месенджерів */
.ap-messenger-buttons {
    display: flex;
    gap: 10px;
}

/* Базовий стиль кнопки месенджера */
.ap-send-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 10px;
    border-radius: 5px;
    border: 2px solid transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    background: transparent;
    font-family: Arial, Helvetica, sans-serif;
    white-space: nowrap;
}

.ap-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: currentColor;
}

/* Viber — фіолетовий */
.ap-viber-btn {
    color: #7360F2;
    border-color: #7360F2;
}

.ap-viber-btn:hover,
.ap-viber-btn.ap-messenger-active {
    background: #7360F2;
    color: #fff;
}

/* Telegram — синій */
.ap-telegram-btn {
    color: #0088cc;
    border-color: #0088cc;
}

.ap-telegram-btn:hover,
.ap-telegram-btn.ap-messenger-active {
    background: #0088cc;
    color: #fff;
}

/* Активна кнопка — виглядає як натиснута */
.ap-messenger-active {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Повідомлення результату */
.ap-result-msg {
    display: none;
    margin-top: 10px;
    padding: 14px;
    background: #eafaf1;
    border: 1px solid #27ae60;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #27ae60;
    line-height: 1.5;
}

/* Повідомлення про копіювання номера (Viber) */
.ap-copied-msg {
    margin-top: 10px;
    padding: 14px;
    background: #f0eaff;
    border: 1px solid #7360F2;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #5a4bc4;
    line-height: 1.5;
}

/* ============================================================
   v1.1 — «Напишіть нам самі», помилки полів, honeypot
   ============================================================ */
.ap-modal-desc { margin-bottom: 12px; }

.ap-direct { text-align: center; margin-bottom: 14px; }
.ap-direct-label { display: block; font-size: 12px; color: #2c3e50; font-weight: 600; margin-bottom: 8px; }
.ap-direct-links { display: flex; gap: 10px; justify-content: center; }
.ap-direct-link {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 10px; border-radius: 20px;
    font-size: 13px; font-weight: 600; color: #fff !important;
    text-decoration: none !important;
    -webkit-transition: filter .2s ease, transform .2s ease; transition: filter .2s ease, transform .2s ease;
}
.ap-direct-link .ap-icon { width: 18px; height: 18px; }
.ap-direct-viber { background: #7360F2; }
.ap-direct-telegram { background: #0088cc; }
.ap-direct-link:hover { filter: brightness(1.1); transform: translateY(-1px); }

.ap-divider { position: relative; text-align: center; margin: 4px 0 14px; }
.ap-divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid #e3e6e8; }
.ap-divider span { position: relative; background: #fff; padding: 0 10px; font-size: 11px; color: #95a5a6; text-transform: uppercase; letter-spacing: .03em; }

.ap-field-error { display: none; margin-top: 4px; font-size: 12px; color: #e74c3c; text-align: left; }
.ap-form-error { text-align: center; margin-top: 10px; }
.ap-field-text.ap-invalid, .ap-field-textarea.ap-invalid { border-color: #e74c3c; }
.ap-field-textarea { height: 84px; }

.ap-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ============================================================
   v1.2 — варіанти кнопки (AP_BTN_STYLE)
   ============================================================ */
.ap-trigger-wrap .ap-icon { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

/* 1 — дві кнопки месенджерів */
.ap-v1 { display: flex; gap: 8px; }
.ap-v1 a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border-radius: 17px; color: #fff !important; font-size: 12px; font-weight: 700; text-decoration: none !important; transition: filter .2s, transform .2s; }
.ap-v1 a:hover { filter: brightness(1.1); transform: translateY(-1px); }
.ap-v1-vb { background: #7360F2; } .ap-v1-tg { background: #0088cc; }
.ap-v1-form { display: block; margin-top: 6px; text-align: center; font-size: 11px; color: #7f8c8d !important; text-decoration: none; border-bottom: 1px dashed transparent; }
.ap-v1-form:hover { color: #0B8C0E !important; }

/* 2 — живий консультант */
.ap-v2 { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: #fff; border: 1px dashed #0B8C0E; border-radius: 6px; cursor: pointer; text-align: left; font-family: Arial, Helvetica, sans-serif; transition: background .2s, border-style .2s; }
.ap-v2:hover { background: #f1faf1; border-style: solid; }
.ap-v2-av { position: relative; width: 34px; height: 34px; border-radius: 50%; background: #0B8C0E; color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ap-v2-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ap-v2-av:after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #2ecc71; border: 2px solid #fff; animation: ap-online 2s infinite; }
@keyframes ap-online { 50% { opacity: .4; } }
.ap-v2-txt b { display: block; font-size: 12px; color: #0B8C0E; line-height: 1.3; }
.ap-v2-txt small { display: block; font-size: 11px; color: #7f8c8d; line-height: 1.3; }

/* 3 — градієнт */
.ap-v3 { width: 100%; height: 34px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 5px; background: linear-gradient(90deg, #7360F2, #0088cc); background-size: 150% 100%; color: #fff; font-weight: 700; font-size: 12px; text-transform: uppercase; cursor: pointer; transition: background-position .4s; font-family: Arial, Helvetica, sans-serif; }
.ap-v3:hover { background-position: 100% 0; }

/* 4 — пульсація (перші ~3 цикли) */
.ap-pulse { animation: ap-pulse 2.4s 3; }
@keyframes ap-pulse { 0% { box-shadow: 0 0 0 0 rgba(11,140,14,.45); } 70% { box-shadow: 0 0 0 10px rgba(11,140,14,0); } 100% { box-shadow: 0 0 0 0 rgba(11,140,14,0); } }

/* 5 — іконки під кнопкою */
.ap-v5-icons { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; font-size: 11px; color: #7f8c8d; }
.ap-v5-c { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff !important; transition: transform .2s; }
.ap-v5-c:hover { transform: scale(1.12); }
.ap-v5-vb { background: #7360F2; } .ap-v5-tg { background: #0088cc; }
.ap-v5-c .ap-icon { width: 16px; height: 16px; }

/* 6 — текстовий рядок */
.ap-v6 { text-align: center; font-size: 12px; color: #34495e; line-height: 1.6; }
.ap-v6 a { font-weight: 700; text-decoration: none !important; border-bottom: 1px dashed; color: #0B8C0E; }
.ap-v6 a.ap-v6-vb { color: #7360F2; } .ap-v6 a.ap-v6-tg { color: #0088cc; }

/* ============================================================
   v1.2.1 — вирівнювання під кнопку «Купити»
   (ширину .ap-inner виставляє JS = ширині #add_to_cart .exclusive)
   ============================================================ */
.ap-trigger-wrap { padding: 8px 19px 13px; text-align: left; }
.ap-inner { display: block; max-width: 100%; box-sizing: border-box; }
.ap-inner .askproduct-btn { width: 100%; }
.ap-inner .ap-v6 { text-align: center; }
@media (max-width: 991px) {
    .ap-trigger-wrap { padding: 8px 19px 13px; }
}

/* ============================================================
   v1.2.2 — варіант 6 на телефоні: великі кнопки під палець
   ============================================================ */
@media (max-width: 991px), (pointer: coarse) {
    .ap-v6 { display: flex; flex-wrap: wrap; gap: 8px; }
    .ap-v6 .ap-v6-t { display: none; }
    .ap-v6 a {
        flex: 1 1 0; min-width: 0;
        display: flex; align-items: center; justify-content: center;
        min-height: 40px; padding: 0 8px; border: 0 !important; border-radius: 20px;
        color: #fff !important; font-size: 13px;
    }
    .ap-v6 a.ap-v6-ask { flex: 1 1 100%; background: #0B8C0E; }
    .ap-v6 a.ap-v6-vb  { background: #7360F2; color: #fff !important; }
    .ap-v6 a.ap-v6-tg  { background: #0088cc; color: #fff !important; }
}

/* ============================================================
   v1.3 — окремий варіант для телефону
   ============================================================ */
.ap-only-mobile { display: none; }
@media (max-width: 991px) {
    .ap-only-desktop { display: none; }
    .ap-only-mobile { display: block; }
    /* варіант 5 на телефоні — іконки більші під палець */
    .ap-v5-icons { gap: 12px; margin-top: 8px; font-size: 12px; }
    .ap-v5-c { width: 40px; height: 40px; }
    .ap-v5-c .ap-icon { width: 22px; height: 22px; }
}
