/* Keep header actions above the inherited category navigation (z-index: 20).
 * A stacking context on the entire top row prevents the z-10 account dropdown
 * from being covered by the separate navigation row. Drawers remain above it.
 */
.blue39-header-main {
    position: relative;
    z-index: 30;
}

.blue39-header-actions #customer-menu + nav a {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
}

/* Compact storefront header; preserve native action and drawer hit targets. */
.blue39-header .blue39-header-main {
    padding-block: 16px;
    gap: 28px;
}
.blue39-header .blue39-search input { padding-block: 12px; }
.blue39-header .blue39-navigation { min-height: 44px; padding-block: 0; gap: 0 20px; }
.blue39-header .blue39-world-links > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: 0;
    font-size: 13px;
}
.blue39-header .blue39-business-link { min-height: 44px; padding-block: 0; font-size: 12px; }
@media (max-width: 1023px) {
    .blue39-header .blue39-header-main { gap: 14px 18px; }
}
@media (max-width: 639px) {
    .blue39-header .blue39-header-main { padding: 12px 16px 8px; gap: 12px 8px; }
    .blue39-header .blue39-navigation { padding-block: 0; gap: 0 14px; }
}

/* Compact only the navigation and breadcrumbs; keep announcement/logo/search. */
.blue39-header .blue39-category-toggle {
    min-height: 44px; padding-block: 0; gap: 8px; font-size: 14px; line-height: 1.3;
}
.blue39-header .blue39-world-links { gap: 20px; }
.blue39-store .breadcrumbs .items {
    display: flex; flex-wrap: nowrap; align-items: center;
    min-width: 0; min-height: 32px; margin: 0; padding-block: 4px;
    font-size: 12px; line-height: 1.4; overflow: hidden;
}
.blue39-store .breadcrumbs .items > .item {
    display: inline-flex; align-items: center; flex: 0 1 auto;
    min-width: 0; white-space: nowrap;
}
.blue39-store .breadcrumbs .items > .item:has([aria-current="page"]) {
    flex: 1 1 auto;
}
.blue39-store .breadcrumbs .item > a {
    display: block; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; padding-block: 4px;
}
.blue39-store .breadcrumbs .separator { flex-shrink: 0; padding-inline: 6px; }
/* Native product breadcrumbs add decorative scroll-fade sentinels, not crumbs. */
.blue39-store .breadcrumbs .items > li[aria-hidden="true"] { display: none; }
@media (max-width: 767px) {
    .blue39-header .blue39-world-links { gap: 18px; }
    .blue39-header .blue39-world-links > a { font-size: 12px; }
}

/* Keep the original logo/search/cart row, with native drawers above purchase bars. */
.blue39-store .page-header{position:relative;z-index:45}
.blue39-store .blue39-header{z-index:45}
.blue39-header-rail{background:#fff}
.blue39-back-to-top{position:fixed;right:calc(16px + env(safe-area-inset-right,0px));bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:30;display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid #dce4ef;border-radius:50%;background:#fff;color:#2147ad;box-shadow:0 3px 14px #1429401a;cursor:pointer}
.blue39-back-to-top:hover{background:#edf2ff}
.blue39-back-to-top:focus-visible{outline:3px solid #2456ed;outline-offset:3px}
.blue39-back-to-top[hidden]{display:none!important}
@media print{.blue39-header-rail[data-stuck="true"]{position:static;box-shadow:none}.blue39-header-slot{height:auto!important}.blue39-back-to-top{display:none!important}}

/* Restyle the native Hyvä account menu without replacing its links or Alpine scope. */
.blue39-header-actions #customer-menu{border:1px solid transparent;border-radius:10px;color:#171c26;min-width:44px;min-height:44px;box-shadow:none}
.blue39-header-actions #customer-menu:hover{background:#f1f5ff;color:#2049ca}
.blue39-header-actions #customer-menu[aria-expanded="true"]{background:#1b2432;border-color:#1b2432;color:#fff}
.blue39-header-actions #customer-menu:focus-visible{outline:2px solid #2855ed;outline-offset:3px}
.blue39-header-actions #customer-menu+nav{
    top:100%;right:0;width:264px;max-width:calc(100vw - 32px);
    margin:10px 0 0;padding:8px;border:1px solid #cbd0d8;border-radius:12px;
    background:#fff;color:#171c26;box-shadow:0 12px 32px #171c261a,0 2px 6px #171c2608;
    max-height:min(420px,calc(100dvh - 160px));overflow:auto;overscroll-behavior:contain;
    font-size:14px;line-height:1.5;text-align:left;
}
.blue39-header-actions #customer-menu+nav a{
    display:flex;align-items:center;gap:6px;min-height:44px;padding:10px 12px;margin:0;
    border:0;border-radius:7px;color:#252d39;background:transparent;
    font-size:14px;font-weight:600;line-height:1.5;text-decoration:none;overflow-wrap:anywhere;
}
.blue39-header-actions #customer-menu+nav a:hover{color:#2049ca;background:#f1f5ff}
.blue39-header-actions #customer-menu+nav a:focus-visible{outline:2px solid #2855ed;outline-offset:-2px;background:#f1f5ff;color:#2049ca}
.blue39-header-actions #customer-menu+nav hr{margin:8px 12px;border:0;border-top:1px solid #e2e5e9}
.blue39-header-actions #customer-menu+nav a[href*="/customer/account/logout"]{color:#525b68;font-weight:500}
.blue39-header-actions #customer-menu+nav a[href*="/customer/account/logout"]:hover,
.blue39-header-actions #customer-menu+nav a[href*="/customer/account/logout"]:focus-visible{color:#a12b24;background:#fff2f0}
@media(prefers-reduced-motion:no-preference){
 .blue39-header-actions #customer-menu,
 .blue39-header-actions #customer-menu+nav a{transition:background-color .15s,color .15s}
}

/* The account sidebar uses the same compact navigation surface as the dropdown. */
.blue39-store .sidebar .card.account-nav{
    padding:12px;background:#fff;color:#171c26;border:1px solid #cbd0d8;
    border-radius:12px;box-shadow:0 3px 12px #171c2605;min-width:0;
}
.blue39-store .sidebar .card.account-nav>#account-nav-title{
    margin:0;padding:8px 12px;min-height:44px;color:#171c26;
}
.blue39-store .sidebar .card.account-nav>#account-nav-title>span:first-child{
    display:block;font-size:14px;font-weight:750;line-height:1.5;color:#171c26;
}
.blue39-store .sidebar #account-nav{margin:4px 0 0;padding-top:8px;border-top:1px solid #e2e5e9}
.blue39-store .sidebar #account-nav-title:focus-visible{outline:2px solid #2855ed;outline-offset:2px;border-radius:7px}
.blue39-store .sidebar #account-nav>.items{display:grid;gap:3px;margin:0;padding:0;list-style:none}
.blue39-store .sidebar #account-nav>.items>.item{margin:0;min-width:0}
.blue39-store .sidebar #account-nav>.items>.item>a,
.blue39-store .sidebar #account-nav>.items>.item>strong{
    display:flex;align-items:center;gap:8px;box-sizing:border-box;min-height:44px;width:100%;
    margin:0;padding:10px 12px;border:0;border-left:3px solid transparent;border-radius:7px;
    color:#374151;background:transparent;font-size:14px;font-weight:500;line-height:1.5;
    text-decoration:none;overflow-wrap:anywhere;
}
.blue39-store .sidebar #account-nav>.items>.item>a:hover{
    color:#2049ca;background:#f1f5ff;text-decoration:none;
}
.blue39-store .sidebar #account-nav>.items>.item>a:focus-visible{
    outline:2px solid #2855ed;outline-offset:-2px;background:#f1f5ff;color:#2049ca;
}
.blue39-store .sidebar #account-nav>.items>.item.current>strong,
.blue39-store .sidebar #account-nav>.items>.item>a[aria-current="page"]{
    background:#1b2432;border-left-color:#2855ed;color:#fff;font-weight:650;text-decoration:none;
}
.blue39-store .sidebar #account-nav .delimiter{display:block;margin:8px 12px;border-color:#e2e5e9}
.blue39-store .sidebar #account-nav a[href*="/customer/account/logout"]{color:#525b68}
.blue39-store .sidebar #account-nav a[href*="/customer/account/logout"]:hover,
.blue39-store .sidebar #account-nav a[href*="/customer/account/logout"]:focus-visible{color:#a12b24;background:#fff2f0}
@media(prefers-reduced-motion:no-preference){
 .blue39-store .sidebar #account-nav>.items>.item>a{transition:background-color .15s,color .15s}
}



