/* =========================================================
   Tranquil Moments Beauty — Final Public Header Architecture

   0–700px:     compact header + fixed bottom navigation
   701–1179px:  centred branding + navigation row
   1180px+:     full inline desktop header
   ========================================================= */


/* ---------------------------------------------------------
   Shared header foundation
   --------------------------------------------------------- */

body:not(.admin-shell) .tm-site-header {
    position: relative;
    z-index: 160;
    width: 100%;
    background:
        linear-gradient(
            135deg,
            rgba(250, 246, 242, 0.99),
            rgba(255, 250, 247, 0.99)
        );
    border-bottom: 1px solid rgba(91, 46, 74, 0.1);
    box-shadow: 0 8px 26px rgba(91, 46, 74, 0.055);
}


/* Hide any obsolete header elements left in old templates. */

body:not(.admin-shell) .site-header:not(.tm-site-header) {
    display: none !important;
}


/* Brand strip */

body:not(.admin-shell) .tm-header-strip {
    background:
        linear-gradient(
            105deg,
            #462238,
            #5b2e4a 55%,
            #704055
        );
    color: #ffffff;
}

body:not(.admin-shell) .tm-header-strip-inner {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 8px 20px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
}

body:not(.admin-shell) .tm-header-strip-heart,
body:not(.admin-shell) .tm-strip-dot {
    color: #f7c7d1;
}


/* Main header row */

body:not(.admin-shell) .tm-header-main {
    margin: 0 auto;
}

body:not(.admin-shell) .tm-header-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

body:not(.admin-shell) .tm-header-mark {
    display: block;
    object-fit: contain;
    border-radius: 50%;
}

body:not(.admin-shell) .tm-header-title-group {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body:not(.admin-shell) .tm-header-title {
    color: #5b2e4a;
    font-family:
        "Playfair Display",
        Georgia,
        "Times New Roman",
        serif;
    font-weight: 500;
    line-height: 1.1;
    text-transform: uppercase;
}

body:not(.admin-shell) .tm-header-byline {
    position: relative;
    width: max-content;
    color: #b38b51;
    font-family:
        Montserrat,
        Arial,
        sans-serif;
    font-weight: 500;
    text-transform: uppercase;
}

body:not(.admin-shell) .tm-header-byline::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    height: 1px;
    background: #e7a9b6;
}


/* Navigation */

body:not(.admin-shell) .tm-desktop-nav a {
    position: relative;
    color: #5b2e4a;
    font-family:
        Montserrat,
        Arial,
        sans-serif;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    transition:
        color 160ms ease,
        transform 160ms ease;
}

body:not(.admin-shell) .tm-desktop-nav a::after {
    content: "";
    position: absolute;
    right: 50%;
    bottom: 5px;
    left: 50%;
    height: 2px;
    background: #e7a9b6;
    transition:
        right 160ms ease,
        left 160ms ease;
}

body:not(.admin-shell) .tm-desktop-nav a:hover,
body:not(.admin-shell) .tm-desktop-nav a:focus-visible,
body:not(.admin-shell) .tm-desktop-nav a.is-active {
    color: #a56a7f;
}

body:not(.admin-shell) .tm-desktop-nav a:hover::after,
body:not(.admin-shell) .tm-desktop-nav a:focus-visible::after,
body:not(.admin-shell) .tm-desktop-nav a.is-active::after {
    right: 0;
    left: 0;
}


/* Book button */

body:not(.admin-shell) .tm-header-book {
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 23px;
    border: 1px solid rgba(165, 106, 127, 0.28);
    border-radius: 999px;
    background:
        linear-gradient(
            135deg,
            #f7c7d1,
            #efd9d4
        );
    box-shadow: 0 8px 20px rgba(91, 46, 74, 0.09);
    color: #5b2e4a;
    font-family:
        Montserrat,
        Arial,
        sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}

body:not(.admin-shell) .tm-header-book:hover,
body:not(.admin-shell) .tm-header-book:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(91, 46, 74, 0.14);
}


/* =========================================================
   Wide desktop — complete inline header
   ========================================================= */

