/* Mobile fixes (24.11). Loaded after main.css and overrides.css. */

/* ── Mobile menu (drawer) ── */
.m-menu { position: fixed; inset: 0; z-index: 10050; visibility: hidden; pointer-events: none; overflow: hidden; }
.m-menu.open { visibility: visible; pointer-events: auto; }
.m-menu-backdrop { position: absolute; inset: 0; background: rgba(12, 12, 14, .55); opacity: 0; transition: opacity .25s; }
.m-menu.open .m-menu-backdrop { opacity: 1; }
.m-menu-panel {
  position: absolute; top: 0; bottom: 0; right: 0; width: min(86vw, 360px);
  background: var(--bg, #fff); color: var(--text, #111);
  transform: translateX(100%); transition: transform .28s ease;
  display: flex; flex-direction: column; box-shadow: -8px 0 32px rgba(0, 0, 0, .25);
}
.m-menu.open .m-menu-panel { transform: none; }
.m-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border, #e5e5e5); }
.m-menu-head strong { font-size: 1.05rem; }
.m-menu-close { border: 0; background: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: inherit; padding: .25rem .5rem; }
.m-menu-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: .5rem 0 1.5rem; flex: 1; }
.m-menu-body ul { list-style: none; margin: 0; padding: 0; }
.m-menu-body a, .m-menu-body summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .85rem 1.25rem; color: inherit; text-decoration: none; font-size: 1rem; font-weight: 500; cursor: pointer; }
.m-menu-body summary { list-style: none; }
.m-menu-body summary::-webkit-details-marker { display: none; }
.m-menu-body summary::after { content: '▾'; font-size: .8rem; color: var(--text-dim, #777); transition: transform .2s; }
.m-menu-body details[open] > summary::after { transform: rotate(180deg); }
.m-menu-body details details summary, .m-menu-body details li a { padding-block: .6rem; padding-inline-start: 2rem; font-size: .93rem; font-weight: 400; }
.m-menu-body details details li a { padding-inline-start: 2.75rem; color: var(--text-mid, #555); }
.m-menu-body > ul > li + li, .m-menu-body > ul > li > details > ul > li { border-top: 1px solid var(--border, #eee); }
.m-menu-cta { margin: 1rem 1.25rem 0; display: flex !important; justify-content: center !important; }
body.m-menu-lock { overflow: hidden; }
.nav-toggle:focus-visible, .m-menu-close:focus-visible { outline: 2px solid var(--accent, #E8611A); outline-offset: 2px; }

/* ── Price calculator: nothing wider than its box ── */
.pcalc { grid-template-columns: minmax(0, 1fr); }
.pcalc > *, .pcalc-field, .pcalc-result > * { min-width: 0; max-width: 100%; }
.pcalc-head { flex-wrap: wrap; row-gap: .25rem; }
.pcalc-fine, .pcalc-note, .pcalc-logo-note, .pcalc-total, .pcalc-vat, .pcalc-per, .pcalc-quote-note, .pcalc-added { overflow-wrap: anywhere; }
.pcalc-logo input[type=file] { width: 100%; max-width: 100%; box-sizing: border-box; }
.pcalc-result > div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .35rem; }
.pcalc-actions > * { min-width: 0; }

/* ── Category filters (bottom sheet on mobile) ── */
.filters-open, .filters-sheet-head, .filters-backdrop { display: none; }

@media (max-width: 767px) {
  /* Never wider than the screen. */
  .split { grid-template-columns: minmax(0, 1fr) !important; }
  .split > * { min-width: 0; max-width: 100%; }
  .split-content, .split-visual { width: auto !important; }
  .post-body .alignwide, .post-body .alignfull, .page-body .alignwide { margin-inline: 0 !important; width: auto !important; max-width: 100% !important; }
  .split-content h1, .split-content h2, .split-content p, .breadcrumbs, .woocommerce-breadcrumb { overflow-wrap: anywhere; }

  /* 1 · Homepage hero: the last frame (open card) and one heading, no scroll effect. */
  .hero-scroll { height: auto !important; }
  .hero-sticky { position: relative !important; height: auto !important; display: flex; flex-direction: column; padding-top: 72px; }
  .hero-video { position: relative !important; inset: auto; height: auto !important; aspect-ratio: 4 / 3; object-position: center 68%; }
  .hero-overlay, .hero-scroll-indicator { display: none !important; }
  .hero-phase { display: none !important; }
  .hero-sticky > .hero-phase:nth-last-child(2) { display: flex !important; position: relative !important; inset: auto; opacity: 1 !important; padding: 1.25rem 1.25rem 2.25rem !important; pointer-events: auto; }
  .hero-sticky > .hero-phase:nth-last-child(2) h1 { font-size: clamp(1.6rem, 7.5vw, 2.1rem); margin-bottom: .5rem; }
  .hero-sticky > .hero-phase:nth-last-child(2) p { font-size: 1rem; line-height: 1.6; }

  /* 3 · Counters: one line each. */
  .stat-number { font-size: clamp(1.35rem, 6.4vw, 1.7rem) !important; white-space: nowrap; line-height: 1.2; }
  .stat-label { font-size: .8rem !important; }

  /* 4 · Featured products: two columns. */
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .75rem !important; }
  .products-grid .product-card { min-width: 0; }
  .products-grid .product-card h3, .products-grid .product-card h4, .products-grid .product-card [class*=title], .products-grid .product-card [class*=name] { font-size: .88rem !important; line-height: 1.35; }
  .products-grid .product-card [class*=price] { font-size: .85rem !important; }
  .products-grid .product-card [class*=btn], .products-grid .product-card .btn-primary { font-size: .8rem !important; padding: .45rem .6rem !important; }

  /* 5 · Featured filter: one scrolling row. */
  .products-categories { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scrollbar-width: none; justify-content: flex-start !important; padding-bottom: .25rem; margin-inline: -1.5rem; padding-inline: 1.5rem; width: calc(100% + 3rem); max-width: 100vw; box-sizing: border-box; flex: none; align-self: stretch; }
  .products-categories::-webkit-scrollbar { display: none; }
  .products-categories .cat-btn { flex: none; white-space: nowrap; scroll-snap-align: start; }

  /* 6 · Category filters: a button opens a bottom sheet. */
  .filters-open { display: inline-flex; align-items: center; gap: .5rem; margin: 1rem 1.25rem 0; padding: .55rem 1rem; border: 1.5px solid var(--border, #ddd); border-radius: 999px; background: var(--bg, #fff); color: var(--text, #111); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; }
  .filters-open svg { width: 18px; height: 18px; }
  .filters-open .filters-count { font-weight: 400; color: var(--text-dim, #777); }
  form.filters-bar { position: fixed !important; inset: auto 0 0 0 !important; z-index: 10040; max-height: 78vh; overflow-y: auto; margin: 0 !important; padding: 1rem 1.25rem 1.5rem !important; background: var(--bg, #fff); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); transform: translateY(105%); transition: transform .28s ease; display: flex !important; flex-wrap: wrap; gap: .5rem; align-content: flex-start; }
  form.filters-bar.open { transform: none; }
  form.filters-bar .filters-sheet-head { flex: 1 0 100%; display: flex; justify-content: space-between; align-items: center; margin-bottom: .25rem; }
  form.filters-bar .filters-sheet-head strong { font-size: 1.05rem; }
  form.filters-bar .filters-sheet-close { border: 0; background: none; font-size: 1.7rem; line-height: 1; cursor: pointer; color: inherit; }
  form.filters-bar .filters-right { flex: 1 0 100%; margin: .5rem 0 0 !important; }
  form.filters-bar .filter-sort { width: 100%; }
  .filters-backdrop { display: block; position: fixed; inset: 0; z-index: 10030; background: rgba(12, 12, 14, .5); opacity: 0; visibility: hidden; transition: opacity .25s; }
  .filters-backdrop.open { opacity: 1; visibility: visible; }

  /* 7 · Product photos: whole product, never cropped. */
  .cat-card-img img, .product-card img, .products-grid img, .related img { object-fit: contain !important; background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  .m-menu-panel, .m-menu-backdrop, form.filters-bar, .filters-backdrop { transition: none !important; }
}
