/* Nexus Stationery — mobile and tablet layout fixes.
   Loaded AFTER the original CSS so the desktop storefront stays unchanged.
   Cloudflare Pages catalogue preview only; this does not enable checkout. */

/* Size intrinsic content to the available width instead of expanding a grid/flex row. */
#view, main, .container, .section, .ans-wrap, .category-card, .product,
.footer-grid > div, .ans-svc__body, .ans-corp > *, .ans-story > * {
  min-width: 0;
}
img, video, svg { max-width: 100%; }
.product h3, .category-card h3, .ans-cat__title, .footer-grid a,
.ans-svc__body p, .info-page, .cart-line b { overflow-wrap: anywhere; }

@media (max-width: 989px) {
  .main-nav { display: none; }
  .mobile-trigger { display: grid; }
  .header-inner {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 92px;
    gap: 8px;
    justify-content: initial;
    align-items: center;
    height: 72px;
    padding-inline: 16px;
  }
  .brand { min-width: 0; justify-self: center; justify-content: center; font-size: clamp(15px, 2.7vw, 21px); gap: 6px; white-space: nowrap; }
  .header-tools { min-width: 0; justify-self: end; display: flex; justify-content: flex-end; gap: 4px; }
  .header-tools #accountTrigger { display: none; }
  .header .icon, #mobileTrigger { min-width: 40px; width: 40px; height: 44px; }
  .announcement { height: auto; min-height: 36px; padding: 8px 14px; text-align: center; font-size: 12px; line-height: 1.35; }

  .container { padding-inline: 20px; }
  .hero { height: clamp(340px, 50vw, 465px); min-height: 0; }
  .hero-content { max-width: 85%; transform: none; padding: 24px; }
  .hero h1 { font-size: clamp(28px, 4.8vw, 42px); line-height: 1.14; overflow-wrap: break-word; }
  .hero::after { background: linear-gradient(90deg, rgba(14,26,33,.78) 0%,rgba(14,26,33,.28) 85%); }

  .category-grid, .ans-cats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .products:not(.product-carousel) { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .product-carousel { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: calc((100% - 28px)/3); gap: 14px; }
  .ans-usp { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ans-corp, .ans-story, .ans-svc { grid-template-columns: minmax(0,1fr); }
  .ans-svc__card { min-width:0; }
  .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px 36px; }
  .newsletter { padding: 38px 22px; }
  .newsletter p { display: block; max-width: 46ch; margin: 12px auto 0; }

  .left-drawer { overflow-y:auto; }
  .drawer { height: 100vh; height: 100dvh; max-width: 100%; }
  #mobileNav { flex:1; overflow-y:auto; overscroll-behavior:contain; }
  .mobile-cat { padding-block: 8px; }
  .mobile-cat summary, .mobile-cat>a { display:flex; min-height:44px; align-items:center; padding-block:10px; cursor:pointer; }
  .mobile-cat details a { min-height:44px; }
  .drawer-head { padding:18px 20px; }
  .drawer #cartItems { min-height:0; }
  .cart-line > div { flex:1; min-width:0; }
  .qty { flex-wrap:wrap; gap:8px; }
  .qty button { min-height:40px; }
  .cart-bottom { padding: 18px 20px max(20px,env(safe-area-inset-bottom)); }
  .search-modal { max-height: 90vh; max-height: 90dvh; }
  .search-bar input { min-width: 0; }

  .filter-bar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
  .filter-bar label { display:flex; align-items:center; gap:8px; max-width:100%; }
  .filter-bar select { min-width:0; max-width:100%; }
  .page-title h1 { overflow-wrap:anywhere; }
  .info-page { margin-block: 36px 70px; }
  .pagination { flex-wrap:wrap; gap: 14px; }
  .copyright { padding-inline:20px; }
}

@media (max-width: 600px) {
  .header-inner { grid-template-columns:40px minmax(0,1fr) 84px; gap:4px; height:68px; padding-inline:12px; }
  .header .icon, #mobileTrigger { width:40px; min-width:40px; height:44px; }
  .header-tools { gap:2px; }
  .brand { font-size:clamp(13px,3.8vw,17px); letter-spacing:0; gap:5px; }
  .container { padding-inline:16px; }
  .hero { height:350px; min-height:0; }
  .hero-content { width:100%; max-width:100%; padding:18px 20px; transform:none; }
  .hero h1 { font-size:clamp(27px,7.8vw,36px); line-height:1.12; letter-spacing:-.5px; }
  .hero img { object-position:60% center; }
  .hero::after { background:linear-gradient(90deg,rgba(14,26,33,.75),rgba(14,26,33,.35)); }

  .ans-head, .section-heading { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 12px; }
  .ans-head h2, .section-heading h2, .service-section h2 { flex:1 1 auto; min-width:0; font-size:clamp(21px,5.7vw,27px); line-height:1.2; }
  .ans-head .ans-link, .section-heading a { flex:0 0 auto; font-size:12px; white-space:normal; }
  .ans-cat__media { aspect-ratio:4/3; }
  .category-grid, .ans-cats { gap:16px 12px; }
  .category-card h3, .ans-cat__title { font-size:13px; line-height:1.35; }
  .category-card p, .ans-cat__count { font-size:11px; }
  .products:not(.product-carousel) { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 12px; }
  .product-carousel { grid-auto-columns:calc((100% - 12px)/2); gap:12px; }
  .product .photo { aspect-ratio:1; }
  .product h3 { line-height:1.45; font-size:12px; }
  .price { font-size:13px; }
  .old { font-size:11px; }
  .product .add { height:36px; width:36px; }
  .carousel-next { right:18px; }

  .ans-usp { grid-template-columns:minmax(0,1fr); gap:18px; }
  .benefits { padding-block:26px; }
  .ans-svc__card { grid-template-columns:minmax(0,1fr); }
  .ans-svc__media { min-height:180px; max-height:240px; }
  .ans-svc__body { padding:20px; }
  .ans-corp h2, .ans-story h2 { font-size:clamp(25px,7vw,32px); line-height:1.2; }
  .ans-actions { flex-wrap:wrap; }
  .ans-actions .button, .ans-actions .button-secondary { text-align:center; }
  .footer-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px 18px; padding:34px 18px; }
  .footer-grid h3, .footer-grid h4 { font-size:14px; }
  .footer-grid p, .footer-grid a { line-height:1.5; }
  .newsletter { padding:32px 18px; }
  .newsletter h2 { font-size:24px; line-height:1.2; }
  .newsletter p { line-height:1.5; }
  .copyright { padding:20px 18px; line-height:1.5; }

  .drawer { width:min(410px,100vw); }
  .drawer #cartItems { padding:16px; }
  .cart-line { gap:12px; }
  .cart-line img { width:64px; height:75px; flex:none; }
  .cart-bottom { padding:16px; }
  .search-modal { padding:14px 14px max(14px,env(safe-area-inset-bottom)); }
  .search-bar input { font-size:16px; padding:12px 6px; }
  .search-bar .close { min-width:40px; }
  .search-hit { min-width:0; }
  .search-hit > div { min-width:0; overflow-wrap:anywhere; }
  .toast { left:12px; right:12px; bottom:calc(14px + env(safe-area-inset-bottom)); transform:translateY(120px); width:auto; text-align:center; }
  .toast.show { transform:translateY(0); }

  .filter-bar label { width:100%; flex-wrap:wrap; }
  .filter-bar select { flex:1; min-width:160px; font-size:16px; }
  .product-detail { grid-template-columns:minmax(0,1fr); gap:22px; padding-top:22px; }
  .product-detail > img { width:100%; max-height:460px; }
  .product-detail h1 { font-size:clamp(23px,6.5vw,30px); }
  .product-detail #detailQty { min-height:44px; max-width:90px; font-size:16px; }
  .info-page h1 { font-size:28px; }
  .account-grid, .checkout-layout { grid-template-columns:minmax(0,1fr); }
}

