/* Mobile layout for the static Wix export.
   Desktop (980px and wider) is untouched. Below that, every Wix layout grid
   becomes a single centred column. The stacking order of each page's items is
   set in that page's <style id="mobile-order"> block. */
@media (max-width: 979px) {
  html, body, #SITE_CONTAINER, #main_MF, #site-root, #masterPage,
  #SITE_HEADER, #SITE_FOOTER, #PAGES_CONTAINER, #SITE_PAGES {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  :root { --site-width: 100% !important; }
  [id^="pageBackground_"], .wixui-section, .wixui-page {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body { overflow-x: hidden; }

  /* Wix positions items with grid areas + pixel offsets; stack them instead. */
  /* Two equal tracks: every item spans both (one per row, centred) except
     small menu buttons, which the page block lets sit two per row. */
  [data-mesh-id$="-gridContainer"] {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    grid-auto-rows: auto !important;
    row-gap: 16px !important;
    column-gap: 8px !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
  }
  [data-mesh-id$="-gridContainer"] > * {
    grid-area: auto / 1 / auto / -1 !important;
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    justify-self: center !important;
    align-self: start !important;
    margin: 0 !important;
    max-width: calc(100vw - 32px) !important;
    min-width: 0 !important;
  }

  /* Full-width sections and strips stay full width. */
  [data-mesh-id$="-gridContainer"] > .wixui-section,
  [data-mesh-id$="-gridContainer"] > .wixui-column-strip,
  [data-mesh-id$="-gridContainer"] > [data-mobile-full] {
    max-width: 100% !important;
    width: 100% !important;
    margin-bottom: 0 !important;
  }
  [data-mesh-id$="inlineContent"] { max-width: 100% !important; }

  /* Sections get breathing room at top and bottom. */
  .wixui-section > [data-mesh-id$="inlineContent"],
  #SITE_HEADER [data-mesh-id="SITE_HEADERinlineContent"],
  #SITE_FOOTER [data-mesh-id="SITE_FOOTERinlineContent"] {
    padding: 24px 0 !important;
    box-sizing: border-box;
  }

  /* Images scale to the screen width, keeping their proportions. */
  [data-mesh-id$="-gridContainer"] > .wixui-image {
    height: auto !important;
    aspect-ratio: var(--mobile-ar, auto);
  }

  /* Text blocks: keep their width when it fits, wrap otherwise. */
  [data-mesh-id$="-gridContainer"] > .wixui-rich-text {
    height: auto !important;
  }
  .wixui-rich-text, .wixui-rich-text * { overflow-wrap: anywhere; }

  /* Gallery (products pages): two columns instead of three or more. */
  .static-gallery { width: 100% !important; }
  .static-gallery .sg-cols { flex-wrap: wrap; }
  .static-gallery .sg-col { flex: 1 1 calc(50% - 8px); }
}

/* Buttons: one consistent width, label centred. */
@media (max-width: 979px) {
  [data-mesh-id$="-gridContainer"] > :has(> .wixui-button) {
    width: min(300px, 100%) !important;
    --label-align: center;
    --label-text-align: center;
  }
  [data-mesh-id$="-gridContainer"] > :has(> .wixui-button) .wixui-button {
    justify-content: center !important;
    text-align: center !important;
  }
  [data-mesh-id$="-gridContainer"] > :has(> .wixui-button) .wixui-button__label {
    margin: 0 !important;
    padding: 0 8px !important;
    text-align: center !important;
    white-space: normal !important;
  }
}

/* Column strips (text panel beside photos): stack the columns. */
@media (max-width: 979px) {
  .wixui-column-strip { display: block !important; min-width: 0 !important; }
  .wixui-column-strip > [data-testid="columns"] {
    display: block !important;
    width: 100% !important;
  }
  .wixui-column-strip__column {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  .wixui-column-strip__column > [data-mesh-id$="inlineContent"] { min-height: 0 !important; }
  .wixui-column-strip__column:has([data-mesh-id$="-gridContainer"] > *) > [data-mesh-id$="inlineContent"] {
    padding: 32px 16px !important;
    box-sizing: border-box;
  }
  /* Photo-only columns (no content of their own): a 260px slice of the photo. */
  .wixui-column-strip__column:not(:has([data-mesh-id$="-gridContainer"] > *)) {
    height: 260px !important;
  }
  .wixui-column-strip__column:not(:has([data-mesh-id$="-gridContainer"] > *)) > [data-mesh-id$="inlineContent"] {
    padding: 0 !important;
  }
  /* Drop the scroll-reveal effect on column photos: just fill the column. */
  .wixui-column-strip__column > [data-hook="bgLayers"] [data-motion-part^="BG_MEDIA"] {
    height: 100% !important;
    margin-top: 0 !important;
  }
  .wixui-column-strip__column > [data-hook="bgLayers"] [data-motion-part^="BG_IMG"] {
    position: relative !important;
    top: 0 !important;
    height: 100% !important;
    margin-bottom: 0 !important;
  }
}

/* Contact form: every field full width. */
@media (max-width: 979px) {
  [data-mesh-id$="-gridContainer"] > :is(.wixui-form, .wixui-text-input, .wixui-text-box),
  [data-mesh-id$="-gridContainer"] > :has(> .wixui-form) {
    width: 100% !important;
    justify-self: stretch !important;
  }
}

/* Wix spacer elements ("wedges") only hold desktop room open. */
@media (max-width: 979px) {
  [data-mesh-id*="-wedge-"] { display: none !important; }
}
