/* Foxtrot Mike — Variable-product configurator. */

/* ========== Configurator (Imagine mockup UI → WC variations) ========== */
.fm-configurator {
  width: 100%;
  max-width: 28rem;
}

.fm-configurator__panel {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-bottom: 1.25rem;
}

.fm-configurator__group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.fm-configurator__label {
  color: var(--fm-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* 1.12.68: option count after the label ("BARREL LENGTH · 3"), same font, muted. */
.fm-configurator__count {
  color: var(--fm-muted);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.fm-configurator__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fm-configurator__pill {
  flex: 1 1 auto;
  min-width: 4.5rem;
  margin: 0;
  padding: 0.55rem 0.75rem 0.5rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fm-text);
  background: var(--fm-surface);
  border: 1px solid var(--fm-border);
  border-radius: var(--fm-radius-sm);
  min-height: 44px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.fm-configurator__pill-label {
  line-height: 1.2;
}

.fm-configurator__pill-stock {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.1;
  color: var(--fm-muted);
}

.fm-configurator__pill:hover:not(:disabled):not(.is-unavailable),
.fm-configurator__pill.is-reselect:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--fm-text) 35%, var(--fm-border));
  background: var(--fm-surface-hover);
}

.fm-configurator__pill.is-selected,
.fm-configurator__pill.is-in-stock.is-selected {
  color: var(--fm-text);
  border-color: var(--fm-text);
  border-style: solid;
  background: var(--fm-surface-hover);
  box-shadow: none;
}

.fm-configurator__pill:focus-visible {
  outline: 2px solid var(--fm-accent);
  outline-offset: 2px;
}

/* In stock: no label, no color. Only "Out of stock" is ever shown on a chip. */

/* Out of stock: visible, muted, not selectable */
.fm-configurator__pill.is-sold-out {
  border-style: dashed;
  border-color: var(--fm-border);
  background: var(--fm-surface);
}

.fm-configurator__pill.is-sold-out:disabled,
.fm-configurator__pill.is-sold-out[aria-disabled='true'] {
  opacity: 1;
  cursor: not-allowed;
  pointer-events: none;
}

.fm-configurator__pill[hidden] {
  display: none !important;
}

.fm-configurator__group[hidden] {
  display: none !important;
}

.fm-configurator__pill.is-sold-out .fm-configurator__pill-label {
  color: var(--fm-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.fm-configurator__pill.is-sold-out .fm-configurator__pill-stock,
.fm-configurator__locked-pill.is-sold-out .fm-configurator__pill-stock {
  color: var(--fm-muted);
}

.fm-configurator__pill.is-sold-out.is-selected {
  border-style: solid;
  border-color: var(--fm-accent);
  box-shadow: none;
  background: var(--fm-surface-hover);
}

.fm-configurator__pill.is-sold-out.is-selected .fm-configurator__pill-label {
  color: var(--fm-text);
  text-decoration: none;
}

/*
 * Valid on another build path (e.g. 12.5" with Standard while Pic-Rail is selected).
 * Still a real choice — pairing hint on the stock line, not “N/A”.
 */
.fm-configurator__pill.is-reselect {
  opacity: 1;
  border-style: solid;
  border-color: var(--fm-border);
  cursor: pointer;
  pointer-events: auto;
  background: var(--fm-surface);
}

.fm-configurator__pill.is-reselect .fm-configurator__pill-label {
  color: var(--fm-text);
  text-decoration: none;
}

.fm-configurator__pill.is-reselect .fm-configurator__pill-stock,
.fm-configurator__pill-stock.is-pair {
  color: var(--fm-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

.fm-configurator__pill.is-reselect:hover {
  border-color: color-mix(in srgb, var(--fm-text) 35%, var(--fm-border));
  background: var(--fm-surface-hover);
}

/* Truly not offered on this product (no matching variations at all) */
.fm-configurator__pill.is-unavailable:not(.is-reselect),
.fm-configurator__pill.is-disabled,
.fm-configurator__pill:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  border-style: solid;
}

.fm-configurator__pill.is-unavailable:not(.is-reselect) {
  pointer-events: none;
}

.fm-configurator__pill.is-unavailable:not(.is-reselect) .fm-configurator__pill-stock {
  color: var(--fm-muted);
}

/* Single-option attribute (e.g. Buffer = RMB only) */
.fm-configurator__locked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.fm-configurator__group--locked .fm-configurator__locked {
  margin: 0;
}

.fm-configurator__group--locked .fm-configurator__locked-pill {
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  flex-direction: row;
  align-items: baseline;
  gap: 0.4rem;
}

.fm-configurator__group--locked .fm-configurator__pill-stock::before {
  content: "·";
  margin-right: 0.4rem;
}

.fm-configurator__locked-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.15rem;
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fm-text);
  background: color-mix(in srgb, var(--fm-accent) 18%, var(--fm-surface));
  border: 1px solid var(--fm-accent);
  border-radius: var(--fm-radius-sm);
}

.fm-configurator__locked-pill.is-sold-out {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--fm-accent) 55%, var(--fm-border));
  background: color-mix(in srgb, var(--fm-accent) 8%, var(--fm-surface));
}

