/* ==========================================================
   TAPPITRACK — SITE FOOTER
   Shared by every page. Markup: components/site-footer.html
   ========================================================== */

.site-footer {
    color: var(--tt-muted);
    background: var(--tt-white);
    border-top: 1px solid var(--tt-border);
    font-size: 14px;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
    transition: color 160ms ease;
}

.site-footer a:hover {
    color: var(--tt-blue);
}

.site-footer h3 {
    color: var(--tt-dark);
}

/* ---------- Call to action band ---------- */

.footer-cta {
    color: var(--tt-white);
    background: var(--tt-blue);
}

.footer-cta-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 28px 48px;
    padding: clamp(44px, 6vw, 72px) 0;
}

.footer-cta h2 {
    margin: 0 0 10px;
    color: var(--tt-white);
    font-size: clamp(26px, 3vw, 38px);
}

.footer-cta p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
}

.footer-cta-inner>div:not(.footer-cta-actions) {
    flex: 1 1 420px;
}

.footer-cta-actions {
    display: flex;
    flex: 0 1 600px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.site-footer .footer-cta a:hover {
    color: inherit;
}

/* On the blue band the primary action is white with blue text. */
.footer-cta .btn-primary {
    color: var(--tt-blue);
    background: var(--tt-white);
}

.footer-cta .btn-primary:hover {
    color: var(--tt-blue-dark);
    background: var(--tt-blue-soft);
}

/* Newsletter sign-up beside "Get a quote" on blue bands (footer and
   pg-band). Shared component; lives here because footer.css loads on
   every page. */
.tt-subscribe {
    display: flex;
    flex: 1 1 360px;
    gap: 8px;
    min-width: 0;
    max-width: 440px;
}

/* Input and button are separate controls, side by side. */
.tt-subscribe input {
    flex: 1 1 auto;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    color: var(--tt-dark);
    background: var(--tt-white);
    border: 1px solid transparent;
    border-radius: var(--tt-radius-sm);
    font-size: 15px;
}

.tt-subscribe input::placeholder {
    color: var(--tt-muted);
}

.tt-subscribe input:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 0;
}

.tt-subscribe button {
    flex: 0 0 auto;
    height: 46px;
    padding: 0 20px;
    color: var(--tt-white);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--tt-radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.tt-subscribe button:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--tt-white);
}

/* Shown when php/newsletter.php redirects back to #newsletter-...
   Sits on its own line below the band's heading and buttons. */
.footer-cta .footer-notice {
    display: none;
    flex: 1 1 100%;
    order: 3;
    margin: 0;
    padding: 14px 18px;
    color: var(--tt-blue);
    background: var(--tt-white);
    border-radius: var(--tt-radius-sm);
    font-size: 15px;
    font-weight: 600;
    scroll-margin-top: calc(var(--tt-header-height) + 120px);
}

.footer-cta .footer-notice:target {
    display: block;
}

.footer-cta #newsletter-invalid,
.footer-cta #newsletter-error {
    color: var(--tt-red);
}

/* ---------- Main columns ---------- */

.footer-main {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr));
    gap: 40px;
    padding: 64px 0 48px;
}

.footer-logo img {
    display: block;
    width: 170px;
    height: auto;
}

.footer-brand p {
    max-width: 340px;
    margin: 18px 0 0;
    line-height: 1.7;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.footer-column h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--tt-dark);
    border: 1px solid var(--tt-border);
    border-radius: 50%;
}

.site-footer .footer-social a:hover {
    color: var(--tt-white);
    background: var(--tt-blue);
    border-color: var(--tt-blue);
}

.footer-social svg {
    width: 17px;
    height: 17px;
}

/* ---------- Bottom bar ---------- */

.footer-bottom {
    background: var(--tt-light);
    border-top: 1px solid var(--tt-border);
    font-size: 13px;
}

.footer-bottom-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 24px;
    padding: 22px 0;
}