@media (min-width: 1180px) {

    body:not(.admin-shell) .tm-header-main {
        width: min(1260px, calc(100% - 40px));
        min-height: 116px;
        display: grid;
        grid-template-columns:
            minmax(400px, 1fr)
            auto
            auto;
        align-items: center;
        gap: clamp(20px, 2vw, 32px);
    }

    body:not(.admin-shell) .tm-header-brand {
        gap: 18px;
    }

    body:not(.admin-shell) .tm-header-mark {
        width: 102px;
        height: 102px;
        flex: 0 0 102px;
    }

    body:not(.admin-shell) .tm-header-title {
        font-size: clamp(1.4rem, 2vw, 2rem);
        letter-spacing: 0.045em;
        white-space: nowrap;
    }

    body:not(.admin-shell) .tm-header-byline {
        margin-top: 9px;
        padding-right: 48px;
        font-size: 0.68rem;
        letter-spacing: 0.25em;
    }

    body:not(.admin-shell) .tm-header-byline::after {
        width: 37px;
    }

    body:not(.admin-shell) .tm-desktop-nav {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: clamp(15px, 1.55vw, 25px);
    }

    body:not(.admin-shell) .tm-desktop-nav a {
        padding: 13px 0;
        font-size: 0.67rem;
        letter-spacing: 0.055em;
        white-space: nowrap;
    }

    body:not(.admin-shell) .tm-header-book {
        display: inline-flex !important;
    }

    body:not(.admin-shell) .mobile-tabbar,
    body:not(.admin-shell) .tm-mobile-navigation,
    body:not(.admin-shell) .mobile-bottom-nav {
        display: none !important;
    }
}


/* =========================================================
   Tablet / narrow desktop — navigation beneath branding
   ========================================================= */

@media (min-width: 701px) and (max-width: 1179px) {

    body:not(.admin-shell) .tm-header-main {
        width: min(100% - 30px, 980px);
        display: grid;
        grid-template-columns: 1fr;
        padding-top: 10px;
    }

    body:not(.admin-shell) .tm-header-brand {
        min-height: 86px;
        justify-content: center;
        gap: 15px;
    }

    body:not(.admin-shell) .tm-header-mark {
        width: 78px;
        height: 78px;
        flex: 0 0 78px;
    }

    body:not(.admin-shell) .tm-header-title-group {
        max-width: min(650px, calc(100vw - 145px));
    }

    body:not(.admin-shell) .tm-header-title {
        font-size: clamp(1.15rem, 2.8vw, 1.75rem);
        letter-spacing: 0.04em;
        white-space: normal;
    }

    body:not(.admin-shell) .tm-header-byline {
        margin-top: 7px;
        padding-right: 36px;
        font-size: 0.61rem;
        letter-spacing: 0.21em;
    }

    body:not(.admin-shell) .tm-header-byline::after {
        width: 27px;
    }

    body:not(.admin-shell) .tm-header-book {
        display: none !important;
    }

    body:not(.admin-shell) .tm-desktop-nav {
        width: 100%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0 1.35rem;
        margin-top: 7px;
        padding: 7px 10px 11px;
        border-top: 1px solid rgba(91, 46, 74, 0.08);
    }

    body:not(.admin-shell) .tm-desktop-nav a {
        padding: 11px 1px;
        font-size: 0.65rem;
        letter-spacing: 0.045em;
        white-space: nowrap;
    }

    body:not(.admin-shell) .mobile-tabbar,
    body:not(.admin-shell) .tm-mobile-navigation,
    body:not(.admin-shell) .mobile-bottom-nav {
        display: none !important;
    }
}


/* =========================================================
   Phone — compact header and bottom navigation
   ========================================================= */

