/*
 * B2B mobile UX pass — 2026-10-27.
 * Loaded after portal.css, so the existing production branding stays intact.
 * This stylesheet intentionally changes only small-screen usability:
 * touch targets, scrollable navigation cues, input ergonomics and cart controls.
 */
@media (max-width: 700px) {
    body.modernstyle-pro-portal .ms-portal-nav {
        display:flex;
        max-width:100%;
        overflow-x:auto;
        overflow-y:hidden;
        flex-wrap:nowrap;
        gap:20px;
        -webkit-overflow-scrolling:touch;
        overscroll-behavior-inline:contain;
        scrollbar-width:thin;
    }
    body.modernstyle-pro-portal .ms-portal-nav a {
        display:inline-flex;
        align-items:center;
        flex:0 0 auto;
        min-height:44px;
        box-sizing:border-box;
    }
    /* Explicit discoverability: the six-link portal menu scrolls sideways. */
    body.modernstyle-pro-portal .ms-portal-shell::after {
        content:"Плъзнете менюто наляво за още раздели →";
        display:block;
        padding:0 0 9px;
        color:#d9c4a5;
        font-size:10px;
        letter-spacing:.02em;
        pointer-events:none;
    }
    /* Keep cart actions usable by touch while letting the Hyva row wrap. */
    body.checkout-cart-index article.cart.item {
        min-width:0;
    }
    body.checkout-cart-index .item-actions {
        display:inline-flex;
        flex-wrap:wrap;
        align-items:center;
        gap:5px;
    }
    body.checkout-cart-index .item-actions button,
    body.checkout-cart-index .item-actions a {
        min-width:44px!important;
        min-height:44px!important;
        width:44px!important;
        height:44px!important;
        box-sizing:border-box!important;
        padding:9px!important;
    }
    body.checkout-cart-index input.qty {
        min-height:44px!important;
        height:44px!important;
        font-size:16px!important;
    }
    body.checkout-cart-index .cart-summary .checkout-methods-items .action.primary.checkout,
    body.checkout-cart-index .cart-summary .btn-primary,
    body.checkout-cart-index .actions-toolbar.cart.actions .btn {
        min-height:44px!important;
    }
    /* 16px is the minimum comfortable iOS field size without focus zoom. */
    body.modernstyle-pro-login-page input[type="email"],
    body.modernstyle-pro-login-page input[type="password"],
    body.modernstyle-pro-register-page input[type="text"],
    body.modernstyle-pro-register-page input[type="email"],
    body.modernstyle-pro-register-page input[type="tel"],
    body.modernstyle-pro-register-page select,
    body.modernstyle-pro-forgotpassword-page input[type="email"] {
        font-size:16px!important;
    }
}
@media (max-width: 360px) {
    body.modernstyle-pro-portal .ms-portal-nav {
        gap:16px;
    }
    body.checkout-cart-index .item-actions {
        gap:4px;
    }
}
/* Maintain keyboard focus indication for touch-enabled devices with keyboards. */
@media (hover: none) {
    body.modernstyle-pro-portal .ms-portal-nav a:focus-visible {
        outline:2px solid #d9c4a5;
        outline-offset:-2px;
    }
}

/*
 * Mobile onboarding: decorative ambient blur must remain inside the viewport.
 * Without this constraint the absolutely positioned elements enlarge the
 * document by 100px (Login/Forgot Password) or 150px (Salon Application).
 * This preserves the existing gradients rather than hiding them.
 * Validated with 15 read-only Chromium viewport checks; see PR #37.
 */
@media (max-width: 700px) {
    body.modernstyle-pro-login-page .ms-pro-login__ambient--one {
        width:min(520px,100%)!important;
        right:0!important;
    }
    body.modernstyle-pro-login-page .ms-pro-login__ambient--two {
        width:min(380px,100%)!important;
        left:0!important;
    }
    body.modernstyle-pro-register-page .ms-pro-apply__ambient--one {
        width:min(500px,100%)!important;
        right:0!important;
    }
    body.modernstyle-pro-register-page .ms-pro-apply__ambient--two {
        width:min(380px,100%)!important;
        left:0!important;
    }
    body.modernstyle-pro-register-page .ms-pro-apply__layout {
        grid-template-columns:minmax(0,1fr)!important;
    }
    body.modernstyle-pro-register-page .ms-pro-apply__form,
    body.modernstyle-pro-register-page .ms-pro-apply__aside {
        box-sizing:border-box!important;
        min-width:0!important;
        max-width:100%!important;
    }
}