#cart-drawer .blue39-drawer-quantity {
    display: inline-flex;
    align-items: center;
    flex: none;
    border: 1px solid #aab6ca;
    border-radius: 999px;
    background: white;
    color: #18335c;
    font-variant-numeric: tabular-nums;
}
#cart-drawer .blue39-drawer-quantity > button {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    font: inherit;
    font-weight: 600;
    line-height: 1;
    color: inherit;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 999px;
}
#cart-drawer .blue39-drawer-quantity > button:hover { background: #edf2ff; }
#cart-drawer .blue39-drawer-quantity > button:focus-visible { outline: 2px solid #2855ed; }
#cart-drawer .blue39-drawer-quantity > span { min-width: 1.5ch; text-align: center; }
#cart-drawer .blue39-drawer-quantity { margin-inline-end: auto; }

.blue39-header-main .blue39-cart-button[data-docked] {
    position: fixed;
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    background: white;
    border: 1px solid #dce4ef;
    border-radius: 50%;
    box-shadow: 0 3px 14px #1429401a;
}
/* Hyvä's sticky .page.messages otherwise traps its children below the header. */
.blue39-store .page.messages:has(> #messages) {
    position: static;
    z-index: auto;
}
.blue39-store #messages {
    position: fixed;
    z-index: 46;
    top: 1rem;
    right: 1rem;
    width: min(24rem, calc(100% - 2rem));
    pointer-events: none;
}
.blue39-store #messages .messages { padding: 0; max-height: 50vh; overflow-y: auto; }
.blue39-store #messages .message {
    pointer-events: auto;
    margin-bottom: .5rem;
    border-radius: .75rem;
    box-shadow: 0 4px 18px #14294024;
}
.blue39-product-tile button[data-addto="cart"] { touch-action: manipulation; }
@media (max-width: 767px) {
    .blue39-store #messages {
        inset: auto calc(72px + env(safe-area-inset-right, 0px)) calc(.75rem + env(safe-area-inset-bottom, 0px)) .75rem;
        width: auto;
    }
}
@media print {
    .blue39-store #messages, .blue39-cart-button[data-docked] { display: none; }
}

#cart-drawer .blue39-drawer-recap {
    border-top: 1px solid #dce2eb;
    padding: 14px 0 10px;
}
#cart-drawer .blue39-drawer-subtotal {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    font-weight: 650;
}
#cart-drawer .blue39-drawer-subtotal dd { margin: 0; font-size: 1.2em; font-variant-numeric: tabular-nums; }
#cart-drawer .blue39-drawer-edit {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: #354760;
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
#cart-drawer .blue39-drawer-actions { display: grid; gap: 6px; }
#cart-drawer .blue39-drawer-actions > :empty { display: none; }
#cart-drawer .blue39-drawer-guest { text-align: center; color: #4c5e74; font-size: 13px; }
