/*
Theme Name: Auto Final – Aqualine
Description: Viimeistelty kaksipalveluvalikko: kaksi suoraa ajanvarausreittiä, terävä tunnuslause ja selkeä mobiilivalikko. Vaatii Aqualine-emoteeman.
Author: Auto Final Oy
Template: aqualine
Version: 0.1.8
Requires PHP: 7.4
Text Domain: auto-final-aqualine
*/

/* Presentation only. All selectors are scoped to the Auto Final header.
   No global page reset, booking-form styles, data changes or parent-file edits. */
.af-aq-header.af-aq-header--premium {
    --af-aq-green: #04cf1f;
    --af-aq-white: #f7f8f7;
    --af-aq-font: "Roboto", "Segoe UI", Arial, sans-serif;
    --af-aq-logo-width: 140px;
    --af-aq-service-size: clamp(19px, 1.85vw, 27px);
    --af-aq-link-size: 15px;
    --af-aq-button-width: 120px;
    position: relative;
    isolation: isolate;
    z-index: 70;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: #090708;
    color: var(--af-aq-white);
    font-family: var(--af-aq-font);
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    text-align: left;
    overflow: visible;
}
.af-aq-header.af-aq-header--system { --af-aq-font: "Segoe UI", Arial, sans-serif; }
.af-aq-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(9,7,8,.18), rgba(9,7,8,.38) 23%, rgba(9,7,8,.92) 42%, rgba(9,7,8,.94) 50%, rgba(9,7,8,.92) 58%, rgba(9,7,8,.38) 77%, rgba(9,7,8,.18)),
        linear-gradient(rgba(0,0,0,.38), rgba(0,0,0,.38)),
        url("assets/header.webp") center 48% / cover no-repeat;
}
.af-aq-header::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.15) 28%, rgba(255,255,255,.15) 72%, transparent);
}
.af-aq-header, .af-aq-header * { box-sizing: border-box; }
.af-aq-header .af-aq-shell {
    display: grid;
    grid-template-columns: minmax(0,1fr) clamp(176px,17vw,248px) minmax(0,1fr);
    grid-template-areas: "tires logo care" "tires sub care";
    align-items: center;
    column-gap: 22px;
    row-gap: 0;
    max-width: 1520px;
    width: 100%;
    margin: 0 auto;
    padding: 3px 28px;
}
.af-aq-header nav, .af-aq-header details {
    float: none;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font: inherit;
}
.af-aq-header a, .af-aq-header summary, .af-aq-header .af-aq-unset {
    position: relative;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--af-aq-white);
    font-family: var(--af-aq-font);
    font-style: normal;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;
    text-shadow: none;
    box-shadow: none;
    -webkit-tap-highlight-color: rgba(4,207,31,.14);
}
.af-aq-header a::before, .af-aq-header a::after, .af-aq-header summary::before { content: none; }
.af-aq-header a, .af-aq-header summary { transition: color 140ms ease, background-color 140ms ease; }
.af-aq-header a:focus-visible, .af-aq-header summary:focus-visible {
    outline: 2px solid var(--af-aq-green);
    outline-offset: 4px;
}
.af-aq-header summary { cursor: pointer; list-style: none; user-select: none; }
.af-aq-header summary::-webkit-details-marker { display: none; }
.af-aq-header summary::marker { content: ""; }
.af-aq-header .af-aq-unset { opacity: .62; cursor: not-allowed; }
.af-aq-header .af-aq-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* True vertical centering across the complete logo + secondary-nav block. */
.af-aq-header .af-aq-wing {
    display: flex;
    align-items: center;
    align-self: center;
    gap: 14px;
    min-width: 0;
    width: 100%;
    margin: 0;
}
.af-aq-header .af-aq-wing--tires { grid-area: tires; justify-content: flex-start; }
.af-aq-header .af-aq-wing--care { grid-area: care; justify-content: flex-end; }
.af-aq-header .af-aq-service {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 0;
    font-size: var(--af-aq-service-size);
    font-weight: 400;
    line-height: 1.22;
    letter-spacing: .115em;
    text-transform: uppercase;
    color: var(--af-aq-white) !important;
}
.af-aq-header .af-aq-service-label { max-width: 100%; overflow-wrap: anywhere; }
.af-aq-header .af-aq-book {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 var(--af-aq-button-width);
    gap: 8px;
    width: var(--af-aq-button-width);
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;
    border: 2px solid #04cf1f;
    border-radius: 11px;
    background-color: rgba(4,207,31,.28);
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-shadow: none;
    box-shadow: none;
    filter: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    overflow-wrap: anywhere;
}
.af-aq-header .af-aq-arrow {
    display: block;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin: 0;
    color: #ffffff;
    fill: none;
}
.af-aq-header .af-aq-short-label { display: none; }
.af-aq-header a.af-aq-book:hover, .af-aq-header a.af-aq-book:focus-visible {
    background-color: rgba(4,207,31,.38);
    border-color: #04cf1f;
    color: #ffffff !important;
}
.af-aq-header a.af-aq-book:focus-visible { outline-color: #ffffff; }

/* The source PNG stays untouched. Crop ONLY the bundled bitmap's tiny slogan
   from its display window, then render the slogan once as real HTML text. */
.af-aq-header .af-aq-logo {
    grid-area: logo;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    justify-self: center;
    gap: 2px;
    width: max-content;
    max-width: 100%;
    line-height: 1;
}
.af-aq-header .af-aq-mark-window {
    display: block;
    width: var(--af-aq-logo-width);
    max-width: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
}
.af-aq-header .af-aq-logo--bundled .af-aq-mark-window {
    height: calc(var(--af-aq-logo-width) * .782);
    overflow: hidden;
    mix-blend-mode: lighten;
}
.af-aq-header .af-aq-mark-window img {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    filter: none;
    object-fit: contain;
}
.af-aq-header .af-aq-logo--custom .af-aq-mark-window { width: 184px; max-width: 100%; }
.af-aq-header .af-aq-logo--custom img { width: 100%; height: 120px; }
.af-aq-header .af-aq-tagline {
    display: block;
    max-width: 200px;
    padding: 0;
    color: #ffffff;
    font-family: var(--af-aq-font);
    font-size: 10.5px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: .11em;
    text-align: center;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

/* Secondary nav may be wider than the logo. It stays on its own row, centered
   on the page rather than on the combined widths of the two service names. */
.af-aq-header .af-aq-sub {
    grid-area: sub;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    gap: 22px;
    flex-wrap: wrap;
    width: max-content;
    max-width: min(680px,calc(100vw - 48px));
    min-height: 28px;
}
.af-aq-header .af-aq-sub > a,
.af-aq-header .af-aq-sub > .af-aq-unset,
.af-aq-header .af-aq-subtoggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    max-width: 260px;
    padding: 4px 0;
    font-size: var(--af-aq-link-size);
    font-weight: 400;
    line-height: 1.25;
    color: var(--af-aq-white) !important;
    overflow-wrap: anywhere;
}
.af-aq-header .af-aq-sub > a[aria-current="page"]::after,
.af-aq-header a.af-aq-service[aria-current="page"]::after,
.af-aq-header .af-aq-current-section > .af-aq-subtoggle::before {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 2px;
    background: var(--af-aq-green);
    pointer-events: none;
}
.af-aq-header a.af-aq-service:hover,
.af-aq-header a.af-aq-service:focus-visible,
.af-aq-header .af-aq-sub > a:hover,
.af-aq-header .af-aq-sub > a:focus-visible,
.af-aq-header .af-aq-subtoggle:hover,
.af-aq-header .af-aq-subtoggle:focus-visible,
.af-aq-header .af-aq-offer[open] > .af-aq-subtoggle {
    color: var(--af-aq-green) !important;
}
.af-aq-header .af-aq-offer { position: relative; min-width: 0; max-width: 260px; }
.af-aq-header .af-aq-subtoggle { gap: 8px; }
.af-aq-header .af-aq-subtoggle::after,
.af-aq-header .af-aq-mobile-group-label::after {
    content: "";
    display: block;
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    margin: -4px 2px 0;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}
.af-aq-header .af-aq-offer[open] > .af-aq-subtoggle::after,
.af-aq-header .af-aq-mobile-group[open] > .af-aq-mobile-group-label::after {
    transform: rotate(225deg);
    margin-top: 3px;
}
.af-aq-header .af-aq-offer-menu {
    position: absolute;
    top: 100%; /* No dead hover gap. */
    right: -12px;
    display: none;
    z-index: 5;
    width: 284px;
    max-width: calc(100vw - 24px);
    max-height: var(--af-aq-panel-height,60vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    border: 1px solid #344039;
    border-radius: 10px;
    background: #0e1310;
    box-shadow: none;
}
.af-aq-header .af-aq-offer[open] > .af-aq-offer-menu { display: grid; gap: 2px; }
.af-aq-header .af-aq-offer-menu a, .af-aq-header .af-aq-offer-menu .af-aq-unset {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--af-aq-white) !important;
    text-align: left;
    overflow-wrap: anywhere;
}
.af-aq-header .af-aq-offer-menu a:hover,
.af-aq-header .af-aq-offer-menu a:focus-visible {
    background-color: rgba(4,207,31,.09);
    color: var(--af-aq-green) !important;
}
.af-aq-header .af-aq-offer-menu a[aria-current="page"] { box-shadow: inset 2px 0 var(--af-aq-green); }
.af-aq-header .af-aq-mobile-nav { display: none; }

@media (min-width:960px) and (max-width:1199px) {
    .af-aq-header.af-aq-header--premium {
        --af-aq-logo-width: 130px;
        --af-aq-service-size: clamp(18px,1.85vw,22px);
        --af-aq-button-width: 108px;
        --af-aq-link-size: 14px;
    }
    .af-aq-header .af-aq-shell { column-gap: 16px; padding-right: 20px; padding-left: 20px; }
    .af-aq-header .af-aq-wing { gap: 12px; }
    .af-aq-header .af-aq-service { letter-spacing: .08em; }
    .af-aq-header .af-aq-book { padding-right: 8px; padding-left: 8px; font-size: 13px; }
    .af-aq-header .af-aq-sub { gap: 20px; }
}

/* Phones and narrow tablets: logo centered, 44px toggle at top-right.
   Two equal-width booking paths are always visible below the logo. */
@media (max-width:959px) {
    .af-aq-header.af-aq-header--premium {
        --af-aq-logo-width: 104px;
        --af-aq-service-size: 13px;
    }
    .af-aq-header::before {
        background:
            linear-gradient(90deg, rgba(9,7,8,.45), rgba(9,7,8,.91) 40%, rgba(9,7,8,.94) 50%, rgba(9,7,8,.91) 60%, rgba(9,7,8,.45)),
            linear-gradient(rgba(0,0,0,.30),rgba(0,0,0,.30)),
            url("assets/header.webp") center 48% / cover no-repeat;
    }
    .af-aq-header .af-aq-shell {
        grid-template-columns: repeat(2,minmax(0,1fr));
        grid-template-areas: "logo logo" "tires care" "mobile mobile";
        column-gap: 22px;
        row-gap: 6px;
        max-width: 800px;
        padding: 8px 16px 10px;
    }
    .af-aq-header .af-aq-logo { justify-self: center; max-width: calc(100vw - 140px); }
    .af-aq-header .af-aq-logo--custom .af-aq-mark-window { width: 124px; }
    .af-aq-header .af-aq-logo--custom img { height: 86px; }
    .af-aq-header .af-aq-tagline { max-width: 160px; font-size: 10px; letter-spacing: .07em; padding-bottom: 0; }
    .af-aq-header .af-aq-wing {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        align-self: stretch;
        justify-content: flex-start;
        gap: 6px;
        max-width: 360px;
    }
    .af-aq-header .af-aq-wing--tires { justify-self: end; }
    .af-aq-header .af-aq-wing--care { justify-self: start; }
    .af-aq-header .af-aq-wing--care::before {
        content: "";
        position: absolute;
        top: 4px;
        bottom: 4px;
        left: -12px;
        width: 1px;
        pointer-events: none;
        background: rgba(255,255,255,.16);
    }
    .af-aq-header .af-aq-service {
        order: -1;
        justify-content: center;
        flex: 1 0 auto;
        width: 100%;
        min-height: 26px;
        font-size: var(--af-aq-service-size);
        letter-spacing: .085em;
        text-align: center;
    }
    .af-aq-header .af-aq-service-label { width: 100%; }
    .af-aq-header .af-aq-book {
        flex: 0 0 auto;
        width: 100%;
        min-height: 46px;
        padding: 11px 10px;
        font-size: 15px;
        border-radius: 10px;
    }
    .af-aq-header .af-aq-full-label { display: none; }
    .af-aq-header .af-aq-short-label { display: inline; }
    .af-aq-header .af-aq-sub { display: none; }
    .af-aq-header .af-aq-mobile-nav {
        grid-area: mobile;
        display: block;
        width: 100%;
        height: 0;
        margin: -6px 0 0;
        padding: 0;
        position: static;
    }
    .af-aq-header .af-aq-mobile-nav > summary {
        position: absolute;
        top: 25px;
        right: max(12px,calc((100% - 800px)/2 + 12px));
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border: 0;
        border-radius: 6px;
        color: #ffffff;
        line-height: 1;
    }
    .af-aq-header .af-aq-mobile-nav > summary::after { content: none; }
    .af-aq-header .af-aq-mobile-nav > summary:hover,
    .af-aq-header .af-aq-mobile-nav > summary:focus-visible { color: var(--af-aq-green); }
    .af-aq-header .af-aq-hamburger { position: relative; display: block; width: 22px; height: 16px; }
    .af-aq-header .af-aq-hamburger > span {
        display: block;
        position: absolute;
        left: 0;
        width: 22px;
        height: 1.5px;
        border-radius: 1px;
        background: currentColor;
        transition: transform 140ms ease,opacity 140ms ease;
    }
    .af-aq-header .af-aq-hamburger > span:nth-child(1) { top: 0; }
    .af-aq-header .af-aq-hamburger > span:nth-child(2) { top: 7px; }
    .af-aq-header .af-aq-hamburger > span:nth-child(3) { top: 14px; }
    .af-aq-header .af-aq-mobile-nav[open] .af-aq-hamburger > span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .af-aq-header .af-aq-mobile-nav[open] .af-aq-hamburger > span:nth-child(2) { opacity: 0; }
    .af-aq-header .af-aq-mobile-nav[open] .af-aq-hamburger > span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .af-aq-header .af-aq-mobile-panel {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 5;
        width: 100%;
        max-height: var(--af-aq-panel-height,60vh);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 4px max(16px,calc((100% - 768px)/2)) 10px;
        border-top: 1px solid #2d3530;
        border-bottom: 1px solid #2d3530;
        background: #0e1310;
        box-shadow: none;
    }
    .af-aq-header .af-aq-mobile-nav[open] > .af-aq-mobile-panel { display: block; }
    .af-aq-header .af-aq-mobile-panel > a,
    .af-aq-header .af-aq-mobile-panel > .af-aq-unset,
    .af-aq-header .af-aq-mobile-group-label {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        width: 100%;
        min-height: 48px;
        padding: 12px 10px;
        border-bottom: 1px solid #27312a;
        color: var(--af-aq-white) !important;
        font-size: 16px;
        font-weight: 400;
        line-height: 1.4;
        overflow-wrap: anywhere;
    }
    .af-aq-header .af-aq-mobile-panel > a::after {
        content: "";
        flex: 0 0 7px;
        width: 7px;
        height: 7px;
        margin-right: 2px;
        border-top: 1px solid currentColor;
        border-right: 1px solid currentColor;
        transform: rotate(45deg);
    }
    .af-aq-header .af-aq-mobile-panel a[aria-current="page"] { box-shadow: inset 2px 0 var(--af-aq-green); }
    .af-aq-header .af-aq-mobile-sub { display: none; padding: 4px 0 4px 12px; }
    .af-aq-header .af-aq-mobile-group[open] > .af-aq-mobile-sub { display: grid; }
    .af-aq-header .af-aq-mobile-sub a, .af-aq-header .af-aq-mobile-sub .af-aq-unset {
        display: flex;
        align-items: center;
        min-height: 46px;
        padding: 10px;
        border-left: 1px solid #344039;
        font-size: 15px;
        line-height: 1.4;
        color: var(--af-aq-white) !important;
        overflow-wrap: anywhere;
    }
    .af-aq-header .af-aq-mobile-panel a:hover,
    .af-aq-header .af-aq-mobile-panel a:focus-visible,
    .af-aq-header .af-aq-mobile-group-label:hover,
    .af-aq-header .af-aq-mobile-group-label:focus-visible,
    .af-aq-header .af-aq-mobile-group[open] > .af-aq-mobile-group-label {
        color: var(--af-aq-green) !important;
        background: rgba(4,207,31,.065);
    }
    .af-aq-header .af-aq-current-section > .af-aq-mobile-group-label { box-shadow: inset 2px 0 var(--af-aq-green); }
}
/* Shared rows keep both mobile buttons level even after long custom names.
   The earlier flex layout remains a usable fallback on older browsers. */
@supports (grid-template-rows: subgrid) {
    @media (max-width:959px) {
        .af-aq-header .af-aq-shell {
            grid-template-areas: "logo logo" "tires care" "tires care" "mobile mobile";
        }
        .af-aq-header .af-aq-wing {
            display: grid;
            grid-template-columns: minmax(0,1fr);
            grid-template-rows: subgrid;
            row-gap: 6px;
        }
        .af-aq-header .af-aq-service { grid-row: 1; order: 0; }
        .af-aq-header .af-aq-book { grid-row: 2; align-self: stretch; height: 100%; }
    }
}
@media (max-width:359px) {
    .af-aq-header .af-aq-shell { column-gap: 16px; padding-right: 12px; padding-left: 12px; }
    .af-aq-header .af-aq-wing--care::before { left: -9px; }
    .af-aq-header .af-aq-service { font-size: 12px; letter-spacing: .04em; }
    .af-aq-header .af-aq-book { font-size: 14px; padding-right: 8px; padding-left: 8px; }
}
@media (prefers-reduced-motion:reduce) {
    .af-aq-header a, .af-aq-header summary, .af-aq-header .af-aq-hamburger > span { transition: none; }
}
@media (forced-colors:active) {
    .af-aq-header.af-aq-header--premium { background: Canvas; color: CanvasText; }
    .af-aq-header::before, .af-aq-header::after { display: none; }
    .af-aq-header .af-aq-book { border-color: ButtonText; }
    .af-aq-header .af-aq-hamburger > span { background: ButtonText; }
    .af-aq-header .af-aq-sub > a[aria-current="page"]::after { background: LinkText; }
}
