/* ====================================================================================
   Kall8 shared header + footer (Kall8.Web.Shared)
   Served at ~/_content/Kall8.Web.Shared/css/k8-chrome.css. Requires k8-tokens.css and
   Bootstrap 5 (navbar, collapse, dropdown). Header is sticky and under 64px on mobile.
   ==================================================================================== */

/* ---- Header ------------------------------------------------------------------------ */

.k8-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--k8-white);
    border-bottom: 1px solid var(--k8-border);
    box-shadow: var(--k8-shadow-sm);
}

.k8-navbar {
    min-height: 56px;                 /* mobile bar: 56px (< 64px) */
    padding-top: .375rem;
    padding-bottom: .375rem;
}

.k8-container {
    max-width: var(--k8-container-max);
}

.k8-brand {
    display: inline-flex;
    align-items: center;
    padding: 0;
    margin-right: 1rem;
}

.k8-brand img {
    display: block;
    height: 34px;
    width: auto;
}

/* Mobile actions: tap-to-call + menu button sit right of the logo. */
.k8-mobile-actions {
    gap: .25rem;
    margin-left: auto;
}

.k8-phone {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .5rem .625rem;
    color: var(--k8-green-text);
    font-family: var(--k8-font-heading);
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    border-radius: var(--k8-radius);
    white-space: nowrap;
}

.k8-phone:hover,
.k8-phone:focus-visible {
    color: var(--k8-green-text-hover);
    background: var(--k8-green-soft);
}

.k8-phone--mobile .k8-phone-text {
    font-size: .9rem;
}

.k8-icon {
    flex: 0 0 auto;
}

/* Hamburger */
.k8-toggler {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .625rem;
    border: 1px solid var(--k8-grey-300);
    border-radius: var(--k8-radius);
    background: var(--k8-white);
    color: var(--k8-dark);
    font-family: var(--k8-font-heading);
    font-weight: 700;
    font-size: .9rem;
    line-height: 1;
}

.k8-toggler:focus {
    box-shadow: none;
}

.k8-toggler-bars {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    width: 18px;
}

.k8-toggler-bars span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform var(--k8-transition), opacity var(--k8-transition);
}

.k8-toggler[aria-expanded="true"] .k8-toggler-bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.k8-toggler[aria-expanded="true"] .k8-toggler-bars span:nth-child(2) { opacity: 0; }
.k8-toggler[aria-expanded="true"] .k8-toggler-bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Nav links */
.k8-nav .nav-link {
    font-family: var(--k8-font-heading);
    font-weight: 600;
    font-size: .95rem;
    color: var(--k8-dark);
    padding: .625rem .875rem;
    border-radius: var(--k8-radius);
    background: transparent;
    border: 0;
}

.k8-nav .nav-link:hover,
.k8-nav .nav-link:focus-visible,
.k8-nav .nav-link.show {
    color: var(--k8-green-text-hover);
    background: var(--k8-green-soft);
}

.k8-nav .nav-link.active {
    color: var(--k8-green-text);
}

.k8-nav .nav-link.active::after {
    content: "";
    display: block;
    height: 3px;
    margin-top: 2px;
    background: var(--k8-green);
    border-radius: 2px;
}

/* Dropdown toggle is a <button> so it is keyboard operable without an href="#". */
.k8-nav .dropdown-toggle::after {
    margin-left: .35em;
    vertical-align: .15em;
}

.k8-menu {
    border: 1px solid var(--k8-border);
    border-radius: var(--k8-radius);
    box-shadow: var(--k8-shadow-lg);
    padding: .5rem;
    min-width: 16rem;
}

.k8-menu .dropdown-item {
    font-family: var(--k8-font-body);
    font-size: .95rem;
    color: var(--k8-grey-800);
    padding: .5rem .75rem;
    border-radius: var(--k8-radius-sm);
}

.k8-menu .dropdown-item:hover,
.k8-menu .dropdown-item:focus,
.k8-menu .dropdown-item:focus-visible {
    color: var(--k8-green-text-hover);
    background: var(--k8-green-soft);
}

.k8-menu .dropdown-item[aria-current="page"] {
    color: var(--k8-green-text);
    font-weight: 700;
}

/* Utility cluster: phone, Log in, Get started */
.k8-utility {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.k8-login {
    font-family: var(--k8-font-heading);
    font-weight: 700;
    font-size: .95rem;
    color: var(--k8-dark);
    text-decoration: none;
    padding: .5rem .75rem;
    border-radius: var(--k8-radius);
    white-space: nowrap;
}

.k8-login:hover,
.k8-login:focus-visible {
    color: var(--k8-green-text-hover);
    background: var(--k8-green-soft);
}

.k8-cta {
    padding: .5rem 1.125rem;
    white-space: nowrap;
}

/* Desktop */
@media (min-width: 992px) {
    .k8-navbar {
        min-height: var(--k8-header-height);
        padding-top: .5rem;
        padding-bottom: .5rem;
    }

    .k8-brand img {
        height: 38px;
    }

    .k8-nav {
        gap: .125rem;
    }

    /* Hover-open is added by k8-chrome.js (Bootstrap's own show()); this rule keeps the
       menu open while the pointer travels from the toggle to the menu. */
    .k8-dropdown > .dropdown-menu {
        margin-top: .25rem;
    }

    .k8-dropdown::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        height: .5rem;
        bottom: -.5rem;
    }

    .k8-dropdown {
        position: relative;
    }
}

