/* ============================================================
   Huuguu Whatsbot Lead – Frontend CSS
   ============================================================ */

/* Wrapper do botão (lado do "Ver na Loja") */
.hwl-wrapper {
    display: inline-block;
    margin-left: 8px;
    margin-top: 0;
    vertical-align: top;
}

/* FORM + BOTÕES NA SUMMARY (desktop) */
.single-product div.product .summary form.cart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.single-product div.product .summary form.cart .hwl-wrapper {
    display: inline-block;
    margin: 0;
    vertical-align: top;
}

/* Botão WhatsApp (no produto) */
.single-product .button.hwl-open-modal {
    background-color: #25d366;
    border-color: #25d366;
    color: #fff;
    font-size: 15px;
    line-height: 1;
    padding: 0.75em 1.6em;
    border-radius: 4px;
    white-space: nowrap;
}

.single-product .button.hwl-open-modal:hover {
    background-color: #1ebe5d;
    border-color: #1ebe5d;
    color: #fff;
}

/* Esconde o botão WhatsApp na sticky */
.ast-sticky-add-to-cart .hwl-wrapper,
.ast-sticky-add-to-cart .button.hwl-open-modal {
    display: none !important;
}

/* Quando a modal do Whatsbot estiver aberta, esconde a sticky do Astra */
body.hwl-modal-open .ast-sticky-add-to-cart {
    display: none !important;
}

/*----------------------------------------------
  BLOQUEIO DE SCROLL NA PÁGINA
----------------------------------------------*/
html.hwl-modal-open,
body.hwl-modal-open {
    overflow: hidden;
}

/*----------------------------------------------
  OVERLAY
----------------------------------------------*/
.hwl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden; /* overlay não rola, quem rola é a modal */
}

/*----------------------------------------------
  MODAL
----------------------------------------------*/
.hwl-modal {
    background: #fff;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 32px); /* deixa respiro nas bordas */
    overflow-y: auto;               /* scroll interno se precisar */
    border-radius: 14px;
    padding: 25px 30px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    position: relative;
    animation: hwlFadeUp .25s ease-out forwards;
    font-size: 14px;
}

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

/*----------------------------------------------
  CLOSE BUTTON
----------------------------------------------*/
.hwl-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: none;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hwl-close:hover {
    background: #f3f4f6;
    color: #111;
}

/*----------------------------------------------
  TEXTOS
----------------------------------------------*/
.hwl-greeting {
    font-size: 17px;
    line-height: 1.45;
    margin-bottom: 14px;
    color: #333;
}

.hwl-question {
    font-size: 15px;
    margin-bottom: 20px;
    color: #444;
}

.hwl-step {
    display: block;
    margin-top: 14px;
}

/*----------------------------------------------
  BUTTONS (dentro da modal)
----------------------------------------------*/
button.hwl-open-modal {
    display: inline-block;
    width: auto;
}

.hwl-step0-yes,
.hwl-lead-form button[type="submit"] {
    width: 100%;
    display: block;
    text-align: center;
    padding: 14px 18px;
    background: #2563eb;
    border: none;
    color: #fff;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
}

.hwl-step0-yes:hover,
.hwl-lead-form button[type="submit"]:hover {
    background: #1e4fc7;
}

/*----------------------------------------------
  FORM
----------------------------------------------*/
.hwl-step.hwl-step-1 > p:first-child {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.hwl-lead-form p {
    margin: 0 0 14px;
}

.hwl-lead-form label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.hwl-lead-form input,
.hwl-lead-form textarea {
    width: 100%;
    margin-top: 6px;
    padding: 9px 11px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
}

.hwl-lead-form input:focus,
.hwl-lead-form textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37,99,235,.15);
}

/* Feedback (erros no AJAX) */
.hwl-feedback {
    margin-top: 10px;
    padding: 9px 11px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 13px;
    border-radius: 6px;
}

/*----------------------------------------------
  MOBILE
----------------------------------------------*/
@media (max-width: 480px) {
    .hwl-modal {
        max-width: 100%;
        padding: 20px;
    }

    .hwl-greeting {
        font-size: 16px;
    }
}

/* SUMMARY – MOBILE: botões 100% (apenas na summary) */
@media (max-width: 480px) {
    .single-product div.product .summary form.cart {
        display: block;
        width: 100%;
    }

    .single-product div.product .summary form.cart .single_add_to_cart_button,
    .single-product div.product .summary form.cart .button.hwl-open-modal {
        width: 100%;
        text-align: center;
        display: block;
        margin-bottom: 8px;
    }

    .single-product div.product .summary form.cart .hwl-wrapper {
        display: block;
        margin: 0;
    }
}
