/* ============================================================
   whatsapp.css — WhatsApp entry points. MOBILE FIRST.
   Adapted from the StandScale site (qr.css) to the Kybernete
   palette and Bootstrap layout.

   The same wa.me link appears in up to five places:

     .nav-wa    — navbar, outside the hamburger so phones see it
     .qr-hero   — inner-page hero, standing code on the right
     .wa-band   — a full-width band part-way down the page
     .qr-card   — inside the Contact section
     .wa-dock   — fixed bottom-right, visible at all times

   Every QR is wrapped in the link it encodes, so a desktop
   visitor scans it and a phone visitor just taps it.

   The floating dock deliberately uses real WhatsApp green —
   that bubble is a recognised affordance.
   ============================================================ */

:root {
    --wa-green: #25D366;
    --wa-green-deep: #128C7E;
    --wa-ink: #07301A;
    --wa-line: #e2e8f0;
    --wa-text: #1e293b;
    --wa-mute: #64748b;
    --wa-brand: #059669;
    --wa-brand-deep: #064e3b;
    --wa-dark: #0f172a;
}

/* ============================================================
   1. Shared QR card (hero + contact)
   ============================================================ */
.qr-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #FFFFFF;
    border: 1px solid var(--wa-line);
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.qr-card:hover,
.qr-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.10);
    border-color: var(--wa-brand);
}

.qr-card img {
    display: block;
    width: 116px;
    height: 116px;
    flex: 0 0 auto;
    border-radius: 8px;
}

.qr-copy {
    text-align: left;
}

.qr-copy .qr-kicker {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wa-green-deep);
    margin: 0 0 6px;
}

.qr-copy .qr-kicker svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.qr-copy strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--wa-text);
    line-height: 1.3;
    margin-bottom: 4px;
}

.qr-copy span {
    display: block;
    font-size: 12.5px;
    color: var(--wa-mute);
    line-height: 1.45;
}

/* --- Standing hero code (inner pages) ---------------------------------
   On a phone it sits under the hero copy; from 992px it stands in the
   hero's right-hand column so the code is on screen as the page opens. */
.qr-hero {
    margin: 26px 0 0;
    max-width: 420px;
}

.qr-hero .qr-card {
    background: rgba(255, 255, 255, 0.95);
}

@media (min-width: 992px) {
    .qr-hero {
        margin: 0 0 0 auto;
        max-width: none;
        width: 212px;
    }

    .qr-hero .qr-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 18px;
    }

    .qr-hero .qr-card img {
        width: 172px;
        height: 172px;
    }

    .qr-hero .qr-copy {
        text-align: center;
    }

    .qr-hero .qr-copy .qr-kicker {
        justify-content: center;
        margin-bottom: 5px;
    }

    .qr-hero .qr-copy strong {
        font-size: 14px;
    }

    .qr-hero .qr-copy span {
        font-size: 11.5px;
    }
}

/* --- In the Contact section --- */
.qr-cta {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 500px;
}

.qr-cta .qr-card {
    width: 100%;
}

/* --- Small phones: stack so the QR stays big enough to scan --- */
@media (max-width: 420px) {
    .qr-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 16px;
    }

    .qr-card img {
        width: 150px;
        height: 150px;
    }

    .qr-copy {
        text-align: center;
    }

    .qr-copy .qr-kicker {
        justify-content: center;
    }
}

@media (min-width: 992px) {
    .qr-cta .qr-card {
        padding: 16px 20px;
        gap: 18px;
    }

    .qr-cta .qr-card img {
        width: 152px;
        height: 152px;
    }
}

/* ============================================================
   2. Mid-page WhatsApp band
   ============================================================ */
.wa-band {
    background: radial-gradient(circle at top right, var(--wa-brand-deep), var(--wa-dark));
    padding: 52px 0;
    position: relative;
    overflow: hidden;
}

.wa-band::after {
    content: "";
    position: absolute;
    top: -140px;
    right: -120px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.18) 0%, transparent 68%);
    pointer-events: none;
}

.wa-band-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    text-align: center;
}

.wa-band-qr {
    display: block;
    flex: 0 0 auto;
    background: #fff;
    padding: 12px;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    transition: transform .2s ease, box-shadow .2s ease;
}

.wa-band-qr:hover,
.wa-band-qr:focus-visible {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.34);
}

.wa-band-qr img {
    display: block;
    width: 164px;
    height: 164px;
    border-radius: 8px;
}

.wa-band-copy {
    max-width: 56ch;
}

.wa-band-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wa-green);
    margin: 0 0 14px;
}

.wa-band-kicker svg {
    width: 16px;
    height: 16px;
}

