/* Mobile-only presentation. Business rules remain in the existing application. */
.mobile-nav, .mobile-catalogue-toggle { display: none; }
#portalShell [hidden] { display: none !important; }
.mobile-catalogue-dialog { border: 0; padding: 0; border-radius: 18px; width: min(460px, calc(100% - 24px)); max-height: calc(100dvh - 32px); background: #211e1b; color: white; }
.mobile-catalogue-dialog::backdrop { background: rgb(20 18 15 / .6); }
.mobile-catalogue-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; background: #211e1b; border-bottom: 1px solid #3f3933; }
.mobile-catalogue-header h2 { margin: 0; font-size: 1.15rem; }
.mobile-catalogue-header .icon-btn { width: 44px; height: 44px; flex: none; }
body.cart-open, body.catalogue-menu-open { overflow: hidden; }
.drawer:not(.open) { visibility: hidden; display: none; }
.drawer.open { visibility: visible; }
.drawer .cart-items { min-height: 0; overscroll-behavior: contain; }
.drawer-header, .drawer-footer { flex: none; }

@media (max-width: 850px) {
  html { scroll-padding-top: 80px; }
  #portalShell { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .topbar { height: 64px; padding: 0 16px; gap: 12px; }
  .topbar nav { gap: 8px; }
  .topbar #accountBtn, .topbar #cartBtn { display: none; }
  .topbar #logoutBtn { min-height: 44px; padding: 8px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; inset: auto 0 0; z-index: 25; height: auto; gap: 0; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); border-top: 1px solid #e6e1db; background: #fff; box-shadow: 0 -8px 28px rgb(28 22 16 / .06); }
  .mobile-nav.has-loyalty { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mobile-nav a, .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; padding: 5px 2px; border: 0; border-radius: 10px; text-decoration: none; background: transparent; color: #625d57; font: 700 .7rem Manrope, Arial, sans-serif; cursor: pointer; }
  .mobile-nav [aria-current] { color: #9b4816; background: #fff3e9; }
  .mobile-nav span { position: relative; font: 24px/1 Arial, sans-serif; }
  #mobileCartBtn > span { order: -1; }
  .mobile-nav b { position: absolute; left: 16px; top: -5px; min-width: 19px; padding: 3px; border-radius: 10px; background: #181715; color: #fff; font: 700 10px/1 Arial, sans-serif; }
  .mobile-nav [hidden] { display: none; }
  .catalogue-shell { padding-top: 32px; }
  .catalogue-layout { gap: 14px; margin-top: 18px; }
  .mobile-catalogue-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid #d7d1c9; border-radius: 10px; color: #181715; background: #fff; text-align: left; font: 700 .88rem Manrope, Arial, sans-serif; cursor: pointer; }
  #mobileCatalogueHost .catalogue-menu { position: static; padding: 14px 18px 24px; box-shadow: none; }
  #mobileCatalogueHost .catalogue-menu details { display: block; width: 100%; }
  #mobileCatalogueHost .catalogue-menu button, #mobileCatalogueHost .catalogue-menu summary { min-height: 44px; font-size: .88rem; }
  #mobileCatalogueHost .catalogue-menu > .menu-link { width: 100%; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-card { min-width: 0; border-radius: 12px; }
  .product-card:only-child { grid-column: 1 / -1; }
  .product-card h3, .product-card .reference, .cart-item b, .mini-ref { overflow-wrap: anywhere; }
  .product-card .product-bottom { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: stretch; gap: 8px; }
  .product-bottom > div:first-child { grid-column: 1 / -1; }
  .product-bottom [data-add] { grid-column: 2; min-height: 44px; border-radius: 8px; font-size: .78rem; }
  .product-bottom [data-favorite] { min-height: 44px; border-radius: 8px; font-size: 1.15rem; }
  .product-card:hover { transform: none; }
  .home-product-card { border-radius: 12px; }
  .home-product-footer { flex-wrap: wrap; }
  .home-product-footer button, .home-link { min-height: 44px; }
  .home-product-footer button { font-size: .8rem; }
  .access-form input, .form-grid input, .form-grid select, .catalogue-search input { font-size: 16px !important; min-width: 0; }
  .password-toggle { min-height: 44px; }
  .modal { padding: 24px 20px; border-radius: 16px; max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
  .modal-close { width: 44px; height: 44px; right: 10px; top: 10px; }
  .drawer { height: 100dvh; width: min(100%, 450px); padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); }
  .drawer h2 { font-size: 1.6rem; }
  .drawer .icon-btn { width: 44px; height: 44px; flex: none; }
  .cart-item { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cart-item .mini-ref { font-size: .75rem; margin-top: 5px; }
  .quantity { justify-content: flex-end; }
  .quantity button { width: 44px; height: 44px; border-radius: 8px; font-size: 1.2rem; }
  .quantity b { min-width: 34px; text-align: center; }
  .drawer-footer .button { min-height: 48px; border-radius: 8px; }
  .toast { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); width: max-content; max-width: calc(100% - 24px); border-radius: 10px; text-align: center; pointer-events: none; }
  body.cart-open .toast { bottom: calc(200px + env(safe-area-inset-bottom, 0px)); }
  .site-footer { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .auth-locked .site-footer { padding-bottom: 20px; }
}
@media (max-width: 540px) {
  .intro.promo-hero { min-height: auto; padding: 32px 16px; gap: 22px; }
  .intro h1 { font-size: clamp(1.9rem, 8vw, 2.5rem); }
  .intro .lead { font-size: .9rem; margin: 18px 0; }
  .promo-visual { border-radius: 10px; }
  .home-showcase { padding-top: 30px; }
  .home-showcase-head { gap: 14px; padding-bottom: 20px; }
  .home-showcase-head > p { font-size: .82rem; }
  .home-product-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; gap: 12px; padding: 0 0 12px; }
  .home-product-card { scroll-snap-align: start; }
  .home-empty { grid-column: auto; }
  .home-rail-head { gap: 6px; margin-top: 24px; }
  .product-card { padding: 12px; }
  .product-card > a:first-child { height: 136px !important; margin-bottom: 12px !important; }
  .product-card h3 { font-size: .9rem; line-height: 1.4; }
  .product-card .stock, .product-card .catalog-extra { font-size: .72rem; }
  .price { font-size: 1.15rem; }
  .catalogue-head h2 { font-size: 1.7rem; }
  .catalogue-status { gap: 10px; font-size: .74rem; }
}
@media (max-width: 359px) {
  .product-grid { grid-template-columns: minmax(0, 1fr); }
  .access-brand { gap: 10px; }
  .access-brand img { width: 54px; height: 54px; }
  .access-brand strong { font-size: 1.35rem; }
}

