/* ==========================================================================
   components.css — buttons, badges, product cards, forms, notices
   ========================================================================== */

/* ---------------- buttons ---------------- */
.fc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border: 2px solid transparent;
  border-radius: var(--fc-form-radius);
  background-color: var(--fc-primary);
  color: var(--fc-on-primary);
  font-family: var(--fc-font-header);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  text-align: center;
  transition: background-color var(--fc-transition), color var(--fc-transition),
              border-color var(--fc-transition), transform var(--fc-transition);
}
.fc-btn:hover {
  background-color: var(--fc-primary-hover);
  color: var(--fc-on-primary);
  transform: translateY(-1px);
}
.fc-btn:disabled,
.fc-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* the dark variant sets its own light type — .fc-btn's ink is for the orange plate */
.fc-btn-dark { background-color: var(--fc-dark-bg); color: var(--fc-on-dark); }
.fc-btn-dark:hover { background-color: var(--fc-primary); color: var(--fc-on-primary); }

.fc-btn-outline {
  background-color: transparent;
  border-color: currentColor;
  color: var(--fc-title);
}
.fc-btn-outline:hover {
  background-color: var(--fc-primary);
  border-color: var(--fc-primary);
  color: var(--fc-on-primary);
}

.fc-btn-light {
  background-color: var(--fc-white);
  color: var(--fc-title);
}
.fc-btn-light:hover { background-color: var(--fc-primary); color: var(--fc-on-primary); }

.fc-btn-block { width: 100%; }
.fc-btn-sm { padding: 9px 18px; font-size: 11px; }
.fc-btn-lg { padding: 15px 34px; font-size: 13px; }

/* text link with underline accent */
.fc-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 3px;
  border-bottom: 2px solid var(--fc-primary);
  font-family: var(--fc-font-header);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fc-title);
}
.fc-link-arrow:hover { color: var(--fc-primary-ink); }

/* ---------------- badges ---------------- */
.fc-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 3px;
  background-color: var(--fc-primary);
  color: var(--fc-on-primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* dark plate needs light type back — .fc-badge's ink is for the orange plate */
.fc-badge-dark { background-color: var(--fc-dark-bg); color: var(--fc-on-dark); }
/* Dark type on the green reads 5.35:1, where the white it used to inherit from
   the red-era .fc-badge managed only 3.45:1 — stated rather than inherited. */
.fc-badge-new { background-color: var(--fc-success); color: var(--fc-on-primary); }

.fc-count-bubble {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background-color: var(--fc-primary);
  color: var(--fc-on-primary);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

/* ---------------- icon button ---------------- */
.fc-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--fc-title);
  line-height: 1;
}
.fc-icon-btn:hover { color: var(--fc-primary-ink); }
.fc-icon-btn svg { width: 24px; height: 24px; flex: none; }

/* ---------------- product card ---------------- */
.fc-product {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--fc-white);
  text-align: center;
  transition: box-shadow var(--fc-transition);
}
.fc-product:hover { box-shadow: var(--fc-shadow-lg); z-index: 2; }

.fc-product-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background-color: var(--fc-alt-bg);
}
.fc-product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.fc-product:hover .fc-product-media img { transform: scale(1.06); }

.fc-product-labels {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* hover action rail — mirrors the theme "buttons on hover" option */
.fc-product-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity var(--fc-transition), transform var(--fc-transition);
}
.fc-product:hover .fc-product-actions,
.fc-product:focus-within .fc-product-actions {
  opacity: 1;
  transform: none;
}

.fc-product-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background-color: var(--fc-white);
  color: var(--fc-title);
  box-shadow: var(--fc-shadow);
}
.fc-product-action:hover,
.fc-product-action.is-active {
  background-color: var(--fc-primary);
  color: var(--fc-on-primary);
  /* inset so the ring costs no layout, and the base elevation is kept */
  box-shadow: inset 0 0 0 2px var(--fc-primary-ink), var(--fc-shadow);
}
.fc-product-action svg { width: 17px; height: 17px; }

.fc-product-body { padding: 16px 12px 20px; }

.fc-product-cat {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--fc-text-soft);
  text-transform: capitalize;
}

.fc-product-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}
.fc-product-title a { color: var(--fc-entities-title); }
.fc-product-title a:hover { color: var(--fc-primary-dark); }

.fc-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 600;
  color: var(--fc-title);
}
.fc-price del { color: var(--fc-text-soft); font-weight: 400; }

/* variant swatches on the card */
.fc-swatches {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.fc-swatch {
  padding: 3px 9px;
  border: 1px solid var(--fc-border-strong);
  border-radius: 3px;
  background: var(--fc-white);
  font-size: 11px;
  color: var(--fc-text);
  transition: border-color var(--fc-transition), color var(--fc-transition);
}
.fc-swatch:hover,
.fc-swatch.is-active {
  border-color: var(--fc-primary-ink);
  color: var(--fc-primary-ink);
}

.fc-product-cta { margin-top: 14px; }
.fc-product-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--fc-text-soft);
}