.wa-band h2 {
    color: #fff;
    font-size: clamp(23px, 3.2vw, 34px);
    line-height: 1.2;
    margin: 0 0 14px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.wa-band p.wa-band-lede {
    color: rgba(255, 255, 255, 0.74);
    font-size: 15.5px;
    line-height: 1.6;
    margin: 0 0 24px;
}

.wa-band-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

/* WhatsApp-green button */
.btn-wa {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wa-green);
    color: var(--wa-ink) !important;
    border: 1px solid var(--wa-green);
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.28);
    transition: all .2s ease;
}

.btn-wa:hover,
.btn-wa:focus-visible {
    background: #1fbe5b;
    border-color: #1fbe5b;
    transform: translateY(-1px);
}

.btn-wa svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.btn-wa-ghost {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
}

.btn-wa-ghost:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

@media (min-width: 768px) {
    .wa-band {
        padding: 64px 0;
    }
}

@media (min-width: 992px) {
    .wa-band {
        padding: 72px 0;
    }

    .wa-band-inner {
        flex-direction: row;
        text-align: left;
        gap: 44px;
        justify-content: center;
    }

    .wa-band-qr img {
        width: 188px;
        height: 188px;
    }

    .wa-band-kicker {
        margin-bottom: 12px;
    }

    .wa-band-actions {
        justify-content: flex-start;
    }
}

/* ============================================================
   3. Navbar WhatsApp button — sits OUTSIDE .navbar-collapse,
      so it stays reachable on a phone.
   ============================================================ */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.nav-wa {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--wa-green);
    border-radius: 100px;
    background: rgba(37, 211, 102, 0.10);
    color: var(--wa-green-deep);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    transition: background .15s, transform .15s, color .15s;
}

.nav-wa:hover,
.nav-wa:focus-visible {
    background: var(--wa-green);
    color: var(--wa-ink);
    transform: translateY(-1px);
}

.nav-wa svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.nav-wa .nav-wa-label {
    display: none;
}

@media (min-width: 576px) {
    .nav-wa .nav-wa-label {
        display: inline;
    }
}

@media (min-width: 992px) {
    .nav-actions {
        margin-left: 1rem;
    }
}

/* ============================================================
   4. Floating dock — fixed bottom-right at any scroll position.
      Phone  : the pill links straight to wa.me.
      Desktop: the pill opens a QR panel (you cannot scan a
               code with the same phone you are holding).
      With JS off the pill is a plain link and still works.
   ============================================================ */
.wa-dock {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.wa-dock[hidden] {
    display: none;
}

.wa-dock-btn-wrap {
    position: relative;
}

.wa-dock-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--wa-green);
    color: var(--wa-ink);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    padding: 13px 18px;
    min-height: 52px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 10px 26px rgba(7, 48, 26, 0.30);
    transition: transform .18s ease, box-shadow .18s ease, background .15s;
}

.wa-dock-btn:hover,
.wa-dock-btn:focus-visible {
    background: #1fbe5b;
    color: var(--wa-ink);
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(7, 48, 26, 0.38);
}

.wa-dock-btn svg {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

.wa-dock-btn .wa-dock-label {
    display: none;
}

@media (min-width: 576px) {
    .wa-dock {
        right: 24px;
        bottom: 24px;
    }

    .wa-dock-btn .wa-dock-label {
        display: inline;
    }
}

/* Two gentle rings on first load, then never again. */
@keyframes waRing {
    0% { box-shadow: 0 10px 26px rgba(7, 48, 26, 0.30), 0 0 0 0 rgba(37, 211, 102, 0.55); }
    70% { box-shadow: 0 10px 26px rgba(7, 48, 26, 0.30), 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 10px 26px rgba(7, 48, 26, 0.30), 0 0 0 0 rgba(37, 211, 102, 0); }
}

.wa-dock-btn.is-ringing {
    animation: waRing 1.9s ease-out 2;
}

/* --- The dock's QR panel (opens on click, desktop only) --- */
.wa-dock-panel {
    display: none;
    width: 220px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--wa-line);
    border-radius: 18px;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.22);
    text-align: center;
}

.wa-dock.is-open .wa-dock-panel {
    display: block;
    animation: waPanelIn .18s ease-out;
}

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

.wa-dock-panel img {
    display: block;
    width: 172px;
    height: 172px;
    margin: 0 auto 11px;
    border-radius: 8px;
}

.wa-dock-panel strong {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--wa-text);
    line-height: 1.3;
    margin-bottom: 4px;
}

.wa-dock-panel p {
    font-size: 11.5px;
    color: var(--wa-mute);
    line-height: 1.4;
    margin: 0;
}

/* A phone cannot scan its own screen, so the panel is desktop-only. */
@media (max-width: 575.98px) {
    .wa-dock-panel {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wa-dock-btn.is-ringing { animation: none; }
    .wa-dock.is-open .wa-dock-panel { animation: none; }
    .qr-card, .wa-band-qr, .wa-dock-btn { transition: none; }
}