@media (max-width: 700px) {

    body:not(.admin-shell) .tm-header-strip-inner {
        min-height: 31px;
        gap: 7px;
        padding: 7px 8px;
        font-size: 0.51rem;
        letter-spacing: 0.095em;
    }

    body:not(.admin-shell) .tm-header-main {
        width: 100%;
        min-height: 86px;
        display: grid;
        grid-template-columns: 1fr;
        padding: 9px 13px;
    }

    body:not(.admin-shell) .tm-header-brand {
        gap: 12px;
        overflow: visible;
    }

    body:not(.admin-shell) .tm-header-mark {
        width: 66px;
        height: 66px;
        flex: 0 0 66px;
    }

    body:not(.admin-shell) .tm-header-title-group {
        max-width: calc(100vw - 104px);
    }

    body:not(.admin-shell) .tm-header-title {
        overflow: visible;
        font-size: clamp(0.85rem, 4vw, 1.18rem);
        letter-spacing: 0.025em;
        white-space: normal;
    }

    body:not(.admin-shell) .tm-header-byline {
        margin-top: 5px;
        padding-right: 25px;
        font-size: 0.48rem;
        letter-spacing: 0.17em;
    }

    body:not(.admin-shell) .tm-header-byline::after {
        width: 18px;
    }

    body:not(.admin-shell) .tm-desktop-nav,
    body:not(.admin-shell) .tm-header-book {
        display: none !important;
    }

    body:not(.admin-shell) {
        padding-bottom:
            calc(
                76px + env(safe-area-inset-bottom, 0px)
            );
    }

    body:not(.admin-shell) .mobile-tabbar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 300;

        height:
            calc(
                70px + env(safe-area-inset-bottom, 0px)
            );

        display: grid !important;
        grid-template-columns: repeat(4, 1fr);

        padding:
            6px
            6px
            env(safe-area-inset-bottom, 0px);

        border-top: 1px solid rgba(91, 46, 74, 0.1);
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 -8px 28px rgba(91, 46, 74, 0.1);
        backdrop-filter: blur(18px);
    }

    body:not(.admin-shell) .mobile-tabbar a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1px;

        color: #9a858e;
        font-size: 0.56rem;
        font-weight: 700;
        text-decoration: none;
    }

    body:not(.admin-shell) .mobile-tabbar a.active {
        color: #5b2e4a;
    }

    body:not(.admin-shell) .mobile-tabbar .tab-icon {
        font-size: 1.35rem;
        line-height: 1;
    }
}



/* =========================================================
   Branded mobile navigation icons
   ========================================================= */

@media (max-width: 700px) {

    body:not(.admin-shell) .mobile-tabbar a {
        gap: 2px;
    }

    body:not(.admin-shell) .mobile-tabbar .tab-icon {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;

        display: flex;
        align-items: center;
        justify-content: center;

        margin-bottom: 1px;
        overflow: hidden;
    }

    body:not(.admin-shell) .mobile-tabbar .tab-icon img {
        width: 28px;
        height: 28px;

        display: block;
        object-fit: contain;

        opacity: 0.68;
        filter:
            saturate(0.65)
            brightness(0.82);

        transition:
            opacity 160ms ease,
            filter 160ms ease,
            transform 160ms ease;
    }

    body:not(.admin-shell) .mobile-tabbar a.active {
        color: #5b2e4a;
    }

    body:not(.admin-shell) .mobile-tabbar a.active .tab-icon img {
        opacity: 1;
        filter:
            saturate(1)
            brightness(0.72);

        transform: scale(1.08);
    }

    body:not(.admin-shell) .mobile-tabbar a:hover .tab-icon img,
    body:not(.admin-shell) .mobile-tabbar a:focus-visible .tab-icon img {
        opacity: 1;
        transform: scale(1.05);
    }
}



/* =========================================================
   Final cropped mobile navigation icons
   Source files are consistently cropped at 275 × 275 px
   ========================================================= */

@media (max-width: 700px) {

    body:not(.admin-shell) .mobile-tabbar {
        align-items: stretch;
    }

    body:not(.admin-shell) .mobile-tabbar a {
        min-width: 0;
        gap: 1px;
        padding: 3px 2px;
    }

    body:not(.admin-shell) .mobile-tabbar .tab-icon {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;

        display: flex;
        align-items: center;
        justify-content: center;

        margin: 0 auto;
        overflow: hidden;
        border-radius: 8px;
    }

    body:not(.admin-shell) .mobile-tabbar .tab-icon img {
        width: 31px;
        height: 31px;

        display: block;
        object-fit: contain;
        object-position: center;

        opacity: 0.7;

        transition:
            opacity 160ms ease,
            transform 160ms ease,
            filter 160ms ease;
    }

    body:not(.admin-shell) .mobile-tabbar a.active .tab-icon img {
        opacity: 1;
        transform: scale(1.08);
        filter:
            saturate(1.08)
            contrast(1.04);
    }

    body:not(.admin-shell) .mobile-tabbar a:hover .tab-icon img,
    body:not(.admin-shell) .mobile-tabbar a:focus-visible .tab-icon img {
        opacity: 1;
    }

    body:not(.admin-shell) .mobile-tabbar a > span:last-child {
        overflow: hidden;
        font-family:
            Montserrat,
            Arial,
            sans-serif;
        font-size: 0.54rem;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