.footer-tagline {
    color: #0067ee;
    font-weight: 700;
}

/* ---------- Responsive ---------- */

@media (max-width: 1050px) {
    .footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .footer-main {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .footer-cta-actions,
    .footer-cta-actions .btn,
    .tt-subscribe {
        width: 100%;
        max-width: none;
    }

    .tt-subscribe {
        flex-direction: column;
    }
}

/* ==========================================================
   WhatsApp chat (markup in components/site-footer.html,
   script assets/js/whatsapp.js). WhatsApp green is used only here
   so visitors recognise the channel instantly.
   ========================================================== */

.tt-wa {
    --wa: #25D366;
    --wa-dark: #128C4B;
}

.tt-wa-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 16px;
    color: var(--tt-white);
    background: var(--wa);
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(18, 140, 75, 0.35);
    text-decoration: none;
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.tt-wa-button:hover {
    color: var(--tt-white);
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(18, 140, 75, 0.45);
}

.tt-wa-button svg {
    width: 26px;
    height: 26px;
}

/* Gentle ring so the button is noticed without being distracting. */
.tt-wa-button::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: var(--wa);
    animation: tt-wa-ring 3s ease-out infinite;
}

.tt-wa-label {
    font-size: 15px;
    font-weight: 700;
}

.tt-wa-prompt {
    position: fixed;
    top: 50%;
    right: 24px;
    z-index: 901;
    width: min(340px, calc(100vw - 32px));
    padding: 20px;
    background: var(--tt-white);
    border: 1px solid var(--tt-border);
    border-radius: 20px;
    box-shadow: 0 30px 70px rgba(16, 42, 67, 0.25);
    opacity: 0;
    transform: translate(24px, -50%);
    transition: opacity 260ms ease, transform 300ms var(--tt-ease);
}

.tt-wa-prompt.is-open {
    opacity: 1;
    transform: translate(0, -50%);
}

.tt-wa-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--tt-muted);
    background: var(--tt-light);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.tt-wa-close svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.tt-wa-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 36px;
}

.tt-wa-avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    background: var(--tt-light);
    border-radius: 50%;
}

.tt-wa-avatar img {
    width: 40px;
    height: auto;
    object-fit: contain;
}

.tt-wa-head strong {
    display: block;
    color: var(--tt-dark);
    font-family: var(--tt-font-heading);
    font-size: 16px;
}

.tt-wa-head span:not(.tt-wa-avatar) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tt-muted);
    font-size: 12.5px;
}

.tt-wa-head i {
    width: 8px;
    height: 8px;
    background: var(--wa);
    border-radius: 50%;
}

.tt-wa-bubble {
    position: relative;
    margin: 16px 0;
    padding: 12px 14px;
    color: var(--tt-text);
    background: #EAF8EF;
    border-radius: 4px 14px 14px 14px;
    font-size: 14px;
    line-height: 1.55;
}

.tt-wa-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    color: var(--tt-white);
    background: var(--wa-dark);
    border-radius: var(--tt-radius-sm);
    font-weight: 700;
    text-decoration: none;
}

.tt-wa-start:hover {
    color: var(--tt-white);
    background: #0E7A40;
}

.tt-wa-start svg {
    width: 20px;
    height: 20px;
}

@keyframes tt-wa-ring {
    0% { opacity: 0.5; transform: scale(1); }
    70%, 100% { opacity: 0; transform: scale(1.35); }
}

@media (max-width: 640px) {
    .tt-wa-button {
        right: 16px;
        bottom: 16px;
        width: 56px;
        padding: 0;
        justify-content: center;
    }

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

    /* On phones the prompt sits above the button instead of mid-screen. */
    .tt-wa-prompt {
        top: auto;
        right: 16px;
        bottom: 88px;
        transform: translateY(16px);
    }

    .tt-wa-prompt.is-open {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tt-wa-button::before {
        animation: none;
    }
}
