/* ENNU Peptides "Text us" widget - see includes/class-sms-widget.php. */

.ennu-sms-widget {
    --ennu-sms-navy: #061530;
    --ennu-sms-gold: #C59825;
    --ennu-sms-gold-dark: #a87f1c;
    --ennu-sms-ink: #151515;
    --ennu-sms-muted: #5b6475;
    --ennu-sms-line: #e3e6ec;
    --ennu-sms-offset: 0px;
    position: fixed;
    right: 20px;
    bottom: calc(20px + var(--ennu-sms-offset) + env(safe-area-inset-bottom, 0px));
    /* Above the store's mobile cart bar (10000) and toast-free page content. The sidecart and the
       hamburger menu live inside #ennu-retail-shop's z-index:1 stacking context, so they cannot
       paint over this - the widget hides itself while either is open instead (rules below). */
    z-index: 99990;
    font-family: "Montserrat", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.ennu-sms-widget.is-gated,
body.ennu-rs-sidebar-open .ennu-sms-widget,
body:has(#ennu-peptides-mobile-menu.is-open) .ennu-sms-widget {
    display: none !important;
}

.ennu-sms-widget > * {
    pointer-events: auto;
}

.ennu-sms-widget [hidden] {
    display: none !important;
}

.ennu-sms-widget *,
.ennu-sms-widget *::before,
.ennu-sms-widget *::after {
    box-sizing: border-box;
}

/* ---- Launcher --------------------------------------------------------------------------- */

.ennu-sms-launcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 20px 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--ennu-sms-navy);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(6, 21, 48, 0.28), 0 0 0 2px var(--ennu-sms-gold) inset;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ennu-sms-launcher:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(6, 21, 48, 0.34), 0 0 0 2px var(--ennu-sms-gold) inset;
}

.ennu-sms-launcher:focus-visible,
.ennu-sms-widget button:focus-visible,
.ennu-sms-widget a:focus-visible,
.ennu-sms-widget input:focus-visible,
.ennu-sms-widget textarea:focus-visible {
    outline: 3px solid var(--ennu-sms-gold);
    outline-offset: 2px;
}

.ennu-sms-launcher svg,
.ennu-sms-close svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ennu-sms-launcher svg {
    color: var(--ennu-sms-gold);
}

/* Theme and host stylesheets restyle bare buttons and spans (the edge challenge page turned
   this label navy-on-navy), so the launcher's colours are pinned. */
.ennu-sms-widget .ennu-sms-launcher {
    background: var(--ennu-sms-navy) !important;
    color: #fff !important;
}

.ennu-sms-widget .ennu-sms-launcher .ennu-sms-launcher-label {
    color: #fff !important;
}

.ennu-sms-widget .ennu-sms-launcher svg {
    stroke: var(--ennu-sms-gold) !important;
}

/* ---- Panel ------------------------------------------------------------------------------ */

.ennu-sms-panel {
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100vh - 120px - var(--ennu-sms-offset));
    overflow-y: auto;
    background: #fff;
    color: var(--ennu-sms-ink);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(6, 21, 48, 0.28);
    border-top: 4px solid var(--ennu-sms-gold);
}

.ennu-sms-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 12px;
}

.ennu-sms-title {
    margin: 0;
    font-family: "Times New Roman", Times, serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--ennu-sms-navy);
}

.ennu-sms-sub {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--ennu-sms-muted);
}

.ennu-sms-close {
    flex: none;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #f2f4f7;
    color: var(--ennu-sms-ink);
    cursor: pointer;
}

.ennu-sms-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0 18px;
    padding: 4px;
    border-radius: 10px;
    background: #f2f4f7;
}

.ennu-sms-tabs button {
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ennu-sms-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ennu-sms-tabs button[aria-selected="true"] {
    background: #fff;
    color: var(--ennu-sms-navy);
    box-shadow: 0 1px 3px rgba(6, 21, 48, 0.15);
}

.ennu-sms-pane {
    padding: 16px 18px 18px;
}

.ennu-sms-tap,
.ennu-sms-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    background: var(--ennu-sms-gold);
    color: var(--ennu-sms-navy);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.ennu-sms-tap:hover,
.ennu-sms-submit:hover {
    background: var(--ennu-sms-gold-dark);
    color: #fff;
}

.ennu-sms-submit[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.ennu-sms-qr-wrap {
    text-align: center;
}

.ennu-sms-qr {
    display: inline-flex;
    padding: 10px;
    border: 1px solid var(--ennu-sms-line);
    border-radius: 12px;
    background: #fff;
    min-width: 190px;
    min-height: 190px;
    align-items: center;
    justify-content: center;
}

.ennu-sms-qr img,
.ennu-sms-qr canvas {
    display: block;
}

.ennu-sms-hint {
    margin: 10px 0 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--ennu-sms-muted);
    text-align: center;
}

.ennu-sms-number-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--ennu-sms-line);
}

