﻿/* Mini-cart + header drops + ATC modal — home/archive (full cart.css only on koszyk/checkout) */
/* Cart â€” dropdowns, ATC modal, koszyk, checkout */

.fm-label {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.fm-label--red { background: var(--fm-red); }
.fm-label--gray { background: #6b7280; }
.fm-label--black { background: #111111; }
.fm-label--payu {
  background: #a6c307;
  color: #fff;
}
.fm-label--ship {
  background: var(--fm-red);
  letter-spacing: 0.01em;
}

.fm-hdr__tool-wrap {
  position: relative;
  z-index: 1;
}
.fm-hdr__tool-wrap.is-open {
  z-index: 55;
}
.fm-hdr__tool-wrap.is-open > .fm-hdr__tool { color: var(--fm-red); }
.fm-hdr__tool[data-cart-tool].is-active { color: var(--fm-red); }
.fm-hdr__tool-wrap::after {
  content: '';
  position: absolute;
  left: -8px;
  right: -8px;
  top: 100%;
  height: 14px;
  display: none;
}
.fm-hdr__tool-wrap.is-open::after { display: block; }

.fm-drop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1300;
  min-width: 260px;
  padding: 22px 20px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  text-align: center;
  pointer-events: auto;
}
.fm-drop--login { min-width: 240px; }
.fm-drop--cart {
  min-width: 320px;
  width: min(360px, calc(100vw - 24px));
  max-width: min(360px, calc(100vw - 24px));
  max-height: min(calc(100vh - 96px), 640px);
  overflow: hidden;
  text-align: left;
  padding: 16px 16px 14px;
}
.fm-drop[hidden] { display: none !important; }

.fm-drop__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.fm-drop__btn--primary {
  background: var(--fm-red, #d62828) !important;
  color: #fff !important;
  border-color: var(--fm-red, #d62828) !important;
}
.fm-drop__btn--primary:hover,
.fm-drop__btn--primary:focus,
.fm-drop__btn--primary:active {
  background: var(--fm-red-dark, #b01f1f) !important;
  color: #fff !important;
  border-color: var(--fm-red-dark, #b01f1f) !important;
}
.fm-drop__btn--ghost {
  background: #fff !important;
  color: var(--fm-gray-900, #1a1a1a) !important;
  border-color: #111 !important;
}
.fm-drop__btn--ghost:hover,
.fm-drop__btn--ghost:focus {
  border-color: var(--fm-red, #d62828) !important;
  color: var(--fm-red, #d62828) !important;
  background: #fff !important;
}
.fm-drop__hint {
  margin: 14px 0 4px;
  font-size: 13px;
  color: var(--fm-gray-900);
}
.fm-drop__link {
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.fm-drop__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}
.fm-drop__sub {
  margin: 0 0 16px;
  font-size: 13px;
  text-align: center;
  color: var(--fm-gray-600);
}

/* Mini-cart â€” Agata-like: â‰¤4 rows, 2-line titles, no list scrollbar */
.fm-minicart__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  max-height: none;
  overflow: visible;
}
.fm-minicart__title {
  text-align: left !important;
  margin: 0 0 4px !important;
  font-size: 16px;
}
.fm-minicart__row {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 28px 12px 0;
  border-bottom: 1px solid #eee;
  color: #1a1a1a;
}
.fm-minicart__row:last-child { border-bottom: 0; }
.fm-minicart__thumb {
  display: block;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  text-decoration: none;
  overflow: hidden;
  position: relative;
  background: #fff;
  border-radius: 2px;
}
.fm-minicart__thumb img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  object-position: center;
  background: #fff;
  border-radius: 2px;
}
.fm-minicart__thumb img:not(:first-of-type),
.fm-minicart__thumb .hover-img {
  display: none !important;
}
.fm-minicart__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}
.fm-minicart__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: #1a1a1a !important;
  text-decoration: none !important;
}
.fm-minicart__name:hover {
  color: var(--fm-red, #d62828) !important;
}
.fm-minicart__row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fm-minicart__qty {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  line-height: 1.2;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.fm-minicart__qty--text {
  font-style: normal;
}
.fm-minicart__qty-btn {
  display: none !important;
}
/* Hide legacy qty inputs if fragment cache still serves them. */
.fm-minicart__qty input.fm-minicart__qty-input,
.fm-drop--cart input.fm-minicart__qty-input {
  display: none !important;
}
.fm-minicart__qty-unit {
  display: none !important;
}
.fm-minicart__price {
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  color: #1a1a1a;
}
.fm-minicart__price .amount,
.fm-minicart__price .woocommerce-Price-amount {
  color: inherit;
}
.fm-minicart__remove {
  position: absolute;
  top: 10px;
  right: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 4px;
}
.fm-minicart__remove:hover {
  color: var(--fm-red, #d62828);
}
.fm-minicart__remove svg {
  display: block;
}
.fm-minicart__more {
  display: block;
  margin: 4px 0 10px;
  padding: 4px 0;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
}
.fm-minicart__more span {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.fm-minicart__more:hover,
.fm-minicart__more:hover span {
  color: var(--fm-red, #d62828);
}
.fm-minicart__sum {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  margin: 0 -16px 12px;
  background: #f3f3f3;
  font-size: 14px;
  color: #1a1a1a;
}
.fm-minicart__sum strong {
  font-size: 16px;
  color: #1a1a1a;
}
.fm-drop--cart.is-busy {
  pointer-events: none;
  opacity: .72;
}

body.is-atc-open { overflow: hidden; }
.fm-atc {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 24px;
}
.fm-atc__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}
.fm-atc__panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 28px 28px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.fm-atc__x {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #333;
}
.fm-atc__top {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: center;
  padding-right: 40px;
}
.fm-atc__thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #f5f5f5;
  border-radius: 6px;
}
.fm-atc__ok {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fm-atc__ok span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
}
.fm-atc__name {
  margin: 0;
  font-size: 14px;
  color: #444;
}
.fm-atc__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 22px 0 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--fm-gray-200);
}
.fm-atc__reco h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
}
.fm-atc__rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.fm-atc-card { min-width: 0; font-size: 13px; }
.fm-atc-card__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 20px;
  margin-bottom: 6px;
}
.fm-atc-card__media {
  display: block;
  aspect-ratio: 1;
  background: #f5f5f5;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.fm-atc-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.fm-atc-card h3 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}
.fm-atc-card p {
  margin: 2px 0 6px;
  color: #555;
  font-size: 12px;
}
.fm-atc-card__price {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.fm-atc-card__price strong { font-size: 16px; }
.fm-atc-card__price s {
  font-size: 11px;
  color: #999;
  margin-right: auto;
}
.fm-atc-card__add {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #ccc;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fm-atc-card__add svg {
  width: 16px;
  height: 16px;
  stroke: #333;
  fill: none;
  stroke-width: 1.6;
}
.fm-atc-card__add.is-done {
  border-color: #16a34a;
  background: #16a34a;
}
.fm-atc-card__add.is-done svg { stroke: #fff; }
.fm-atc__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}
.fm-atc__dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ddd;
  display: block;
}
.fm-atc__dots i.is-on { background: #111; }

