/* FoxiWorld V1093 — lekki, mobilny storefront. Desktop pozostaje bez zmian. */
@media (max-width: 768px) {
  :root {
    --fxm-green: #08785d;
    --fxm-green-dark: #064f40;
    --fxm-ink: #17201d;
    --fxm-muted: #65716d;
    --fxm-line: #dfe7e3;
    --fxm-soft: #f4f8f6;
    --fxm-orange: #ff5a00;
    --fxm-header-h: 68px;
    --fxm-dock-h: 64px;
  }

  html { scroll-behavior: auto; }
  body.foxi-mobile-app {
    overflow-x: clip;
    padding-bottom: calc(var(--fxm-dock-h) + env(safe-area-inset-bottom, 0px));
    background: #fff;
  }

  /* Tylko transform i opacity: brak kosztownego blur podczas scrollowania. */
  body.foxi-mobile-app .v12-header,
  body.foxi-mobile-app .fw-header,
  body.foxi-mobile-app .site-header {
    position: sticky;
    top: 0;
    z-index: 91;
    background: rgba(255,255,255,.985) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid var(--fxm-line);
    transform: translate3d(0,0,0);
    transition: transform .2s ease;
    will-change: transform;
  }
  body.foxi-mobile-app.fxm-header-hidden .v12-header,
  body.foxi-mobile-app.fxm-header-hidden .fw-header,
  body.foxi-mobile-app.fxm-header-hidden .site-header { transform: translate3d(0,-100%,0); }
  body.foxi-mobile-app.fxm-header-compact .v12-topbar,
  body.foxi-mobile-app.fxm-header-compact .fw-topbar {
    /* V1187: do not remove height from the document during an active swipe. */
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.foxi-mobile-app .v12-topbar { display: none !important; }
  body.foxi-mobile-app .v12-header-main {
    min-height: var(--fxm-header-h);
    padding: 8px 12px;
    gap: 8px;
  }
  body.foxi-mobile-app .v12-logo { flex: 0 0 auto; }
  body.foxi-mobile-app .v12-logo-mark { width: 42px; height: 42px; }
  body.foxi-mobile-app .v12-logo > span:last-child { display: none; }
  body.foxi-mobile-app .v12-search { min-width: 0; flex: 1; }
  body.foxi-mobile-app .v12-search input { min-width: 0; height: 44px; font-size: 16px; }
  body.foxi-mobile-app .v12-search button { width: 46px; height: 44px; }
  body.foxi-mobile-app .v12-user-tools { gap: 4px; }
  body.foxi-mobile-app .v12-user-tools > a { min-width: 42px; padding: 5px; }
  body.foxi-mobile-app .v12-user-tools > a div { display: none; }
  body.foxi-mobile-app .v12-category-nav-wrap { display: none; }

  .fxm-catalog-tools {
    position: sticky;
    top: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid var(--fxm-line);
  }
  .fxm-catalog-tools button {
    min-height: 44px;
    border: 1px solid var(--fxm-line);
    border-radius: 12px;
    background: #fff;
    color: var(--fxm-ink);
    font: 700 14px/1 inherit;
    padding: 0 14px;
  }
  .fxm-catalog-tools button:last-child { color: var(--fxm-green-dark); border-color: #aad3c7; }

  body.catalog-page .v12-catalog-main { padding: 0 10px 22px; }
  body.catalog-page .v12-breadcrumbs { margin-top: 10px; }
  body.catalog-page .v12-products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 10px !important;
  }
  body.catalog-page .v12-product-card {
    min-width: 0;
    border: 1px solid var(--fxm-line) !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    background: #fff;
    overflow: clip;
    content-visibility: auto;
    contain-intrinsic-size: 320px 590px;
  }
  body.catalog-page .v12-product-card:hover { transform: none !important; box-shadow: none !important; }
  body.catalog-page .v12-product-media { aspect-ratio: 1/1; min-height: 0; }
  body.catalog-page .v12-product-media img { width: 100%; height: 100%; object-fit: contain; }
  body.catalog-page .v12-quick-view { display: none !important; }
  body.catalog-page .v12-product-body { padding: 10px; gap: 6px; }
  body.catalog-page .v12-product-brand { font-size: 10px; letter-spacing: .06em; }
  body.catalog-page .v12-product-body h2 { font-size: 14px; line-height: 1.28; min-height: 2.55em; }
  body.catalog-page .v12-product-body > p { display: none; }
  body.catalog-page .v12-rating { display: flex !important; gap: 5px; align-items: center; font-size: 11px; min-width: 0; }
  body.catalog-page .v12-rating span { color: #f5a000; white-space: nowrap; }
  body.catalog-page .v12-rating em { color: var(--fxm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.catalog-page .v12-product-price strong { font-size: 20px; }
  body.catalog-page .catalog-omnibus,
  body.catalog-page .v12-product-price > small:not(.v12-unit-price) { font-size: 9px; line-height: 1.25; }
  .fx-mobile-proof { display: grid; gap: 3px; font-size: 11px; color: var(--fxm-muted); }
  .fx-mobile-proof strong { color: var(--fxm-green); font-size: 11px; }
  body.catalog-page .v12-stock { font-size: 11px; }
  body.catalog-page .v12-product-actions { gap: 6px; }
  body.catalog-page .v12-qty { display: none; }
  body.catalog-page .v12-add-cart { width: 100%; min-height: 42px; border-radius: 10px; font-size: 13px; }

  /* Filtry jako pełny, przewijalny panel. */
  body.catalog-page .v12-filter-panel {
    position: fixed !important;
    inset: 0 !important;
    z-index: 160 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100dvh !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    padding: 14px 16px calc(92px + env(safe-area-inset-bottom,0px));
    background: #fff;
    transform: translate3d(-102%,0,0);
    transition: transform .22s ease;
    box-shadow: none !important;
  }
  body.catalog-page .v12-filter-panel.is-open { transform: translate3d(0,0,0); }

  /* Mobilna karta produktu */
  body.foxi-mobile-product main { padding-bottom: 88px; }
  body.foxi-mobile-product .product-page { padding: 8px 12px 28px; }
  body.foxi-mobile-product .breadcrumbs { font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  body.foxi-mobile-product .pd-hero { display: block !important; }
  body.foxi-mobile-product .pd-gallery { width: 100%; }
  body.foxi-mobile-product .pd-main-photo { aspect-ratio: 1/1; border: 0; box-shadow: none !important; }
  body.foxi-mobile-product .pd-thumbs { display: flex; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; }
  body.foxi-mobile-product .pd-thumb { flex: 0 0 58px; scroll-snap-align: start; }
  body.foxi-mobile-product .pd-info { padding: 10px 0 0; }
  body.foxi-mobile-product .pd-info h1 { font-size: clamp(23px,7vw,32px); line-height: 1.12; }
  body.foxi-mobile-product .pd-rating-row { display: flex !important; }
  body.foxi-mobile-product .pd-mobile-meta {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    margin: 12px 0;
  }
  body.foxi-mobile-product .pd-mobile-meta > span {
    border: 1px solid var(--fxm-line);
    border-radius: 12px;
    padding: 10px;
    background: var(--fxm-soft);
  }
  body.foxi-mobile-product .pd-mobile-meta small { display: block; color: var(--fxm-muted); font-size: 10px; }
  body.foxi-mobile-product .pd-mobile-meta strong { display: block; margin-top: 3px; color: var(--fxm-ink); font-size: 13px; }
  body.foxi-mobile-product .pd-content-grid { display: block !important; }
  body.foxi-mobile-product .pd-sidebar-v703 { margin-top: 14px; }
  body.foxi-mobile-product .pd-buy { scroll-margin-bottom: 150px; }

  body.foxi-mobile-product .pd-mobile-buybar {
    left: 0 !important;
    right: 0 !important;
    bottom: calc(var(--fxm-dock-h) + env(safe-area-inset-bottom,0px)) !important;
    z-index: 130 !important;
    display: grid !important;
    grid-template-columns: minmax(86px,.8fr) 1fr 1fr;
    gap: 7px;
    align-items: center;
    padding: 8px 10px;
    border-top: 1px solid var(--fxm-line);
    background: #fff !important;
    box-shadow: none !important;
  }
  body.foxi-mobile-product .pd-mobile-buybar > div { min-width: 0; }
  body.foxi-mobile-product .pd-mobile-buybar strong { font-size: 16px; white-space: nowrap; }
  body.foxi-mobile-product .pd-mobile-buybar button,
  body.foxi-mobile-product .pd-mobile-buybar .fxm-buy-now {
    min-width: 0;
    min-height: 48px;
    border: 1px solid var(--fxm-green);
    border-radius: 11px;
    font: 800 13px/1.1 inherit;
    padding: 8px 6px;
  }
  body.foxi-mobile-product .pd-mobile-buybar .fxm-buy-now { background: #fff; color: var(--fxm-green-dark); }
  body.foxi-mobile-product .pd-mobile-buybar #pdMobileAdd { background: var(--fxm-green); color: #fff; }
  body.foxi-mobile-product .pd-mobile-buybar button:disabled { opacity: .45; cursor: not-allowed; }

  .fx-mobile-dock {
    min-height: var(--fxm-dock-h) !important;
    padding-bottom: env(safe-area-inset-bottom,0px) !important;
    border-top: 1px solid var(--fxm-line) !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  .fx-mobile-dock a,.fx-mobile-dock button { min-height: 54px; }

  body.foxi-mobile-app .fx-mobile-dock {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    width: auto !important;
    min-height: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom, 0px)) !important;
    border: 1px solid var(--fxm-line) !important;
    border-radius: 18px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  html body.foxi-mobile-app .fx-mobile-dock a,
  html body.foxi-mobile-app .fx-mobile-dock button {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    min-width: 0 !important;
    min-height: 52px !important;
    padding: 4px 1px !important;
    overflow: hidden !important;
    font-size: 9px !important;
    line-height: 1.05 !important;
  }

  html body.foxi-mobile-app .fx-mobile-dock a > span,
  html body.foxi-mobile-app .fx-mobile-dock button > span {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    font-size: 9px !important;
    line-height: 1.05 !important;
    text-align: center !important;
  }

  body.foxi-mobile-app .fx-mobile-dock svg {
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
  }

  @media (max-width: 374px) {
    body.catalog-page .v12-products-grid { gap: 7px !important; }
    body.catalog-page .v12-product-body { padding: 8px; }
    body.catalog-page .v12-product-body h2 { font-size: 13px; }
    body.catalog-page .v12-product-price strong { font-size: 18px; }
    html body.foxi-mobile-app .fx-mobile-dock a,
    html body.foxi-mobile-app .fx-mobile-dock button,
    html body.foxi-mobile-app .fx-mobile-dock a > span,
    html body.foxi-mobile-app .fx-mobile-dock button > span { font-size: 8px !important; }
    body.foxi-mobile-product .pd-mobile-buybar { grid-template-columns: 78px 1fr 1fr; padding-inline: 6px; }
    body.foxi-mobile-product .pd-mobile-buybar button,
    body.foxi-mobile-product .pd-mobile-buybar .fxm-buy-now { font-size: 12px; }
  }
}

@media (prefers-reduced-motion: reduce) {
  body.foxi-mobile-app .v12-header,
  body.foxi-mobile-app .fw-header,
  body.foxi-mobile-app .site-header,
  body.catalog-page .v12-filter-panel { transition: none !important; }
}
