﻿/* =========================================================
   QPET PUBLIC SHELL
   Header, navigation and footer
   Requires qpet-brand.css
   ========================================================= */

.public-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: var(--qpet-navy);
    background: var(--qpet-white);
    font-family: var(--qpet-font-body);
}

    .public-body > .qpet-shell-main {
        flex: 1 0 auto;
        width: 100%;
        min-width: 0;
    }

.qpet-shell-header *,
.qpet-shell-footer * {
    box-sizing: border-box;
}

html:has(.qpet-shell-header) {
    scroll-padding-top: 96px;
}

/* =========================================================
   HEADER
   ========================================================= */

.public-body .qpet-shell-header {
    position: sticky;
    top: 0;
    z-index: var(--qpet-z-header);
    width: 100%;
    flex: 0 0 auto;
    background: #fff;
    border-bottom: 3px solid var(--qpet-secondary);
    box-shadow: 0 7px 22px rgba(18, 59, 99, .065);
    transition: transform 200ms ease;
}

    .public-body .qpet-shell-header::after {
        content: "";
        position: absolute;
        bottom: -3px;
        left: 0;
        width: min(23vw, 250px);
        height: 3px;
        background: var(--qpet-accent);
        pointer-events: none;
    }

    .public-body .qpet-shell-header.site-header-hidden {
        transform: translateY(-100%);
    }

    .public-body .qpet-shell-header:focus-within,
    .public-body .qpet-shell-header[data-menu-open="true"] {
        transform: translateY(0);
    }

.qpet-shell-nav-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(16px, 3vw, 42px);
    min-height: 82px;
}

/* =========================================================
   LOGO

   The supplied basic logo uses a square transparent canvas.
   Centre the visible artwork inside the header and contain
   the empty transparent margins.
   ========================================================= */

.qpet-shell-brand {
    position: relative;
    display: block;
    flex: 0 0 150px;
    width: 150px;
    height: 80px;
    overflow: hidden;
    text-decoration: none;
}

.qpet-shell-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 145px;
    height: 145px;
    max-width: none;
    object-fit: contain;
    transform: translate(-50%, -50%);
}

.qpet-shell-brand:focus-visible,
.qpet-shell-nav a:focus-visible,
.qpet-shell-footer a:focus-visible,
.qpet-shell-menu-toggle:focus-visible {
    outline: 3px solid var(--qpet-secondary);
    outline-offset: 3px;
    border-radius: 7px;
}

/* =========================================================
   DESKTOP NAVIGATION
   ========================================================= */

.qpet-shell-nav {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    gap: clamp(12px, 2vw, 28px);
}

.qpet-shell-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 0;
    color: var(--qpet-navy);
    background: transparent;
    font-size: .91rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    transition: color 150ms ease;
}

    .qpet-shell-nav-link::after {
        content: "";
        position: absolute;
        bottom: 3px;
        left: 0;
        width: 100%;
        height: 3px;
        border-radius: 3px;
        background: var(--qpet-accent);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 170ms ease;
    }

    .qpet-shell-nav-link:hover,
    .qpet-shell-nav-link.is-active {
        color: var(--qpet-primary);
    }

        .qpet-shell-nav-link:hover::after,
        .qpet-shell-nav-link.is-active::after {
            transform: scaleX(1);
        }

/* =========================================================
   CONTACT BUTTON
   ========================================================= */

.qpet-shell-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 46px;
    padding: 11px 20px;
    border: 1px solid var(--qpet-primary);
    border-radius: 9px;
    color: #fff;
    background: var(--qpet-primary);
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 150ms ease, border-color 150ms ease;
}

    .qpet-shell-contact:hover,
    .qpet-shell-contact.is-active {
        color: #fff;
        background: var(--qpet-primary-hover);
        border-color: var(--qpet-primary-hover);
    }

/* =========================================================
   MOBILE MENU BUTTON
   ========================================================= */

.qpet-shell-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    padding: 0;
    color: var(--qpet-navy);
    background: var(--qpet-primary-soft);
    border: 1px solid #B5DDE6;
    border-radius: 10px;
    cursor: pointer;
}

.qpet-shell-menu-icon {
    position: relative;
    display: block;
    width: 22px;
    height: 18px;
}

    .qpet-shell-menu-icon span {
        position: absolute;
        left: 0;
        width: 22px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform 170ms ease, opacity 170ms ease;
    }

        .qpet-shell-menu-icon span:nth-child(1) {
            top: 1px;
        }

        .qpet-shell-menu-icon span:nth-child(2) {
            top: 8px;
        }

        .qpet-shell-menu-icon span:nth-child(3) {
            top: 15px;
        }

.qpet-shell-menu-toggle[aria-expanded="true"]
.qpet-shell-menu-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.qpet-shell-menu-toggle[aria-expanded="true"]
.qpet-shell-menu-icon span:nth-child(2) {
    opacity: 0;
}

.qpet-shell-menu-toggle[aria-expanded="true"]
.qpet-shell-menu-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   FOOTER
   ========================================================= */

.public-body .qpet-shell-footer {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    color: #fff;
    background: linear-gradient( 125deg, #123B63 0%, #0B5673 100% );
    border-top: 4px solid var(--qpet-accent);
}

.qpet-shell-footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, .75fr) minmax(0, 1fr);
    gap: clamp(22px, 4vw, 52px);
    padding-block: 36px 28px;
}

.qpet-shell-footer-brand,
.qpet-shell-footer-column {
    min-width: 0;
}

.qpet-shell-footer-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 300px);
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
}