.fm-configurator__locked-pill.is-sold-out .fm-configurator__pill-label {
  color: var(--fm-muted);
  text-decoration: line-through;
}

.fm-configurator__summary-stock.is-in .fm-configurator__summary-stock-val {
  color: var(--fm-success);
  font-weight: 600;
}

.fm-configurator__summary-stock.is-low .fm-configurator__summary-stock-val {
  color: var(--fm-accent);
  font-weight: 600;
}

.fm-configurator__summary-stock.is-out .fm-configurator__summary-stock-val {
  color: var(--fm-accent);
  font-weight: 600;
}

/* Specs summary (live) */
.fm-configurator__summary {
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--fm-border);
}

.fm-configurator__summary-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fm-text);
  margin-bottom: 0.5rem;
}

.fm-configurator__summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--fm-muted);
}

.fm-configurator__summary-list li strong {
  color: var(--fm-text);
  font-weight: 600;
  margin-right: 0.35rem;
}

.fm-configurator__summary-empty {
  font-style: normal;
  opacity: 0.85;
}

/* Native WC selects kept for variation.js — not shown */
.fm-configurator__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Hide WC's default "Clear" / any residual reset controls */
.fm-configurator__native .reset_variations,
.fm-configurator .reset_variations,
.fm-configurator__reset,
.fm-configurator__actions {
  display: none !important;
}

/* Variation price inside form — mockup keeps main price in summary */
.fm-pdp__cart .woocommerce-variation-price {
  display: none;
}

.fm-pdp__cart .woocommerce-variation-availability .stock.in-stock {
  color: var(--fm-success);
}

/* Custom stock pill only — hide WC stock lines in the cart box */
.fm-pdp__cart .stock {
  display: none !important;
}

/* Show variation availability after options selected (sr-only backup) */
.fm-pdp__cart .woocommerce-variation-availability .stock {
  display: none !important;
}

/* Full-width configurator ATC */
.fm-pdp__cart.fm-pdp__variations .single_add_to_cart_button {
  width: 100%;
  max-width: 28rem;
}

.fm-pdp__cart.fm-pdp__variations .quantity {
  align-self: stretch;
  margin-bottom: 0 !important;
}

/* Specs */
.fm-specs {
  width: 100%;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--fm-border);
}

.fm-specs__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fm-text);
  margin: 0 0 0.85rem;
  letter-spacing: -0.01em;
}

.fm-specs__list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.fm-specs__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.45rem;
  margin: 0;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--fm-border);
  font-size: 0.95rem;
  line-height: 1.45;
}

.fm-specs__label {
  color: var(--fm-text);
  font-weight: 700;
  margin: 0;
  flex: 0 0 auto;
}

.fm-specs__label::after {
  content: ":";
}

.fm-specs__value {
  color: var(--fm-muted);
  margin: 0;
  font-weight: 500;
  flex: 1 1 8rem;
}

.fm-pdp__description {
  width: 100%;
  margin-top: 1.5rem;
  color: var(--fm-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.fm-pdp__description p:last-child {
  margin-bottom: 0;
}

/* Notices on PDP — spacing only; look from global .fm-notice */
.fm-is-pdp .woocommerce-notices-wrapper {
  margin-bottom: 1.25rem;
}

@media (max-width: 899px) {
  .fm-pdp__title {
    max-width: none;
  }

  .fm-pdp__main {
    aspect-ratio: 1 / 1;
    max-height: none;
    padding: 0;
  }

  .fm-pdp__main-img,
  .fm-pdp__placeholder img {
    max-height: none;
  }

  .fm-pdp__cart {
    max-width: none;
  }
}


/* ---------- pdp-unavail (1.12.47): conflicting values stay listed ---------- */
.fm-configurator__group[data-fm-control='pills'] {
  position: relative;
}

/* Exists on another combination: muted + thin diagonal strike, still clickable */
.fm-configurator__pill.is-conflict {
  position: relative;
  overflow: hidden;
  color: var(--fm-muted);
  border-style: solid;
  border-color: var(--fm-border);
  background: var(--fm-surface);
  cursor: pointer;
}

.fm-configurator__pill.is-conflict .fm-configurator__pill-label {
  opacity: 0.6;
}

.fm-configurator__pill.is-conflict::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top right,
    transparent calc(50% - 0.5px),
    color-mix(in srgb, var(--fm-muted) 55%, transparent) calc(50% - 0.5px),
    color-mix(in srgb, var(--fm-muted) 55%, transparent) calc(50% + 0.5px),
    transparent calc(50% + 0.5px)
  );
}

