/* Shared header for every authenticated portal page. */

html {
    overflow-y: scroll;
}

.sh-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
    width: 100%;
    height: 164px;
    min-height: 164px;
    margin: 0 0 var(--space-lg);
    padding: var(--space-lg) var(--space-xl);
    background: linear-gradient(135deg, rgba(46, 54, 144, 0.07), rgba(33, 179, 233, 0.08));
    border: 1px solid rgba(46, 54, 144, 0.09);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 34px rgba(46, 54, 144, 0.06);
    box-sizing: border-box;
}

.sh-page-header .sh-page-header__content {
    min-width: 0;
}

.sh-page-header .sh-page-header__eyebrow {
    display: inline-flex;
    margin-bottom: var(--space-sm);
    padding: 6px 11px;
    color: var(--color-accent-dark);
    background: var(--color-accent-soft);
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.sh-page-header .sh-page-header__title {
    margin: 0 0 var(--space-sm);
    color: var(--color-primary);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.5;
}

.sh-page-header .sh-page-header__description {
    max-width: 720px;
    margin: 0;
    color: var(--color-text-light);
    font-size: 15px;
    line-height: 1.9;
}

.sh-page-header .sh-page-header__action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: 46px;
    padding: 10px var(--space-lg);
    color: var(--color-primary);
    background: var(--color-background);
    border: 1px solid rgba(46, 54, 144, 0.14);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.sh-page-header .sh-page-header__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.sh-page-header .sh-page-header__action:hover {
    color: var(--color-primary);
    border-color: var(--color-primary-light);
    box-shadow: 0 10px 24px rgba(46, 54, 144, 0.1);
    transform: translateY(-2px);
}

.sh-page-header .sh-page-header__action:focus-visible {
    outline: 2px solid var(--color-primary-light);
    outline-offset: 3px;
}

.sh-page-header .sh-page-header__action-icon,
.sh-page-header .sh-page-header__action-icon svg {
    display: inline-flex;
    width: 19px;
    height: 19px;
}

/* The catalogue lives in a plugin and previously added a yellow radial layer. */
.sh-page-header.sh-b2b-hero {
    margin-bottom: var(--space-lg);
    padding: var(--space-lg) var(--space-xl);
    background: linear-gradient(135deg, rgba(46, 54, 144, 0.07), rgba(33, 179, 233, 0.08));
    border-radius: var(--radius-lg);
}

.sh-page-header.sh-b2b-hero > div {
    min-width: 0;
}

.sh-page-header.sh-b2b-hero h1,
.sh-page-header.sh-b2b-hero p {
    max-width: 720px;
}

.sh-dashboard,
.sh-profile,
.sh-cart-page,
.sh-checkout-page,
.sh-portal-page {
    width: 100%;
    max-width: none;
    margin-inline: auto;
}

.sh-portal-page {
    padding-block: var(--space-xl) var(--space-2xl);
}

body.page-template-page-dashboard .site-content,
body.page-template-page-dashboard .content-area,
body.page-template-page-dashboard .site-main,
body.page-template-page-profile .site-content,
body.page-template-page-profile .content-area,
body.page-template-page-profile .site-main,
body.page-template-page-cart .site-content,
body.page-template-page-cart .content-area,
body.page-template-page-cart .site-main,
body.page-template-page-checkout .site-content,
body.page-template-page-checkout .content-area,
body.page-template-page-checkout .site-main,
body.page-template-page-ticket .site-content,
body.page-template-page-ticket .content-area,
body.page-template-page-ticket .site-main,
body.page-template-page-price-list .site-content,
body.page-template-page-price-list .content-area,
body.page-template-page-price-list .site-main,
body.page-id-96 .site-content,
body.page-id-96 .content-area,
body.page-id-96 .site-main,
body.page-id-125 .site-content,
body.page-id-125 .content-area,
body.page-id-125 .site-main,
body.page-id-128 .site-content,
body.page-id-128 .content-area,
body.page-id-128 .site-main {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    float: none;
}

.sh-portal-page__content:empty {
    display: none;
}

body.sh-orders-endpoint .site-content,
body.sh-orders-endpoint .content-area,
body.sh-orders-endpoint .site-main {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    float: none;
}

body.sh-orders-endpoint .woocommerce-MyAccount-navigation {
    display: none;
}

body.sh-orders-endpoint .woocommerce-MyAccount-content {
    float: none;
    width: 100%;
    padding-block: var(--space-xl) var(--space-2xl);
    box-sizing: border-box;
}

/* Match the custom dashboard template: remove the default page title and content gap. */
body.sh-orders-endpoint .inside-article > .entry-header {
    display: none;
}

body.sh-orders-endpoint .inside-article > .entry-content {
    margin-top: 0;
}

body.sh-orders-endpoint .sh-orders-header-container {
    /*
     * The orders endpoint uses GeneratePress full-width-content, while the
     * dashboard is inside the 1280px site container. Account for the site's
     * two 40px gutters so both visible headers resolve to the same 1200px.
     */
    width: min(
        calc(100% - (var(--space-xl) * 2)),
        calc(var(--container-width) - (var(--space-xl) * 2))
    );
    margin-inline: auto;
}

body.sh-orders-endpoint .sh-orders-header-container > .sh-page-header {
    margin-bottom: var(--space-lg);
}

/* Keep the original white canvas of the portal pages. */
body.page-template-page-dashboard,
body.page-template-page-profile,
body.page-template-page-cart,
body.page-template-page-checkout,
body.page-template-page-ticket,
body.page-template-page-price-list,
body.page-id-96,
body.page-id-125,
body.page-id-128,
body.sh-orders-endpoint {
    background-color: var(--color-background, #fff);
}

@media (max-width: 768px) {
    .sh-page-header {
        align-items: stretch;
        flex-direction: column;
        gap: var(--space-lg);
        height: auto;
        min-height: 0;
        padding: var(--space-lg);
    }

    .sh-page-header .sh-page-header__title {
        font-size: 25px;
    }

    .sh-page-header .sh-page-header__description {
        font-size: 14px;
        line-height: 1.8;
    }

    .sh-page-header .sh-page-header__action {
        align-self: flex-start;
    }

    .sh-page-header .sh-page-header__actions {
        justify-content: flex-start;
        width: 100%;
    }

    .sh-portal-page {
        padding-block: var(--space-lg) var(--space-xl);
    }

    body.sh-orders-endpoint .sh-orders-header-container {
        width: min(100% - 24px, var(--container-width));
    }

    body.sh-orders-endpoint .woocommerce-MyAccount-content {
        padding-block: var(--space-lg) var(--space-xl);
    }
}

@media (max-width: 420px) {
    .sh-page-header {
        padding: var(--space-md);
    }

    .sh-page-header .sh-page-header__title {
        font-size: 21px;
    }
}
