/**
 * Hide WoodMart chrome when FM proto redesign is active.
 */
body.fm-proto .whb-header,
body.fm-proto header.whb-header,
body.fm-proto .whb-main-header,
body.fm-proto .wd-header-nav,
body.fm-proto .woodmart-sticky-toolbar,
body.fm-proto .wd-page-title,
body.fm-proto .page-title,
body.fm-proto .wd-breadcrumbs,
body.fm-proto .woodmart-woocommerce-breadcrumb {
  display: none !important;
}

body.fm-proto .wd-page-wrapper {
  padding-top: 0 !important;
}

body.fm-proto .fm-hdr {
  position: relative !important;
  top: auto !important;
  z-index: 500 !important;
  background: #fff;
}
body.fm-proto .fm-hdr-sticky {
  z-index: 1200 !important;
}
/* overflow-x:clip/hidden on body/html breaks fixed overlays */
html:has(body.fm-proto),
body.fm-proto {
  overflow-x: visible !important;
}

body.fm-proto .website-wrapper > .main-page-wrapper,
body.fm-proto .wd-content-area,
body.fm-proto .wd-page-content {
  margin-top: 0 !important;
}

/* Front home: full bleed */
body.fm-proto.home .container.wd-entry-content,
body.fm-proto.home .entry-content > .wpb_row {
  max-width: none;
  padding: 0;
}