@media (max-width: 360px) {
  .header-inner { grid-template-columns:36px minmax(0,1fr) 76px; gap:3px; padding-inline:8px; }
  .header .icon, #mobileTrigger { min-width:36px; width:36px; }
  .brand { flex-direction:column; gap:0; font-size:14px; line-height:1.12; }
  .brand-nexus { font-size:16px; }
  .container { padding-inline:12px; }
  .ans-head, .section-heading { align-items:flex-start; }
  .footer-grid { grid-template-columns:1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer, .toast, .product .photo img { transition:none; }
}

/* Shopfront silver and the bilingual fascia from the actual shop. */
.announcement{background:#545856;color:#fff}
.header{background:#d0d0d4;color:#26382e;border-bottom:1px solid #c3c5c2}
.header .icon{color:#243e32}
.header-inner .brand{display:block;width:min(334px,100%);line-height:0}
.shop-wordmark{display:block;width:100%;height:auto;overflow:hidden}


.main-nav{background:#f4f4f2;border-bottom:1px solid #d4d5d2}
.footer{background:#373c39}
.hero-content{padding-inline:clamp(20px,3vw,56px)}
@media(max-width:989px){
.header-inner .brand{width:min(300px,100%)}
#view .hero{display:block;height:auto;min-height:0;background:#d0d0d4}
#view .hero>img{display:block;position:static;inset:auto;width:100%;height:auto;object-fit:contain}
#view .hero::after{display:none}
#view .hero .hero-content{position:static;transform:none;max-width:none;width:auto;padding:14px 18px;background:#d0d0d4}
#view .hero h1{font-size:clamp(17px,3.3vw,24px);line-height:1.25;color:#243c30;letter-spacing:-.025em}
#view .hero h1 br{display:none}
.product-carousel{scroll-snap-type:x proximity;overscroll-behavior-x:contain}
.product-carousel>*{scroll-snap-align:start;min-width:0}
}
@media(max-width:600px){.header-inner{grid-template-columns:40px minmax(0,1fr) 76px;padding-inline:8px;gap:4px}.header-inner .brand{width:min(243px,100%)}}

.header-inner .brand{min-width:0;max-width:100%;overflow:hidden}
.header .brand .shop-wordmark{display:block;position:static;width:100%;max-width:100%;height:auto;object-fit:contain;transform:none}
@media(max-width:989px){.header-inner{display:grid;grid-template-columns:40px minmax(0,1fr) max-content;align-items:center}.header-tools{position:static}.header-inner .brand{justify-self:center}}

.nexus-contact{display:block;background:var(--color-background,#fff);border:1px solid var(--color-border,#ccc);border-radius:12px;padding:22px 24px}.ans-loc.nexus-contact>a{border:0;padding:0;background:transparent;border-radius:0}.nexus-contact-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}.ans-loc .nexus-contact-actions a{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 16px;min-height:44px;box-sizing:border-box;border:1px solid #185b4a;border-radius:5px;color:#185b4a;background:#fff;font-weight:600}.ans-loc .nexus-contact-actions .contact-wa{background:#185b4a;color:#fff}.nexus-contact-actions a:hover{text-decoration:underline}.nexus-contact a:focus-visible{outline:3px solid #126d94;outline-offset:3px}