.ennu-sms-number {
    font-size: 17px;
    font-weight: 700;
    color: var(--ennu-sms-navy);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.ennu-sms-copy {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--ennu-sms-navy);
    border-radius: 8px;
    background: #fff;
    color: var(--ennu-sms-navy);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* ---- Form ------------------------------------------------------------------------------- */

.ennu-sms-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.ennu-sms-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ennu-sms-ink);
}

.ennu-sms-field input,
.ennu-sms-field textarea {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #cdd2db;
    border-radius: 8px;
    background: #fff;
    color: var(--ennu-sms-ink);
    font: inherit;
    font-size: 16px; /* 16px stops iOS zooming into the field */
    font-weight: 400;
    line-height: 1.4;
    box-shadow: none;
}

.ennu-sms-field textarea {
    resize: vertical;
    min-height: 76px;
}

.ennu-sms-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--ennu-sms-muted);
}

.ennu-sms-consent input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--ennu-sms-navy);
}

.ennu-sms-consent a {
    color: var(--ennu-sms-navy);
    text-decoration: underline;
}

.ennu-sms-turnstile:empty {
    display: none;
}

.ennu-sms-status {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.ennu-sms-status:empty {
    display: none;
}

.ennu-sms-status.is-error {
    color: #b42318;
}

.ennu-sms-status.is-success {
    padding: 10px 12px;
    border-radius: 8px;
    background: #ecfdf3;
    color: #05603a;
}

/* ---- Small screens ---------------------------------------------------------------------- */

@media (max-width: 600px) {
    .ennu-sms-widget {
        right: 14px;
        bottom: calc(14px + var(--ennu-sms-offset) + env(safe-area-inset-bottom, 0px));
    }

    .ennu-sms-launcher {
        min-height: 48px;
        padding: 0 16px 0 13px;
        font-size: 14px;
    }

    /* At checkout the launcher shrinks to an icon so it never sits on the order button. */
    body.woocommerce-checkout .ennu-sms-launcher {
        width: 48px;
        padding: 0;
        justify-content: center;
    }

    body.woocommerce-checkout .ennu-sms-launcher-label {
        display: none;
    }

    .ennu-sms-widget.is-open {
        left: 14px;
        align-items: stretch;
    }

    .ennu-sms-widget.is-open .ennu-sms-launcher {
        align-self: flex-end;
    }

    .ennu-sms-panel {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ennu-sms-launcher {
        transition: none;
    }
}

/* ---- Isolation from store-wide form styles ------------------------------------------------
   retail-shop.css styles `body.page form label/input/button` (uppercase labels, letter spacing,
   square buttons, no focus outline). The id outranks those selectors. */

#ennu-sms-widget .ennu-sms-form .ennu-sms-field,
#ennu-sms-widget .ennu-sms-form .ennu-sms-consent {
    display: flex;
    text-transform: none;
    letter-spacing: normal;
}

#ennu-sms-widget .ennu-sms-form .ennu-sms-field {
    font-size: 13px;
    font-weight: 600;
    color: var(--ennu-sms-ink);
}

#ennu-sms-widget .ennu-sms-form .ennu-sms-consent {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--ennu-sms-muted);
}

#ennu-sms-widget .ennu-sms-form .ennu-sms-field input,
#ennu-sms-widget .ennu-sms-form .ennu-sms-field textarea {
    background: #fff;
    border: 1px solid #cdd2db;
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 0;
    font-size: 16px;
    text-transform: none;
    letter-spacing: normal;
}

#ennu-sms-widget .ennu-sms-form .ennu-sms-field textarea {
    min-height: 76px;
}

#ennu-sms-widget .ennu-sms-form input:focus-visible,
#ennu-sms-widget .ennu-sms-form textarea:focus-visible,
#ennu-sms-widget .ennu-sms-form button:focus-visible {
    outline: 3px solid var(--ennu-sms-gold);
    outline-offset: 2px;
}

#ennu-sms-widget .ennu-sms-form .ennu-sms-submit {
    text-transform: none;
    letter-spacing: normal;
    border-radius: 10px;
    padding: 0;
    background: var(--ennu-sms-gold);
    color: var(--ennu-sms-navy);
}

#ennu-sms-widget .ennu-sms-form .ennu-sms-submit:hover {
    background: var(--ennu-sms-gold-dark);
    color: #fff;
}

@media (max-width: 380px) {
    #ennu-sms-widget .ennu-sms-pane {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media print {
    .ennu-sms-widget {
        display: none !important;
    }
}