/* ---------------- category card ---------------- */
.fc-cat-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--fc-radius);
  background-color: var(--fc-alt-bg);
}
.fc-cat-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.7s ease;
}
.fc-cat-card:hover img { transform: scale(1.07); }

.fc-cat-card-label {
  position: absolute;
  inset-inline: 12px;
  bottom: 12px;
  padding: 11px 14px;
  border-radius: var(--fc-form-radius);
  background-color: var(--fc-glass);
  font-family: var(--fc-font-title);
  font-size: 14px;
  font-weight: 600;
  color: var(--fc-entities-title);
  text-align: center;
  text-transform: capitalize;
  transition: background-color var(--fc-transition), color var(--fc-transition);
}
.fc-cat-card:hover .fc-cat-card-label {
  background-color: var(--fc-primary);
  color: var(--fc-on-primary);
}

/* ---------------- forms ---------------- */
.fc-field { margin-bottom: 18px; }

.fc-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fc-title);
}
.fc-label .fc-req { color: var(--fc-primary-ink); }

.fc-input,
.fc-select,
.fc-textarea {
  width: 100%;
  min-height: var(--fc-form-height);
  padding: 10px 14px;
  border: var(--fc-form-brd-w) solid var(--fc-border-strong);
  border-radius: var(--fc-form-radius);
  background-color: var(--fc-white);
  color: var(--fc-text);
  transition: border-color var(--fc-transition);
}
/* Border tints on focus, but it cannot be the only cue: [aria-invalid] ties
   this on specificity and wins on source order, so a focused invalid field
   would keep its danger border and show nothing else. The :focus-visible ring
   from base.css is therefore left in place rather than cleared. */
.fc-input:focus,
.fc-select:focus,
.fc-textarea:focus {
  border-color: var(--fc-primary-ink);
}
.fc-textarea { min-height: 130px; resize: vertical; }
.fc-input[aria-invalid="true"],
.fc-select[aria-invalid="true"],
.fc-textarea[aria-invalid="true"] { border-color: var(--fc-danger); }

.fc-field-error {
  display: block;
  min-height: 1em;
  margin-top: 5px;
  font-size: 12px;
  color: var(--fc-danger);
}

.fc-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.fc-checkbox input {
  width: 16px;
  height: 16px;
  /* the box itself must clear 3:1 against the page, so ink not fill */
  accent-color: var(--fc-primary-ink);
}

/* ---------------- notices ---------------- */
.fc-notice {
  margin-bottom: 20px;
  padding: 13px 16px;
  border-left: 3px solid var(--fc-primary);
  border-radius: var(--fc-form-radius);
  background-color: var(--fc-alt-bg);
  font-size: 14px;
}
.fc-notice-success { border-left-color: var(--fc-success); }
.fc-notice-error { border-left-color: var(--fc-danger); }
.fc-notice[hidden] { display: none !important; }

/* ---------------- toast ---------------- */
.fc-toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.fc-toast {
  min-width: 230px;
  padding: 13px 18px;
  border-radius: var(--fc-form-radius);
  background-color: var(--fc-dark-bg);
  color: var(--fc-on-dark);
  font-size: 13px;
  box-shadow: var(--fc-shadow-lg);
  animation: fc-toast-in 0.28s ease;
}
@keyframes fc-toast-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- modal (quick view) ---------------- */
.fc-modal {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.fc-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: var(--fc-scrim);
}
.fc-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  border-radius: var(--fc-radius);
  background-color: var(--fc-white);
  box-shadow: var(--fc-shadow-lg);
  animation: fc-modal-in 0.24s ease;
}
@keyframes fc-modal-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.fc-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background-color: var(--fc-alt-bg);
  color: var(--fc-title);
}
.fc-modal-close:hover { background-color: var(--fc-primary); color: var(--fc-on-primary); }
.fc-modal-close svg { width: 18px; height: 18px; }

.fc-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.fc-modal-body h3 { margin: 4px 0 10px; font-size: 22px; }
.fc-modal-body .fc-price { justify-content: flex-start; margin-bottom: 12px; }
.fc-modal-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--fc-form-radius);
  background-color: var(--fc-alt-bg);
}

/* ---------------- reveal on scroll ---------------- */
[data-fc-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-fc-reveal].is-revealed { opacity: 1; transform: none; }

/* ---------------- misc ---------------- */
.fc-divider-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  font-size: 16px;
  font-weight: 600;
  color: var(--fc-title);
}
.fc-divider-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--fc-border);
}

.fc-empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--fc-text-soft);
}
.fc-empty-state svg {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  opacity: 0.35;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
