/* Appily Fiftythree — Field Specimen product UI */

.af-product {
  --afp-ink: var(--ts-ink, #15202B);
  --afp-paper: #fff;
  --afp-mist: var(--ts-paper, #F3F5F8);
  --afp-copper: var(--ts-wine, #B85C38);
  --afp-teal: var(--ts-grove, #2A6F7A);
  --afp-line: var(--ts-line, #CDD4DE);
  --afp-muted: var(--ts-muted, #5E6B7A);
  --afp-ease: var(--ease-out, cubic-bezier(.22, 1, .36, 1));
}

@keyframes afp-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes afp-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: .35; }
}
@keyframes afp-sheen {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
@keyframes afp-stamp {
  from { opacity: 0; transform: rotate(-8deg) scale(.85); }
  to { opacity: 1; transform: rotate(-8deg) scale(1); }
}
@keyframes afp-rail {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.afp-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #E8C4B4;
}
.afp-kicker-ink { color: var(--afp-copper); }
.afp-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7DCFB6;
  animation: afp-pulse 1.8s ease-out infinite;
}
.afp-lede {
  margin: 0;
  max-width: 46ch;
  color: rgba(244, 247, 250, .72);
  font-size: 15px;
  line-height: 1.65;
}
.af-product .afp-dossier .afp-lede {
  color: var(--afp-muted);
  margin-bottom: 22px;
}

/* ── Miss ── */
.afp-miss {
  position: relative;
  overflow: hidden;
  padding: 72px 0 96px;
  color: #F4F7FA;
  background: linear-gradient(135deg, #15202B 0%, #1B2430 45%, #1A4A52 100%);
  text-align: center;
}
.afp-miss-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 60% at 50% 0%, rgba(184, 92, 56, .3), transparent 60%),
    repeating-linear-gradient(-16deg, transparent 0 28px, rgba(255,255,255,.03) 28px 29px);
  pointer-events: none;
}
.afp-miss-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  animation: afp-rise .65s var(--afp-ease) both;
}
.afp-miss h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.afp-miss h1 em {
  font-style: italic;
  font-weight: 500;
  color: #F0D2C4;
}
.afp-miss .afp-lede {
  margin: 0 auto 28px;
  color: rgba(244, 247, 250, .7);
}

/* ── Stage ── */
.afp-stage {
  position: relative;
  overflow: hidden;
  padding: 28px 0 64px;
  background:
    linear-gradient(180deg, #E8EDF2 0%, var(--afp-mist) 38%, #F7F9FB 100%);
}
.afp-stage-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 45% 50% at 12% 18%, rgba(42, 111, 122, .12), transparent 55%),
    radial-gradient(ellipse 40% 45% at 88% 8%, rgba(184, 92, 56, .14), transparent 50%),
    repeating-linear-gradient(108deg, transparent 0 36px, rgba(21, 32, 43, .025) 36px 37px);
  pointer-events: none;
}

.afp-crumb {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
  font-size: 12px;
  color: var(--afp-muted);
  animation: afp-rise .5s var(--afp-ease) both;
}
.afp-crumb a:hover { color: var(--afp-copper); }
.afp-crumb span:last-child {
  color: var(--afp-ink);
  font-weight: 500;
  max-width: 28ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Specimen plate ── */
.afp-plate {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .95fr);
  gap: 0;
  align-items: stretch;
  background: var(--afp-paper);
  border: 1px solid var(--afp-line);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .7) inset,
    0 28px 60px -36px rgba(21, 32, 43, .35);
  animation: afp-rise .7s var(--afp-ease) both;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.afp-media {
  position: relative;
  background: linear-gradient(160deg, #1A2430 0%, #15202B 55%, #1A4A52 100%);
  min-height: 420px;
  display: grid;
  grid-template-rows: 1fr auto;
}
.afp-media-frame {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 36px 28px 20px;
}
.afp-media-frame::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  pointer-events: none;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}
.afp-media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,.08) 50%, transparent 60%);
  background-size: 220% 100%;
  animation: afp-sheen 4.5s ease-in-out infinite;
  pointer-events: none;
}
.afp-media-frame img {
  width: min(100%, 420px);
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  transform: rotate(-1.5deg);
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .55);
  transition: transform .55s var(--afp-ease);
}
.afp-media:hover .afp-media-frame img {
  transform: rotate(0deg) scale(1.03);
}
.afp-media-stamp {
  position: absolute;
  top: 34px;
  left: 34px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(232, 196, 180, .75);
  color: #E8C4B4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  border-radius: 50%;
  animation: afp-stamp .7s var(--afp-ease) .2s both;
}
.afp-media-badge {
  position: absolute;
  bottom: 28px;
  right: 28px;
  padding: 8px 12px;
  background: var(--afp-copper);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.afp-media-rail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  color: rgba(244, 247, 250, .55);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  animation: afp-rail .6s var(--afp-ease) .15s both;
}

/* ── Dossier ── */
.afp-dossier {
  padding: 40px 36px 36px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, #fff 0%, #FBFCFD 100%);
  border-left: 1px solid var(--afp-line);
}
.afp-dossier h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 2.85rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.03em;
  color: var(--afp-ink);
  max-width: 16ch;
}

.afp-traits {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--afp-line);
}
.afp-traits li {
  padding: 14px 14px 12px;
  display: grid;
  gap: 6px;
  border-right: 1px solid var(--afp-line);
  background:
    linear-gradient(180deg, rgba(42, 111, 122, .04), transparent 70%);
  transition: background .25s ease;
}
.afp-traits li:last-child { border-right: 0; }
.afp-traits li:hover {
  background: rgba(184, 92, 56, .06);
}
.afp-traits span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--afp-muted);
}
.afp-traits strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--afp-ink);
  word-break: break-word;
}

