/* ==========================================================================
   Blessing Your Scalp — public site header & footer
   --------------------------------------------------------------------------
   Self-contained: does not depend on the Bootstrap template's `.main-header`
   markup or on assets/js/script.js. The mobile drawer is driven by Alpine,
   which ships with Livewire 3 and is already loaded on every public page.
   ========================================================================== */

:root {
    --bys-rose: #be6d76;
    --bys-rose-deep: #a85961;
    --bys-cream: #fbf4f0;
    --bys-blush: #f5e6e0;
    --bys-white: #ffffff;
    --bys-charcoal: #35312f;
    --bys-espresso: #302c2a;
    /* Body copy. Derived one step darker than the system's --bys-stone
       (#8a8582), which only reaches 3.36:1 on cream and so fails AA for
       body text. This holds 4.8:1. */
    --bys-body: #6f6a67;
    --bys-muted: #8a8582;
    --bys-divider: #e3e3e3;

    --bys-header-h: 68px;
    --bys-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (min-width: 992px) {
    :root {
        --bys-header-h: 84px;
    }
}

/* Alpine hides x-cloak elements until it has initialised. */
[x-cloak] {
    display: none !important;
}

/* Anchor targets (e.g. /#contact) must clear the sticky header, or the
   heading they name lands underneath it. */
:target,
section[id],
[id^='bys-'] {
    scroll-margin-top: calc(var(--bys-header-h) + 24px);
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* --------------------------------------------------------------------------
   Template override
   --------------------------------------------------------------------------
   The template gives .boxed_wrapper `overflow: hidden`, which makes it a
   scroll container and silently cancels `position: sticky` on the header.
   `overflow-x: clip` still prevents sideways scrolling — the reason the rule
   exists — without creating that container.
   -------------------------------------------------------------------------- */

/* !important is required only because style.css sets `overflow: hidden
   !important` here; `overflow-x: clip` keeps the horizontal clipping. */
.boxed_wrapper {
    overflow: visible !important;
    overflow-x: clip !important;
}

/* bootstrap.css puts `overflow-x: hidden` on body, which makes body the
   scroll container and has the same sticky-cancelling effect. */
body {
    overflow-x: clip;
}

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

.bys-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--bys-divider);
    font-family: 'Jost', sans-serif;
}

/* Opaque while the drawer is open so the drawer never bleeds through. */
.bys-header.is-open {
    background: var(--bys-white);
}

.bys-header__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--bys-header-h);
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 992px) {
    .bys-header__inner {
        padding: 0 40px;
    }
}

.bys-header__logo {
    display: block;
    flex: 0 0 auto;
    line-height: 0;
}

.bys-header__logo img {
    display: block;
    width: auto;
    height: 40px;
}

@media (min-width: 992px) {
    .bys-header__logo img {
        height: 52px;
    }
}

/* --------------------------------------------------------------------------
   Desktop navigation
   -------------------------------------------------------------------------- */

.bys-nav {
    display: none;
}

@media (min-width: 992px) {
    .bys-nav {
        display: flex;
        align-items: center;
        gap: 4px;
        margin: 0 auto;
    }
}

.bys-nav__link {
    position: relative;
    display: block;
    padding: 10px 14px;
    color: var(--bys-charcoal);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: color 200ms var(--bys-ease);
}

.bys-nav__link::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 1.5px;
    background: var(--bys-rose);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 240ms var(--bys-ease);
}

.bys-nav__link:hover,
.bys-nav__link:focus-visible {
    color: var(--bys-rose-deep);
}

.bys-nav__link:hover::after,
.bys-nav__link[aria-current='page']::after {
    transform: scaleX(1);
}

.bys-nav__link[aria-current='page'] {
    color: var(--bys-rose-deep);
}

/* --------------------------------------------------------------------------
   Header tools (account, cart, booking CTA, drawer toggle)
   -------------------------------------------------------------------------- */

.bys-header__tools {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.bys-tool {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    color: var(--bys-charcoal);
    cursor: pointer;
    transition: color 200ms var(--bys-ease);
}

.bys-tool:hover,
.bys-tool:focus-visible {
    color: var(--bys-rose-deep);
}

.bys-tool svg {
    display: block;
    width: 21px;
    height: 21px;
}

.bys-tool__count {
    position: absolute;
    top: 5px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--bys-rose);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 17px;
    text-align: center;
}

/* Account link is a nicety on desktop, not worth the header width on phones. */
.bys-tool--account {
    display: none;
}

@media (min-width: 768px) {
    .bys-tool--account {
        display: inline-flex;
    }
}

.bys-header__cta {
    display: none;
}

@media (min-width: 1100px) {
    .bys-header__cta {
        display: inline-flex;
        align-items: center;
        margin-left: 12px;
        padding: 13px 26px;
        border-radius: 30px;
        background: var(--bys-rose);
        box-shadow: 0 4px 15px rgba(190, 109, 118, 0.3);
        color: #fff;
        font-size: 0.8125rem;
        font-weight: 500;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        text-decoration: none;
        transition: background-color 260ms var(--bys-ease), box-shadow 260ms var(--bys-ease);
    }

    .bys-header__cta:hover,
    .bys-header__cta:focus-visible {
        background: var(--bys-charcoal);
        box-shadow: 0 6px 18px rgba(53, 49, 47, 0.28);
        color: #fff;
    }
}

