/* Shared components — product cards, filters, forms */

.fm-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 20px;
}
.fm-product-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.fm-product-card__media {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--fm-radius);
  overflow: hidden;
  background: var(--fm-gray-100);
}
.fm-product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.fm-product-card:hover .fm-product-card__media img {
  transform: scale(1.04);
}
.fm-product-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--fm-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.fm-product-card__wish {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--fm-shadow-sm);
  color: var(--fm-gray-600);
}
.fm-product-card__wish:hover { color: var(--fm-red); }
.fm-product-card__wish svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}
.fm-product-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fm-product-card__title:hover { color: var(--fm-red); }
.fm-product-card__meta {
  margin: 0;
  font-size: 12px;
  color: var(--fm-gray-600);
}
.fm-product-card__price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.fm-product-card__price-current {
  font-size: 16px;
  font-weight: 700;
  color: var(--fm-red);
}
.fm-product-card__price-old {
  font-size: 13px;
  color: var(--fm-gray-400);
  text-decoration: line-through;
}

.fm-cat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.fm-cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px;
  border-radius: var(--fm-radius);
  background: var(--fm-gray-100);
  text-align: center;
  transition: background .15s, transform .15s;
}
.fm-cat-tile:hover {
  background: var(--fm-red-soft);
  transform: translateY(-2px);
}
.fm-cat-tile__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.fm-brand-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.fm-brand-chip {
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 12px;
  border: 1px solid var(--fm-gray-200);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s, color .15s;
}
.fm-brand-chip:hover {
  border-color: var(--fm-red);
  color: var(--fm-red);
}

.fm-archive {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  padding: 8px 0 64px;
}
.fm-filters {
  padding: 20px;
  border: 1px solid var(--fm-gray-200);
  border-radius: var(--fm-radius);
  background: #fff;
  height: fit-content;
  position: sticky;
  top: 120px;
}
.fm-filters__title {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 700;
}
.fm-filters__group + .fm-filters__group {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--fm-gray-200);
}
.fm-filters__group h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fm-gray-600);
}
.fm-filters__group label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  cursor: pointer;
}
.fm-filters__group input { accent-color: var(--fm-red); }

.fm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--fm-gray-200);
}
.fm-toolbar__count {
  font-size: 13px;
  color: var(--fm-gray-600);
}
.fm-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fm-toolbar select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--fm-gray-200);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
}

.fm-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
}
.fm-pagination a,
.fm-pagination span {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--fm-gray-200);
}
.fm-pagination a:hover,
.fm-pagination .is-active {
  background: var(--fm-red);
  border-color: var(--fm-red);
  color: #fff;
}

.fm-form {
  display: grid;
  gap: 14px;
  max-width: 420px;
}
.fm-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.fm-form input,
.fm-form textarea,
.fm-form select {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--fm-gray-200);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
}
.fm-form textarea {
  height: auto;
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}
.fm-form input:focus,
.fm-form textarea:focus {
  outline: none;
  border-color: var(--fm-red);
  box-shadow: 0 0 0 3px rgba(214, 40, 40, .08);
}

.fm-page-hero {
  padding: 40px 0 24px;
}
.fm-page-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.fm-page-hero p {
  margin: 0;
  max-width: 560px;
  font-size: 16px;
  color: var(--fm-gray-600);
}

.fm-content {
  max-width: 720px;
  padding-bottom: 64px;
}
.fm-content h2 {
  margin: 32px 0 12px;
  font-size: 22px;
}
.fm-content p { color: var(--fm-gray-600); }
.fm-content ul { color: var(--fm-gray-600); padding-left: 1.2em; }

.fm-account-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  padding-bottom: 64px;
}
.fm-account-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--fm-gray-200);
  border-radius: var(--fm-radius);
  height: fit-content;
}
.fm-account-nav a {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}
.fm-account-nav a.is-active,
.fm-account-nav a:hover {
  background: var(--fm-red-soft);
  color: var(--fm-red);
}

@media (max-width: 1100px) {
  .fm-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fm-cat-grid,
  .fm-brand-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .fm-archive,
  .fm-account-layout { grid-template-columns: 1fr; }
  .fm-filters { position: static; }
  .fm-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .fm-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* FM Content page banners (sklep / nowości / pdp / konto) */
.fm-page-banners {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 20px;
  width: 100%;
}
.fm-page-banners__item {
  display: block;
  line-height: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #eee;
}
.fm-page-banners__item img {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  display: block;
}
.fm-page-banners__item img.fm-img--mirror {
  transform: scaleX(-1);
}
.fm-img--mirror {
  transform: scaleX(-1);
}

/* FM Content page banners (shop / nowości / PDP / konto) */
.fm-page-banners {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 20px;
}
.fm-page-banners__item {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}
.fm-page-banners__item img {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  display: block;
}
.fm-page-banners__item img.fm-img--mirror,
img.fm-img--mirror {
  transform: scaleX(-1);
}
.fm-circle__img img.fm-img--mirror {
  transform: scaleX(-1);
}