.qpet-shell-footer-logo {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.qpet-shell-footer-description {
    max-width: 370px;
    margin: 15px 0 0;
    color: #E5F1F5;
    font-size: .87rem;
    line-height: 1.7;
}

.qpet-shell-footer-title {
    margin: 0 0 11px;
    color: #fff;
    font-size: 1rem;
    font-weight: 750;
}

    .qpet-shell-footer-title::after {
        content: "";
        display: block;
        width: 30px;
        height: 3px;
        margin-top: 9px;
        border-radius: 3px;
        background: var(--qpet-accent);
    }

/* =========================================================
   FOOTER LINKS
   ========================================================= */

.qpet-shell-footer-links,
.qpet-shell-footer-locations {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .qpet-shell-footer-links a {
        display: inline-flex;
        align-items: center;
        min-height: 38px;
        color: #E5F1F5;
        font-size: .87rem;
        text-decoration: none;
    }

        .qpet-shell-footer-links a:hover,
        .qpet-shell-footer-branch-link:hover {
            color: #fff;
            text-decoration: underline;
            text-underline-offset: 4px;
        }

/* =========================================================
   FOOTER LOCATIONS
   ========================================================= */

.qpet-shell-footer-locations {
    gap: 12px;
}

    .qpet-shell-footer-locations li {
        position: relative;
        display: grid;
        gap: 3px;
        padding-left: 16px;
        font-size: .86rem;
        line-height: 1.45;
    }

        .qpet-shell-footer-locations li::before {
            content: "";
            position: absolute;
            top: 7px;
            left: 0;
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: var(--qpet-accent);
        }

    .qpet-shell-footer-locations strong {
        color: #fff;
    }

    .qpet-shell-footer-locations span {
        color: #D5E8EE;
    }

.qpet-shell-footer-branch-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    margin-top: 10px;
    color: #fff;
    font-size: .87rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* =========================================================
   FOOTER BOTTOM
   ========================================================= */

.qpet-shell-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-block: 16px;
    border-top: 1px solid rgba(255, 255, 255, .22);
}

    .qpet-shell-footer-bottom p {
        margin: 0;
        color: #D5E8EE;
        font-size: .76rem;
    }

/* =========================================================
   MOBILE NAVIGATION AND TABLETS
   ========================================================= */

@media (max-width: 900px) {

    html:has(.qpet-shell-header) {
        scroll-padding-top: 83px;
    }

    .public-body .qpet-shell-header {
        position: relative;
    }

    .qpet-shell-nav-wrap {
        flex-wrap: wrap;
        min-height: 76px;
        gap: 0;
    }

    .qpet-shell-brand {
        flex-basis: 133px;
        width: 133px;
        height: 74px;
    }

    .qpet-shell-logo {
        width: 131px;
        height: 131px;
    }

    /*
       Without JavaScript the links remain visible.
    */

    .qpet-shell-nav {
        flex: 0 0 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 1px;
        padding-bottom: 12px;
    }

    .qpet-shell-nav-link {
        min-height: 47px;
        padding: 12px 14px;
        white-space: normal;
    }

        .qpet-shell-nav-link::after {
            display: none;
        }

        .qpet-shell-nav-link.is-active {
            background: var(--qpet-primary-soft);
            border-radius: 6px;
        }

    .qpet-shell-contact {
        width: 100%;
        min-height: 48px;
        margin-top: 6px;
    }

    /*
       Collapsible navigation when JS is ready.
    */

    .public-body
    .qpet-shell-header[data-nav-ready="true"] {
        position: sticky;
    }

    .qpet-shell-header[data-nav-ready="true"]
    .qpet-shell-menu-toggle {
        display: inline-flex;
    }

    .qpet-shell-header[data-nav-ready="true"]
    .qpet-shell-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        max-height: calc(100dvh - 90px);
        overflow-y: auto;
        padding: 12px;
        background: #fff;
        border: 1px solid var(--qpet-border);
        border-top: 3px solid var(--qpet-accent);
        border-radius: 0 0 12px 12px;
        box-shadow: var(--qpet-shadow-lg);
    }

        .qpet-shell-header[data-nav-ready="true"]
        .qpet-shell-nav.open {
            display: flex;
        }

    .qpet-shell-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }

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

/* =========================================================
   MOBILE PHONES
   ========================================================= */

@media (max-width: 560px) {

    .qpet-shell-nav-wrap {
        min-height: 72px;
    }

    .qpet-shell-brand {
        flex-basis: 126px;
        width: 126px;
        height: 70px;
    }

    .qpet-shell-logo {
        width: 125px;
        height: 125px;
    }

    .qpet-shell-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 22px 16px;
        padding-block: 28px;
    }

    .qpet-shell-footer-brand {
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, .22);
    }

    .qpet-shell-footer-logo-link {
        width: min(100%, 275px);
    }

    .qpet-shell-footer-title {
        font-size: .91rem;
    }

    .qpet-shell-footer-links a {
        min-height: 44px;
        font-size: .82rem;
    }

    .qpet-shell-footer-locations li,
    .qpet-shell-footer-branch-link {
        font-size: .81rem;
    }

    .qpet-shell-footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 350px) {

    .qpet-shell-footer-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .qpet-shell-footer-brand {
        grid-column: auto;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .public-body .qpet-shell-header,
    .qpet-shell-nav-link,
    .qpet-shell-nav-link::after,
    .qpet-shell-menu-icon span {
        transition: none;
    }

        .public-body .qpet-shell-header.site-header-hidden {
            transform: none;
        }
}