body.fm-proto .fm-home-products .products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 900px) {
  body.fm-proto .fm-home-products .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.fm-proto .fm-home-products .product {
  margin: 0 !important;
  width: 100% !important;
  float: none !important;
}

body.fm-proto footer.fm-foot {
  margin-top: 0;
  background: #f7f7f7;
  padding: 40px 0 24px;
  border-top: 1px solid #e5e5e5;
}

/* Kill WoodMart / sticky-toolbar residual strip above FM header */
body.fm-proto {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
body.fm-proto .website-wrapper,
body.fm-proto .main-page-wrapper,
body.fm-proto .wd-page-content,
body.fm-proto #main-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
body.fm-proto .fm-strip-promo {
  margin-top: 0 !important;
}
body.fm-proto .woodmart-sticky-toolbar,
body.fm-proto .wd-sticky-toolbar,
body.fm-proto .wd-toolbar {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* Guard against WoodMart img / grid resets */
body.fm-proto .fm-hdr img,
body.fm-proto .fm-hdr-sticky img,
body.fm-proto .fm-home img,
body.fm-proto .fm-circle__img img,
body.fm-proto .fm-hero__slide img,
body.fm-proto .fm-promo3-card__media img,
body.fm-proto .fm-kolekcje__media img {
  max-width: 100%;
  display: block;
}

body.fm-proto .fm-hdr__logo,
body.fm-proto .fm-hdr-sticky .fm-hdr__logo {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.fm-proto .fm-hdr__logo::before,
body.fm-proto .fm-hdr__logo::after,
body.fm-proto .fm-hdr-sticky .fm-hdr__logo::before,
body.fm-proto .fm-hdr-sticky .fm-hdr__logo::after {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
body.fm-proto .fm-hdr__logo img {
  height: 29px !important;
  width: auto !important;
  max-width: 220px !important;
  background: transparent !important;
  border: 0 !important;
}
body.fm-proto .fm-hdr-sticky .fm-hdr__logo img {
  height: 24px !important;
  width: auto !important;
  max-width: 180px !important;
  background: transparent !important;
  border: 0 !important;
}
body.fm-proto .fm-hdr__logo img[src*="monogram"],
body.fm-proto .fm-hdr-sticky .fm-hdr__logo img[src*="monogram"] {
  display: none !important;
}
@media (max-width: 560px) {
  body.fm-proto .fm-hdr__logo img {
    height: 24px !important;
    max-width: 170px !important;
  }
  body.fm-proto .fm-hdr-sticky .fm-hdr__logo img {
    height: 22px !important;
    max-width: 150px !important;
  }
}

/* Cover surfaces must fill their boxes (do NOT force height:auto — grey letterbox) */
body.fm-proto .fm-ugc__card img,
body.fm-proto .fm-inspire__scene img,
body.fm-proto .fm-promo3-card__media img,
body.fm-proto .fm-circle__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product cards + PDP thumbs: full graphic (square OR landscape), never crop */
body.fm-proto .fm-pcard__media img,
body.fm-archive-page .fm-acat__media img,
body.fm-proto .fm-acat__media img,
body.fm-pdp-page .va-gallery__thumb img,
body.fm-pdp-page .va-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  background: #fff;
}

/* Lightbox / zoom stage — also contain so landscape aranż isn’t clipped */
body.fm-pdp-page .pswp__img,
body.fm-pdp-page .mfp-img,
body.fm-pdp-page .wd-image-container img {
  object-fit: contain !important;
}

/* Hero: full-bleed wall-to-wall (Agata) — bez max-width / letterbox contain */
body.fm-proto .fm-hero,
body.fm-proto .fm-hero__track {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
}
body.fm-proto .fm-hero__track {
  height: auto;
  max-height: none;
  aspect-ratio: 1920 / 450;
  overflow: hidden;
}
@media (max-width: 900px) {
  body.fm-proto .fm-hero__track {
    aspect-ratio: 5 / 4;
    min-height: 240px;
    max-height: min(70vh, 420px);
  }
}
@media (max-width: 520px) {
  body.fm-proto .fm-hero__track {
    aspect-ratio: 1 / 1;
    min-height: 280px;
    max-height: min(78vh, 460px);
  }
}
body.fm-proto .fm-hero__slide img {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center center;
}

body.fm-proto .fm-kolekcje__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

/* Prototype cards — keep 4-up rail sizing (do NOT force flex:auto — cuts 4th card) */
body.fm-proto .fm-rail:not(.fm-rail--compact) .fm-pcard {
  flex: 0 0 calc((100% - 48px) / 4);
  width: calc((100% - 48px) / 4);
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

body.fm-proto .fm-inspire__copy .fm-rail--compact .fm-pcard {
  flex: 0 0 calc((100% - 12px) / 2);
  width: calc((100% - 12px) / 2);
  max-width: none;
  min-width: 0;
}

@media (max-width: 900px) {
  body.fm-proto .fm-rail:not(.fm-rail--compact) .fm-pcard {
    flex: 0 0 calc((100% - 16px) / 2);
    width: calc((100% - 16px) / 2);
  }
}

@media (max-width: 560px) {
  body.fm-proto .fm-rail:not(.fm-rail--compact) .fm-pcard {
    flex: 0 0 78%;
    width: 78%;
  }
  body.fm-proto .fm-inspire__copy .fm-rail--compact .fm-pcard {
    flex: 0 0 85%;
    width: 85%;
  }
}

body.fm-proto .fm-circle__img {
  display: block;
  overflow: hidden;
  border-radius: 50%;
  aspect-ratio: 1;
}

body.fm-proto .fm-circle__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.fm-proto .fm-circles {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

body.fm-proto .fm-home,
body.fm-proto .fm-hdr,
body.fm-proto .fm-foot {
  font-family: var(--fm-font, 'DM Sans', system-ui, sans-serif);
}
body.fm-proto .fm-foot__copy {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #e5e5e5;
  font-size: 12px;
  color: #888;
}

/* Shop / category archive — kill WoodMart chrome */
body.fm-archive-page .whb-header,
body.fm-archive-page .wd-page-title,
body.fm-archive-page .page-title,
body.fm-archive-page .wd-breadcrumbs,
body.fm-archive-page .woocommerce-breadcrumb,
body.fm-archive-page .woodmart-woocommerce-breadcrumb,
body.fm-archive-page .wd-shop-tools,
body.fm-archive-page .shop-loop-head,
body.fm-archive-page .wd-products-shop-view,
body.fm-archive-page .wd-sidebar,
body.fm-archive-page .sidebar-container,
body.fm-archive-page .filters-area,
body.fm-archive-page .woodmart-sticky-toolbar,
body.fm-archive-page .wd-sticky-btn {
  display: none !important;
}

body.fm-archive-page .fm-cat {
  font-family: var(--fm-font, 'DM Sans', system-ui, sans-serif);
}

body.fm-archive-page .fm-cat a {
  text-decoration: none;
  color: inherit;
}

body.fm-archive-page .fm-cat__crumb a:hover,
body.fm-archive-page .fm-acat__brand a:hover {
  color: var(--fm-red, #d62828);
}

body.fm-archive-page .fm-cat-grid .fm-acat {
  width: 100%;
  float: none;
  list-style: none;
}

body.fm-archive-page .fm-cat-grid .fm-acat a {
  color: inherit;
}

body.fm-archive-page .fm-acat__media,
body.fm-archive-page .fm-acat__swatches {
  background: #fff;
}

body.fm-archive-page .woocommerce-result-count,
body.fm-archive-page .woocommerce-ordering,
body.fm-archive-page ul.products {
  display: none !important;
}

body.fm-archive-page .fm-cat__sort select:focus {
  outline: 2px solid var(--fm-red, #d62828);
  outline-offset: 2px;
}

body.fm-archive-page .fm-cat-filter__body input {
  accent-color: var(--fm-red, #d62828);
}
body.fm-archive-page .fm-cat-filter__search,
body.fm-archive-page .fm-cat-filter__search-input,
body.fm-archive-page .fm-cat-filters input[type="search"],
body.fm-archive-page .fm-cat-filters input[data-fm-brand-search],
body.fm-archive-page .fm-cat-filters input[data-fm-filter-search] {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Header / archive — single gutter lock (yellow line)
   Root cause of rozjazd: padding shorthand on .fm-cat / .fm-hdr__quickbar-inner
   wiped .fm-container padding-inline. Re-assert tokens here (loads last). */
body.fm-proto {
  --fm-page-max: 1440px;
  --fm-gutter: 24px;
}
@media (max-width: 900px) {
  body.fm-proto {
    --fm-gutter: 16px;
  }
  /* Contain horizontal peeks (rails/tabs/quickbar) bez psucia fixed overlays */
  body.fm-proto .fm-hdr,
  body.fm-proto main,
  body.fm-proto .fm-section,
  body.fm-proto .fm-cat,
  body.fm-proto .fm-porady,
  body.fm-proto .fm-auth {
    overflow-x: clip;
    max-width: 100vw;
  }
  body.fm-proto .fm-promo-tabs,
  body.fm-proto .fm-rail,
  body.fm-proto .fm-circles,
  body.fm-proto .fm-hdr__quickbar-inner,
  body.fm-proto .fm-hdr__search {
    max-width: 100%;
    min-width: 0;
  }
  body.fm-proto .fm-hdr-sticky .fm-hdr__search,
  body.fm-proto .fm-hdr-sticky .fm-hdr__search input {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
}
body.fm-proto .fm-container,
body.fm-archive-page .fm-container {
  max-width: var(--fm-page-max) !important;
  margin-inline: auto !important;
  padding-inline: var(--fm-gutter) !important;
  box-sizing: border-box !important;
}
/* Full-bleed bars: no extra horizontal padding on the bar itself */
body.fm-proto .fm-strip-promo,
body.fm-proto .fm-strip-util,
body.fm-proto .fm-hdr__quickbar,
body.fm-proto .fm-hdr__nav {
  padding-inline: 0 !important;
}
/* Inner rows that SHARE .fm-container must not reset inline padding */
body.fm-proto .fm-strip-promo__inner,
body.fm-proto .fm-strip-util__inner,
body.fm-proto .fm-hdr__quickbar-inner,
body.fm-proto .fm-hdr__nav-inner,
body.fm-archive-page main.fm-cat {
  /* keep gutter from .fm-container rule above */
  padding-left: var(--fm-gutter) !important;
  padding-right: var(--fm-gutter) !important;
}
body.fm-archive-page main.fm-cat {
  padding-top: 8px !important;
  padding-bottom: 48px !important;
}
/* Agata yellow-line: first/last nav link flush to content edge */
body.fm-proto .fm-hdr__nav-item:first-child .fm-hdr__nav-link {
  padding-left: 0 !important;
}
body.fm-proto .fm-hdr__nav-item:last-child .fm-hdr__nav-link {
  padding-right: 0 !important;
}
body.fm-proto .fm-hdr__quick-left > a:first-child,
body.fm-proto .fm-strip-util__left,
body.fm-proto .fm-hdr__logo {
  margin-left: 0 !important;
}
body.fm-proto .fm-hdr__tools,
body.fm-proto .fm-strip-util__right,
body.fm-proto .fm-hdr__quick-right {
  margin-right: 0 !important;
}

/* Archive ATC + rating + row rules (beat WoodMart product-loop CSS)
   Hairline = ::after in archive.css — do NOT re-add border-bottom here (stacked lines). */
body.fm-archive-page .fm-cat-grid .fm-acat.product,
body.fm-archive-page .fm-cat-grid .fm-acat {
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 0 28px !important;
  border: 0 !important;
  border-bottom: 0 !important;
  border-top: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
  position: relative !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  display: flex !important;
  flex-direction: column !important;
  height: auto !important;
  align-self: stretch !important;
}
body.fm-archive-page .fm-cat-grid .fm-acat::after {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  left: calc(var(--fm-acat-gap, 18px) / -2) !important;
  right: calc(var(--fm-acat-gap, 18px) / -2) !important;
  bottom: 0 !important;
  height: 1px !important;
  background: #e5e5e5 !important;
  pointer-events: none !important;
  box-shadow: none !important;
  border: 0 !important;
}
body.fm-archive-page .fm-cat-grid .fm-acat:nth-child(4n + 1)::after { left: 0 !important; }
body.fm-archive-page .fm-cat-grid .fm-acat:nth-child(4n)::after { right: 0 !important; }
body.fm-archive-page .fm-cat-grid > .fm-acat:nth-child(4n + 1):nth-last-child(-n + 4)::after,
body.fm-archive-page .fm-cat-grid > .fm-acat:nth-child(4n + 1):nth-last-child(-n + 4) ~ .fm-acat::after {
  content: none !important;
  display: none !important;
}
@media (max-width: 1100px) {
  body.fm-archive-page .fm-cat-grid .fm-acat:nth-child(4n + 1)::after,
  body.fm-archive-page .fm-cat-grid .fm-acat:nth-child(4n)::after {
    left: calc(var(--fm-acat-gap, 18px) / -2) !important;
    right: calc(var(--fm-acat-gap, 18px) / -2) !important;
  }
  body.fm-archive-page .fm-cat-grid .fm-acat:nth-child(3n + 1)::after { left: 0 !important; }
  body.fm-archive-page .fm-cat-grid .fm-acat:nth-child(3n)::after { right: 0 !important; }
  body.fm-archive-page .fm-cat-grid > .fm-acat:nth-child(4n + 1):nth-last-child(-n + 4)::after,
  body.fm-archive-page .fm-cat-grid > .fm-acat:nth-child(4n + 1):nth-last-child(-n + 4) ~ .fm-acat::after {
    content: '' !important;
    display: block !important;
  }
  body.fm-archive-page .fm-cat-grid > .fm-acat:nth-child(3n + 1):nth-last-child(-n + 3)::after,
  body.fm-archive-page .fm-cat-grid > .fm-acat:nth-child(3n + 1):nth-last-child(-n + 3) ~ .fm-acat::after {
    content: none !important;
    display: none !important;
  }
}
@media (max-width: 900px) {
  body.fm-archive-page .fm-cat-grid .fm-acat:nth-child(3n + 1)::after,
  body.fm-archive-page .fm-cat-grid .fm-acat:nth-child(3n)::after {
    left: calc(var(--fm-acat-gap, 12px) / -2) !important;
    right: calc(var(--fm-acat-gap, 12px) / -2) !important;
  }
  body.fm-archive-page .fm-cat-grid .fm-acat:nth-child(2n + 1)::after { left: 0 !important; }
  body.fm-archive-page .fm-cat-grid .fm-acat:nth-child(2n)::after { right: 0 !important; }
  body.fm-archive-page .fm-cat-grid > .fm-acat:nth-child(3n + 1):nth-last-child(-n + 3)::after,
  body.fm-archive-page .fm-cat-grid > .fm-acat:nth-child(3n + 1):nth-last-child(-n + 3) ~ .fm-acat::after {
    content: '' !important;
    display: block !important;
  }
  body.fm-archive-page .fm-cat-grid > .fm-acat:nth-child(2n + 1):nth-last-child(-n + 2)::after,
  body.fm-archive-page .fm-cat-grid > .fm-acat:nth-child(2n + 1):nth-last-child(-n + 2) ~ .fm-acat::after {
    content: none !important;
    display: none !important;
  }
}
body.fm-archive-page .fm-acat__desc {
  min-height: 1.35em !important;
  line-height: 1.35 !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  overflow: hidden !important;
}
body.fm-archive-page .fm-acat__rating {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  opacity: 1 !important;
  visibility: visible !important;
  margin: 0 !important;
  font-size: 12px !important;
  color: #666 !important;
}
body.fm-archive-page .fm-acat__rating-stars {
  color: #e6a800 !important;
  letter-spacing: 1px !important;
  font-size: 13px !important;
  line-height: 1 !important;
}
body.fm-archive-page .fm-acat__price {
  margin-top: auto !important;
  padding-top: 4px !important;
}
body.fm-archive-page .fm-acat__foot {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-top: 8px !important;
  opacity: 1 !important;
  visibility: visible !important;
}
body.fm-archive-page .fm-acat__atc,
body.fm-archive-page .fm-acat__atc.add_to_cart_button {
  display: grid !important;
  place-items: center !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 50% !important;
  border: 1.5px solid #1a1a1a !important;
  background: #fff !important;
  color: #1a1a1a !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: static !important;
  inset: auto !important;
  transform: none !important;
  float: none !important;
  text-indent: 0 !important;
  overflow: visible !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  text-decoration: none !important;
}
body.fm-archive-page .fm-acat__atc:before,
body.fm-archive-page .fm-acat__atc:after {
  content: none !important;
  display: none !important;
}
body.fm-archive-page .fm-acat__atc:hover {
  background: #d62828 !important;
  border-color: #d62828 !important;
  color: #fff !important;
}
body.fm-archive-page .fm-acat__atc svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
  fill: none !important;
  opacity: 1 !important;
}
body.fm-archive-page .fm-cat__sort select {
  appearance: none !important;
  -webkit-appearance: none !important;
  min-width: 188px !important;
  height: 40px !important;
  padding: 0 40px 0 14px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23333333' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 12px 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #1f2937 !important;
  cursor: pointer !important;
}
body.fm-archive-page .fm-cat__sort select:focus {
  outline: 2px solid var(--fm-red, #d62828);
  outline-offset: 2px;
}

/* PDP Variant A */
body.fm-pdp-page .fm-pdp { margin: 0 auto 48px; }
body.fm-pdp-page .fm-pdp-cart-form {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}
body.fm-pdp-page .va-gallery__thumb {
  display: block; width: 72px; padding: 0; border: 2px solid transparent;
  background: #fff; cursor: pointer; line-height: 0;
}
body.fm-pdp-page .va-gallery__thumb.is-active { border-color: var(--fm-red, #d62828); }
body.fm-pdp-page .va-gallery__thumb img {
  width: 100%; height: 72px; object-fit: cover; display: block;
}
body.fm-pdp-page .va-breadcrumb a { color: inherit; text-decoration: none; }
body.fm-pdp-page .fm-params-grid__row {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px;
  padding: 10px 20px; border-bottom: 1px solid #eee;
}
body.fm-pdp-page .fm-btn-atc:disabled { opacity: 0.5; cursor: not-allowed; }