/* ==========================================================================
   SIGN MAX — RESPONSIVE (mobile-first refinements)
   Breakpoints: laptop 1200, tablet 992, small-tablet 768, mobile 560
   ========================================================================== */

@media (max-width: 1200px) {
  .smx-cat-grid { grid-template-columns: repeat(3, 1fr); }
  /* tablet/laptop: max 3 per row */
  .smx-shop-grid ul.products,
  .smx-shop-grid.columns-4 ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .smx-footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .smx-footer__contact-col { grid-column: 1 / -1; }
}

@media (max-width: 992px) {
  .smx-nav, .smx-topbar__meta { display: none; }
  .smx-burger { display: grid; }
  .smx-why-grid { grid-template-columns: repeat(2, 1fr); }
  .smx-projects { grid-template-columns: repeat(2, 1fr); }
  .smx-cat-grid { grid-template-columns: repeat(2, 1fr); }
  .smx-cat-card--tall { grid-row: span 1; }
  .smx-single-product { grid-template-columns: 1fr; }
  .smx-pgallery { position: static; }
  .smx-shop-layout { grid-template-columns: 1fr; }
  .smx-filters { position: static; }
  .smx-cart-layout, .smx-checkout-layout, .smx-blog-layout { grid-template-columns: 1fr; }
  .smx-cart-summary, .smx-sidebar { position: static; }
  .smx-post-grid { grid-template-columns: repeat(2, 1fr); }
  .smx-mobile-filter-toggle { display: inline-flex; }
}

@media (max-width: 768px) {
  :root { --smx-header-h: 64px; }
  /* Compact mobile header: logo + 4 icon controls + burger must fit 320px.
     The burger was clipped off-viewport because the actions row overflowed. */
  .smx-header__inner { gap: var(--smx-space-2); justify-content: space-between; min-width: 0; }
  .smx-logo { flex-shrink: 1; min-width: 0; overflow: hidden; }
  .smx-logo img { max-height: 36px; }
  .smx-logo__text { font-size: 1.25rem; white-space: nowrap; }
  .smx-header__actions { gap: 0; flex-shrink: 0; }
  .smx-iconbtn { width: 42px; height: 42px; }
  .smx-iconbtn svg { width: 20px; height: 20px; }
  /* hover dropdowns don't exist on touch — the icon links straight to My Account */
  .smx-account-menu__panel { display: none; }
  .smx-section { padding-block: var(--smx-space-7); }
  .smx-why-grid { grid-template-columns: 1fr; }
  /* tablet: 2 per row */
  .smx-shop-grid ul.products,
  .smx-shop-grid.columns-3 ul.products,
  .smx-shop-grid.columns-4 ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .smx-hero__stats { gap: var(--smx-space-5); }
  .smx-footer__grid { grid-template-columns: 1fr 1fr; }
  .smx-footer__bottom { flex-direction: column; gap: var(--smx-space-3); text-align: center; }
  .smx-slider-head { flex-direction: column; align-items: flex-start; }
  .smx-post-grid { grid-template-columns: 1fr; }
  .smx-topbar__contact { gap: var(--smx-space-3); font-size: var(--smx-fs-xs); }
}

@media (max-width: 560px) {
  .smx-cat-grid { grid-template-columns: 1fr; }
  .smx-projects { grid-template-columns: 1fr; }
  .smx-cat-card { min-height: 200px; }
  .smx-hero__cta .smx-btn { width: 100%; }
  /* mobile: 1 per row */
  .smx-shop-grid ul.products,
  .smx-shop-grid.columns-2 ul.products,
  .smx-shop-grid.columns-3 ul.products,
  .smx-shop-grid.columns-4 ul.products { grid-template-columns: minmax(0, 1fr) !important; }
  .smx-footer__grid { grid-template-columns: 1fr; }
  .smx-hero__stats { width: 100%; }
  .smx-hero__stats .smx-stat { flex: 1 1 40%; }
  .smx-newsletter { flex-direction: column; }
  .smx-newsletter .smx-btn { width: 100%; }
}

/* Sticky add-to-cart bar on mobile single product */
.smx-sticky-atc { display: none; }
@media (max-width: 768px) {
  .smx-sticky-atc {
    position: fixed; inset: auto 0 0 0; z-index: var(--smx-z-header); background: #fff;
    border-top: 1px solid var(--smx-border); box-shadow: 0 -6px 20px rgba(0,0,0,0.08);
    padding: 0.7rem var(--smx-gutter); display: flex; align-items: center; gap: var(--smx-space-3);
    transform: translateY(110%); transition: transform var(--smx-dur) var(--smx-ease);
  }
  .smx-sticky-atc.is-visible { transform: none; }
  .smx-sticky-atc__price { font-family: var(--smx-font-head); font-weight: 700; color: var(--smx-ink); }
  .smx-sticky-atc .smx-btn { margin-left: auto; }
}

.smx-mobile-filter-toggle { display: none; }

/* Collapsible shop filters on tablet/mobile */
@media (max-width: 992px) {
  #smx-filters { border: 1px solid var(--smx-border); border-radius: var(--smx-radius-lg); padding: var(--smx-space-3); background: #fff; margin-bottom: var(--smx-space-4); }
  #smx-filters:not(.is-open-mobile) #smx-filter-form { display: none; }
  #smx-filters .smx-filter { border: 0; border-top: 1px solid var(--smx-border); border-radius: 0; padding: var(--smx-space-4) 0 0; }
  #smx-filters .smx-filter:first-child { border-top: 0; padding-top: 0; }
}

/* Global overflow + media safeguards (no horizontal scroll at any width) */
img, video, table { max-width: 100%; }
.woocommerce table.shop_table_responsive { width: 100%; }
.smx-range__track { touch-action: none; }
@media (max-width: 480px) {
  /* Quote CTA + account icon live in the drawer on small phones. */
  .smx-header__quote { display: none; }
  .smx-account-menu { display: none; }
  .smx-iconbtn { width: 40px; height: 40px; }
  .smx-logo img { max-height: 32px; }
}
@media (max-width: 360px) {
  :root { --smx-gutter: 1rem; }
  .smx-btn { padding-inline: 1.2em; }
  .smx-hero__stats .smx-stat__num { font-size: var(--smx-fs-xl); }
}