/* Mobile viewport containment, 2026-11-06.
 * Legacy 9999px full-bleed margins expanded the document on iOS.
 * Keep the dark portal bar edge-to-edge, with horizontal scrolling only inside navigation.
 */
@media (max-width:1024px) {
    body.modernstyle-pro-portal {overflow-x:clip;}
    body.modernstyle-pro-portal .page-wrapper,
    body.modernstyle-pro-portal .page-header,
    body.modernstyle-pro-portal .page-header .container,
    body.modernstyle-pro-portal main#maincontent,
    body.modernstyle-pro-portal .columns,
    body.modernstyle-pro-portal .column.main,
    body.modernstyle-pro-portal .ms-catalog-heading,
    body.modernstyle-pro-portal .ms-catalog-layout,
    body.modernstyle-pro-portal .ms-catalog-content {
        min-width:0;max-width:100%;box-sizing:border-box;
    }
    body.modernstyle-pro-portal .ms-portal-shell {
        width:100vw;max-width:100vw;
        margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);
        padding-left:12px;padding-right:12px;box-sizing:border-box;
    }
    body.modernstyle-pro-portal .ms-portal-nav {
        width:100%;max-width:100%;box-sizing:border-box;
        overscroll-behavior-x:contain;
    }
    body.modernstyle-pro-portal .ms-header-logo {
        width:min(43vw,184px)!important;min-width:0!important;
        padding-right:0!important;box-sizing:border-box!important;flex-shrink:1!important;
    }
    body.modernstyle-pro-portal .ms-header-logo img {
        max-width:100%!important;height:auto!important;
    }
    body.modernstyle-pro-portal .ms-products-toolbar,
    body.modernstyle-pro-portal .ms-catalog-content .ms-product-list,
    body.modernstyle-pro-portal .ms-catalog-content .ms-product-row {
        max-width:100%;min-width:0;box-sizing:border-box;
    }
}



/* Mobile viewport containment: replace layout-expanding 9999px bleed. */
@media(max-width:1024px){
 body.modernstyle-pro-portal .page-wrapper{overflow-x:clip}
 body.modernstyle-pro-portal .page-header,
 body.modernstyle-pro-portal #header,
 body.modernstyle-pro-portal .page-header #header>.container,
 body.modernstyle-pro-portal main#maincontent,
 body.modernstyle-pro-portal .columns,
 body.modernstyle-pro-portal .column.main{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
 body.modernstyle-pro-portal .ms-portal-shell{
   position:relative!important;isolation:isolate;
   margin:0!important;padding:0 12px!important;
   width:100%!important;max-width:100%!important;
   box-sizing:border-box!important;background:transparent!important;border-bottom:0!important;
 }
 body.modernstyle-pro-portal .ms-portal-shell::before{
   content:"";position:absolute;inset-block:0;left:50%;width:100vw;
   transform:translateX(-50%);z-index:-1;pointer-events:none;
   background:linear-gradient(115deg,#171512 0%,#382d24 55%,#151412 100%);
   border-bottom:1px solid rgba(255,255,255,.12);
 }
 body.modernstyle-pro-portal .ms-portal-nav{
   width:100%;max-width:100%;min-width:0;
   overflow-x:auto;overflow-y:hidden;white-space:nowrap;box-sizing:border-box;
 }
 body.modernstyle-pro-portal .ms-header-logo{
   min-width:0!important;max-width:min(43vw,184px)!important;
   width:min(43vw,184px)!important;padding:0!important;
   box-sizing:border-box!important;flex-shrink:1!important;
 }
 body.modernstyle-pro-portal .page-header .ms-header-logo img{max-width:100%!important;height:auto!important}
}
@media(max-width:700px){
 body.modernstyle-pro-portal .page-header #header>.container{
   padding-left:12px!important;padding-right:12px!important;min-width:0!important;
 }
 body.modernstyle-pro-portal .page-header #header>.container>*{min-width:0}
}