/* Mobile menu: flat list under the bar. */
@media (max-width: 991.98px) {
    .k8-collapse {
        padding: .5rem 0 .75rem;
        border-top: 1px solid var(--k8-border);
        margin-top: .375rem;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .k8-nav .nav-link {
        padding: .75rem .5rem;
        font-size: 1rem;
        width: 100%;
        text-align: left;
    }

    .k8-nav .nav-link.active::after {
        display: none;
    }

    .k8-menu {
        border: 0;
        box-shadow: none;
        padding: 0 0 .25rem .75rem;
        background: transparent;
    }

    .k8-menu .dropdown-item {
        padding: .625rem .5rem;
    }

    .k8-utility {
        padding: .75rem .5rem 0;
        border-top: 1px solid var(--k8-border);
        margin-top: .5rem;
        gap: .75rem;
    }

    .k8-cta {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* ---- Footer ------------------------------------------------------------------------ */

.k8-footer {
    background: var(--k8-dark);
    color: var(--k8-grey-300);
    font-size: .95rem;
    margin-top: 3rem;
}

.k8-footer .k8-container {
    padding: 1rem;
    /*padding-bottom: 2rem;*/
}

.k8-footer-title {
    font-family: var(--k8-font-heading);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--k8-white);
    margin-bottom: .875rem;
}

.k8-footer-subtitle {
    font-family: var(--k8-font-heading);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--k8-grey-400);
    margin: 1.25rem 0 .625rem;
}

.k8-footer-links li {
    margin-bottom: .5rem;
}

.k8-footer-links a {
    color: var(--k8-grey-300);
    text-decoration: none;
}

.k8-footer-links a:hover,
.k8-footer-links a:focus-visible {
    color: var(--k8-white);
    text-decoration: underline;
}

.k8-footer a:focus-visible {
    outline-color: var(--k8-white);
}

.k8-footer-band {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.k8-address {
    font-style: normal;
    line-height: 1.7;
    margin: 0;
}

.k8-address-name {
    color: var(--k8-white);
    font-family: var(--k8-font-heading);
}

.k8-address a {
    color: var(--k8-grey-300);
}

.k8-address a:hover {
    color: var(--k8-white);
}

.k8-trustpilot {
    min-height: 24px;
}

.k8-stores-label {
    display: block;
    font-family: var(--k8-font-heading);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--k8-grey-400);
    margin-bottom: .625rem;
}

.k8-store-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0;
}

.k8-store-badge {
    display: inline-block;
    padding: .45rem .875rem;
    border: 1px solid var(--k8-grey-500);
    border-radius: var(--k8-radius);
    color: var(--k8-white);
    font-family: var(--k8-font-heading);
    font-weight: 700;
    font-size: .85rem;
    text-decoration: none;
    white-space: nowrap;
}

.k8-store-badge:hover,
.k8-store-badge:focus-visible {
    color: var(--k8-dark);
    background: var(--k8-green);
    border-color: var(--k8-green);
}

.k8-footer-bottom {
    background: var(--k8-dark-2);
    color: var(--k8-grey-400);
    font-size: .85rem;
    /*padding: 1rem 0;*/
    /*margin-top: 1rem;*/
}

.k8-social {
    display: flex;
    gap: 1rem;
}

.k8-social a {
    color: var(--k8-grey-300);
    text-decoration: none;
}

.k8-social a:hover,
.k8-social a:focus-visible {
    color: var(--k8-white);
    text-decoration: underline;
}

@media (min-width: 992px) {
    .k8-footer-band .col-lg-4:nth-child(3) {
        text-align: right;
    }

    .k8-footer-band .col-lg-4:nth-child(3) .k8-store-badges {
        justify-content: flex-end;
    }
}

/* ------------------------------------------------------------------------------------
   Toast (K8Toast.show in k8-chrome.js): the "request received" notice after a lead / help
   form submission on www and signup. Bottom-right on desktop, full width at the bottom on
   phones; above the sticky header (z 1030). Announced through aria-live.
   ------------------------------------------------------------------------------------ */
.k8-toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.k8-toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 14px 14px 14px 16px;
    background: var(--k8-white);
    color: var(--k8-text);
    border: 1px solid var(--k8-green-soft-2);
    border-left: 6px solid var(--k8-green);
    border-radius: var(--k8-radius-lg);
    box-shadow: var(--k8-shadow-lg);
    font-family: var(--k8-font-body);
    font-size: .95rem;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--k8-transition), transform var(--k8-transition);
}

.k8-toast.is-shown {
    opacity: 1;
    transform: none;
}

.k8-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--k8-green-soft);
    color: var(--k8-green-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex: none;
}

.k8-toast-title {
    display: block;
    font-family: var(--k8-font-heading);
    font-weight: 700;
    color: var(--k8-heading);
    margin-bottom: 2px;
}

.k8-toast-text { margin: 0; }

.k8-toast-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--k8-grey-500);
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    border-radius: var(--k8-radius-sm);
}

.k8-toast-close:hover,
.k8-toast-close:focus-visible { color: var(--k8-heading); outline: 2px solid var(--k8-focus); outline-offset: 2px; }

@media (max-width: 575.98px) {
    .k8-toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .k8-toast { transition: none; transform: none; }
}