/* ── Buy dock ── */
.afp-dock {
  margin-top: auto;
  padding: 22px;
  background: linear-gradient(135deg, #15202B 0%, #1B2C36 55%, #1A4A52 100%);
  color: #F4F7FA;
  position: relative;
  overflow: hidden;
}
.afp-dock::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 0%, rgba(184, 92, 56, .35), transparent 45%),
    repeating-linear-gradient(-18deg, transparent 0 20px, rgba(255,255,255,.03) 20px 21px);
  pointer-events: none;
}
.afp-dock-price,
.afp-buy,
.afp-fine {
  position: relative;
  z-index: 1;
}
.afp-dock-price {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}
.afp-dock-label {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #E8C4B4;
}
.afp-dock-price strong {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
}

.afp-buy {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: end;
}
.afp-qty {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(244, 247, 250, .65);
}
.afp-stepper {
  display: inline-grid;
  grid-template-columns: 36px 52px 36px;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .06);
}
.afp-step {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}
.afp-step:hover { background: rgba(255, 255, 255, .1); }
.afp-stepper select {
  appearance: none;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .18);
  border-right: 1px solid rgba(255, 255, 255, .18);
  background: transparent;
  color: #fff;
  text-align: center;
  font: inherit;
  font-weight: 600;
  padding: 10px 4px;
  outline: none;
  cursor: pointer;
}
.afp-stepper select option { color: #15202B; }
.afp-add {
  min-height: 48px;
  width: 100%;
  justify-content: center;
  background: var(--afp-copper) !important;
  border-color: var(--afp-copper) !important;
  transition: transform .25s var(--afp-ease), filter .25s ease;
}
.afp-add:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.afp-fine {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(244, 247, 250, .55);
}

/* ── Neighbors ── */
.afp-neighbors {
  padding: 56px 0 72px;
  background: var(--afp-paper);
  border-top: 1px solid var(--afp-line);
}
.afp-neighbors-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 28px;
  animation: afp-rise .55s var(--afp-ease) both;
}
.afp-neighbors-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--afp-ink);
}
.afp-neighbors-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--afp-teal);
  white-space: nowrap;
}
.afp-neighbors-link:hover { color: var(--afp-copper); }

.afp-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 240px);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.afp-chip {
  scroll-snap-align: start;
  border: 1px solid var(--afp-line);
  background: var(--afp-mist);
  display: grid;
  grid-template-rows: auto 1fr;
  transition: transform .3s var(--afp-ease), border-color .25s ease, box-shadow .3s ease;
  animation: afp-rise .55s var(--afp-ease) both;
}
.afp-chip:nth-child(2) { animation-delay: .05s; }
.afp-chip:nth-child(3) { animation-delay: .1s; }
.afp-chip:nth-child(4) { animation-delay: .15s; }
.afp-chip:nth-child(5) { animation-delay: .2s; }
.afp-chip:nth-child(6) { animation-delay: .25s; }
.afp-chip:hover {
  transform: translateY(-4px);
  border-color: rgba(184, 92, 56, .45);
  box-shadow: 0 18px 36px -28px rgba(21, 32, 43, .45);
}
.afp-chip-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #1B2430;
}
.afp-chip-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--afp-ease);
}
.afp-chip:hover .afp-chip-media img { transform: scale(1.06); }
.afp-chip-media span {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 8px;
  background: rgba(21, 32, 43, .78);
  color: #fff;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.afp-chip-body {
  padding: 14px 14px 16px;
  display: grid;
  gap: 6px;
  align-content: start;
}
.afp-chip-sku {
  margin: 0;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--afp-muted);
}
.afp-chip-body h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.afp-chip-body h3 a { color: var(--afp-ink); }
.afp-chip-body h3 a:hover { color: var(--afp-copper); }
.afp-chip-body strong {
  margin-top: 4px;
  color: var(--afp-teal);
  font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 980px) {
  .afp-plate {
    grid-template-columns: 1fr;
    clip-path: none;
  }
  .afp-dossier { border-left: 0; border-top: 1px solid var(--afp-line); }
  .afp-media { min-height: 0; }
  .afp-media-frame { padding: 28px 22px 16px; }
  .afp-media-frame img { width: min(100%, 340px); }
}

@media (max-width: 640px) {
  .afp-stage { padding: 18px 0 40px; }
  .afp-dossier { padding: 28px 20px 24px; }
  .afp-traits { grid-template-columns: 1fr; }
  .afp-traits li {
    border-right: 0;
    border-bottom: 1px solid var(--afp-line);
  }
  .afp-traits li:last-child { border-bottom: 0; }
  .afp-buy { grid-template-columns: 1fr; }
  .afp-neighbors-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .afp-media-stamp {
    width: 52px;
    height: 52px;
    top: 24px;
    left: 24px;
    font-size: 10px;
  }
  .afp-media-rail {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .afp-media-frame::after,
  .afp-pulse,
  .afp-media-stamp,
  .afp-plate,
  .afp-chip,
  .afp-crumb,
  .afp-neighbors-head,
  .afp-miss-inner,
  .afp-media-rail {
    animation: none !important;
  }
  .afp-media:hover .afp-media-frame img,
  .afp-chip:hover {
    transform: none;
  }
}