.fm-configurator__pill.is-conflict:hover {
  border-color: color-mix(in srgb, var(--fm-text) 35%, var(--fm-border));
  background: var(--fm-surface-hover);
}

/* Auto-switch note: overlays the gap under the group, out of flow (no layout shift) */
.fm-configurator__switch-note {
  position: absolute;
  top: calc(100% + 0.15rem);
  left: 0;
  right: 0;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--fm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.fm-configurator__switch-note:empty {
  display: none;
}

/* ---------- config-dropdowns (1.12.49–1.12.50) ---------- */
.fm-configurator__group.has-fm-dd .fm-configurator__pills[hidden] { display: none !important; }
.fm-dd { position: relative; }
.fm-dd__button {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  width: 100%; min-height: 44px; margin: 0; padding: 0 1rem;
  background: var(--fm-surface); color: var(--fm-text);
  border: 1px solid var(--fm-border); border-radius: var(--fm-radius-sm);
  font: 600 1rem/1.2 var(--fm-font); text-align: left; cursor: pointer;
}
.fm-dd__button:hover { background: var(--fm-surface-hover); }
.fm-dd__button:focus-visible { outline: 2px solid var(--fm-text); outline-offset: 2px; }
.fm-dd.is-open .fm-dd__button { border-color: var(--fm-muted); }
.fm-dd__chev { flex: none; color: var(--fm-muted); transition: transform 0.15s; }
.fm-dd.is-open .fm-dd__chev { transform: rotate(180deg); }
.fm-dd__list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 0.25rem);
  max-height: 22rem; overflow-y: auto; padding: 0.25rem 0;
  background: var(--fm-bg-elevated); border: 1px solid var(--fm-border);
  border-radius: var(--fm-radius-sm); outline: none;
}
.fm-dd__list[hidden] { display: none; }
.fm-dd__section + .fm-dd__section { border-top: 1px solid var(--fm-border); margin-top: 0.25rem; padding-top: 0.25rem; }
.fm-dd__heading {
  padding: 0.5rem 1rem 0.25rem; color: var(--fm-muted);
  font: 600 0.75rem/1.2 var(--fm-font); text-transform: uppercase; letter-spacing: 0.06em;
}
.fm-dd__option {
  display: flex; flex-direction: column; justify-content: center; gap: 0.25rem;
  min-height: 44px; padding: 0.5rem 1rem; cursor: pointer; color: var(--fm-text);
  font: 400 1rem/1.2 var(--fm-font);
}
.fm-dd__option[aria-selected='true'] { font-weight: 600; box-shadow: inset 2px 0 0 var(--fm-text); }
.fm-dd__option.is-active, .fm-dd__option:hover { background: var(--fm-surface-hover); }
.fm-dd__option-note { color: var(--fm-muted); font-size: 0.75rem; }
.fm-dd__option[aria-disabled='true'] { cursor: not-allowed; color: var(--fm-muted); }
.fm-dd__option[aria-disabled='true']:hover { background: none; }
.fm-dd__section--oos .fm-dd__option-label { opacity: 0.6; }
.fm-dd__option { gap: 0; }

/*
 * 1.12.70: one choice = static row. Label, then the value in the label's type (caps, 12px, 600,
 * letter-spaced) in the text colour, on the same row. Used for one-value attributes (--locked) and
 * for dropdown groups that list a single choice under the current picks (.is-static, set in JS).
 */
.fm-configurator__group.is-static {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.fm-configurator__group.is-static .fm-dd,
.fm-dd[hidden],
.fm-configurator__static-value[hidden] {
  display: none !important;
}

.fm-configurator__group--locked .fm-configurator__locked {
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.fm-configurator__static-value,
.fm-configurator__group--locked .fm-configurator__locked-pill .fm-configurator__pill-label {
  color: var(--fm-text);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.fm-configurator__group--locked .fm-configurator__locked-pill {
  font-size: 0.75rem;
}