/* .bys-tool is a flex row; the bars must stack, not sit side by side. */
.bys-burger {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (min-width: 992px) {
    .bys-burger {
        display: none;
    }
}

.bys-burger__bar {
    display: block;
    width: 20px;
    height: 1.5px;
    background: currentColor;
    transition: transform 260ms var(--bys-ease), opacity 180ms linear;
}

.bys-burger__bar + .bys-burger__bar {
    margin-top: 5px;
}

.bys-burger[aria-expanded='true'] .bys-burger__bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.bys-burger[aria-expanded='true'] .bys-burger__bar:nth-child(2) {
    opacity: 0;
}

.bys-burger[aria-expanded='true'] .bys-burger__bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Mobile drawer
   -------------------------------------------------------------------------- */

.bys-drawer {
    position: fixed;
    inset: var(--bys-header-h) 0 0 0;
    z-index: 49;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 8px 20px 40px;
    background: var(--bys-white);
    -webkit-overflow-scrolling: touch;
}

.bys-drawer[hidden] {
    display: none;
}

.bys-drawer__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bys-drawer__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 56px of vertical room - a comfortable thumb target. */
    min-height: 56px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--bys-divider);
    color: var(--bys-charcoal);
    font-size: 1.0625rem;
    font-weight: 500;
    text-decoration: none;
}

/* Without an explicit hover colour these fall through to Bootstrap's default
   link blue, which is jarring against the palette. */
.bys-drawer__link:hover,
.bys-drawer__link:focus-visible,
.bys-drawer__link[aria-current='page'] {
    color: var(--bys-rose-deep);
}

.bys-drawer__meta a:hover,
.bys-drawer__meta a:focus-visible,
.bys-drawer__socials a:hover,
.bys-drawer__socials a:focus-visible {
    color: var(--bys-rose-deep);
    border-color: var(--bys-rose);
}

.bys-drawer__link svg {
    width: 7px;
    height: 11px;
    color: var(--bys-muted);
}

.bys-drawer__cta {
    display: block;
    margin: 28px 0 24px;
    padding: 19px 24px;
    border-radius: 30px;
    background: var(--bys-rose);
    box-shadow: 0 4px 15px rgba(190, 109, 118, 0.3);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
}

.bys-drawer__meta {
    margin-top: auto;
    padding-top: 8px;
}

.bys-drawer__meta-label {
    margin: 20px 0 2px;
    color: var(--bys-muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bys-drawer__meta-label:first-child {
    margin-top: 0;
}

.bys-drawer__meta a,
.bys-drawer__meta p {
    display: block;
    margin: 0;
    color: var(--bys-charcoal);
    font-size: 0.9375rem;
    line-height: 1.6;
    text-decoration: none;
}

.bys-drawer__socials {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.bys-drawer__socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--bys-divider);
    border-radius: 50%;
    color: var(--bys-charcoal);
    font-size: 18px;
    text-decoration: none;
}

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

.bys-footer {
    background: var(--bys-espresso);
    color: rgba(255, 255, 255, 0.72);
    font-family: 'Jost', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.75;
}

.bys-footer__inner {
    display: grid;
    gap: 40px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 64px 20px 48px;
}

@media (min-width: 640px) {
    .bys-footer__inner {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 32px;
    }
}

@media (min-width: 992px) {
    .bys-footer__inner {
        grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
        padding: 88px 40px 56px;
    }
}

/* Jost, not the display script: the brand rule caps the script font at two
   instances per page, and the homepage already spends both (hero + signature). */
.bys-footer__brand-mark {
    margin: 0 0 16px;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

.bys-footer p {
    margin: 0 0 12px;
}

.bys-footer__heading {
    margin: 0 0 20px;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.bys-footer__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bys-footer__list li {
    margin-bottom: 4px;
}

.bys-footer a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: color 200ms var(--bys-ease);
}

.bys-footer__list a {
    display: inline-block;
    padding: 6px 0;
}

.bys-footer a:hover,
.bys-footer a:focus-visible {
    color: #fff;
}

.bys-footer__meta-label {
    display: block;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bys-footer__socials {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.bys-footer__socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    font-size: 18px;
    transition: border-color 200ms var(--bys-ease), background-color 200ms var(--bys-ease);
}

.bys-footer__socials a:hover {
    border-color: var(--bys-rose);
    background: rgba(190, 109, 118, 0.18);
}

.bys-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bys-footer__bottom-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 22px 20px;
    font-size: 0.8125rem;
}

@media (min-width: 992px) {
    .bys-footer__bottom-inner {
        padding: 26px 40px;
    }
}

.bys-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* --------------------------------------------------------------------------
   Focus visibility (accessibility) — the template stylesheet ships none
   -------------------------------------------------------------------------- */

.bys-header a:focus-visible,
.bys-header button:focus-visible,
.bys-drawer a:focus-visible,
.bys-footer a:focus-visible {
    outline: 2px solid var(--bys-rose);
    outline-offset: 3px;
    border-radius: 2px;
}

.bys-footer a:focus-visible {
    outline-color: #fff;
}

/* Skip link */
.bys-skip {
    position: absolute;
    left: 50%;
    top: 8px;
    z-index: 100;
    padding: 12px 20px;
    border-radius: 4px;
    background: var(--bys-charcoal);
    color: #fff;
    font-family: 'Jost', sans-serif;
    font-size: 0.875rem;
    text-decoration: none;
    transform: translate(-50%, calc(-100% - 16px));
    transition: transform 180ms var(--bys-ease);
}

.bys-skip:focus {
    transform: translate(-50%, 0);
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .bys-header *,
    .bys-drawer *,
    .bys-footer * {
        transition-duration: 0.01ms !important;
    }
}
