/* Shared header actions keep a 44px touch target. The header observer updates
   anchor scroll padding from the natural, content-driven height. */
.site-header .header-supermarket-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 44px;
    height: 44px;
    gap: .55rem;
    padding: .45rem .65rem;
    white-space: nowrap;
    color: var(--t-brand);
    background: #f5f1fa;
    border: 1px solid #e5dfee;
    border-radius: .75rem;
}
.site-header .header-supermarket-button:hover {
    color: var(--t-brand-dark);
    background: #eae1f4;
    border-color: #cdbbdf;
}
.site-header .header-supermarket-button:focus-visible {
    outline: 2px solid var(--t-brand);
    outline-offset: 2px;
}

/* Joined shortcuts remain separate focusable controls and retain their modal handlers. */
.site-header .header-cart-group { display: inline-flex; flex: 0 0 auto; }
.site-header .header-cart-group .header-cart-button {
    border-radius: .75rem 0 0 .75rem;
    min-height: 44px;
}
.site-header .header-compare-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-width: 44px;
    min-height: 44px;
    padding: .45rem .65rem;
    margin-left: -1px;
    border: 1px solid #e5dfee;
    border-radius: 0 .75rem .75rem 0;
    background: #f5f1fa;
    color: var(--t-brand);
    white-space: nowrap;
}
.site-header .header-compare-button:hover {
    background: #eae1f4;
    color: var(--t-brand-dark);
    border-color: #cdbbdf;
}
.site-header .header-cart-group .btn:focus-visible {
    position: relative;
    z-index: 1;
    outline: 2px solid var(--t-brand);
    outline-offset: 2px;
}

@media (min-width: 768px) {
    /* Let search use the remaining space instead of wrapping the action group. */
    .site-header .header-search { flex: 1 1 0; min-width: 0; margin-inline: 0; }
    .site-header .header-action-menus { flex-shrink: 0; }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
    .site-header .header-search-button > span { display: none !important; }
}

/* Scoped detail selectors also cover the stylesheet loaded later in the body. */
@media (max-width: 767.98px) {
    .site-header { padding-block: .375rem; }
    .site-header .container-xl { gap: .25rem .5rem; }
    .site-header .navbar-brand {
        font-size: 1.4rem !important;
        gap: .4rem;
        margin-right: 0;
        padding-block: .25rem;
    }
    .site-header .brand-symbol {
        width: 2rem;
        height: 2rem;
        border-radius: .65rem;
        font-size: .95rem;
    }
    /* Keep the joined cart controls on one line without shrinking touch targets. */
    .site-header .header-action-menus {
        gap: .25rem !important;
        padding-block: 0 !important;
        flex-shrink: 0;
    }
    .site-header .header-cart-button,
    .site-header .header-supermarket-button { padding-inline: .4rem; gap: .35rem; }
    .site-header .header-search { margin: 0; }
    .site-header .header-search .input-group {
        padding: 1px;
        border-radius: .65rem;
    }
    .site-header .header-search .form-control {
        min-height: 44px;
        padding-block: .375rem;
        font-size: 1rem;
    }
    .site-header .header-search-button {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        padding: .375rem .5rem;
    }
    .site-header .header-menu .dropdown-item {
        min-height: 44px;
        padding-block: .375rem;
    }
    .tsepaki-ui .detail-page .detail-section-nav {
        gap: 3px;
        padding: 3px;
        margin-block: .75rem 1rem;
        border-radius: 12px;
    }
    .tsepaki-ui .detail-page .detail-section-nav a {
        min-height: 44px;
        padding: .3rem .25rem;
        gap: .3rem;
        border-radius: 8px;
        font-size: .75rem;
    }
    .tsepaki-ui .detail-page .detail-section-nav a i { width: 14px; font-size: .8rem; }
    .tsepaki-ui .detail-page .detail-tab-market-label { display: none; }
}

@media (max-width: 575.98px) {
    /* Keep unread counts from pushing the icon into the adjacent cart button. */
    .site-header .header-menu-button { position: relative; }
    .site-header .header-menu-button > .badge {
        position: absolute;
        top: -.25rem;
        right: -.25rem;
        max-width: 2.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: .2rem .3rem;
        border: 2px solid #fff;
        font-size: .6rem;
        line-height: 1.15;
    }
}

@media (max-width: 399.98px) {
    /* Keep the brand and four action targets in one row on ordinary phones. */
    .site-header .container-xl { column-gap: .25rem; padding-inline: .75rem; }
    .site-header .navbar-brand { font-size: 1.25rem !important; gap: .3rem; }
}

@media (max-width: 374.98px) {
    /* The existing accessible home label remains when only the logo fits. */
    .site-header .header-brand-label { display: none; }
    .site-header .navbar-brand { min-width: 44px; min-height: 44px; justify-content: center; }
}
