/* Product card styling extracted from catalog/_product_tile.html for reuse */
.product-card-wrapper {
  height: 100%;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  --product-card-site-height: 40px;
  --product-card-main-padding-top: 2px;
  --product-card-main-padding-bottom: 20px;
  --product-card-main-horizontal-padding: 16px;
}

/* Site-specific header background colors */
.product-card[data-site="oorlogsspullen"] .product-card__site {
  background: #fff3f0; /* Light orange */
  color: #bf4f29;
}

.product-card[data-site="wwii-german-helmets.com"] .product-card__site {
  background: #f0f4f8; /* Light blue */
  color: #1e3a66;
}

.product-card[data-site="the war front"] .product-card__site {
  background: #f5f2f0; /* Light brown */
  color: #5d3c26;
}

.product-card[data-site="international-military-antiques"] .product-card__site {
  background: #f1f8f2; /* Light green */
  color: #1e4d21;
}

.product-card[data-site="lakesidetrader"] .product-card__site {
  background: #f8f1fb; /* Light purple */
  color: #4a0e5c;
}

.product-card[data-site="epic-militaria"] .product-card__site {
  background: #fdf2f2; /* Light red */
  color: #8a1c1c;
}

.product-card[data-site="warrelics"] .product-card__site {
  background: #fff8f0; /* Light amber */
  color: #a04700;
}

.product-card[data-site="germandaggers"] .product-card__site {
  background: #f0f6ff; /* Light blue */
  color: #0f4c8c;
}

.product-card[data-site="legacy-collectibles"] .product-card__site {
  background: #f2f8f3; /* Light teal */
  color: #255a28;
}

.product-card[data-site="manion's international auction house"] .product-card__site {
  background: #f4f2f1; /* Light dark brown */
  color: #3e2a1f;
}

.product-card[data-site="antik"] .product-card__site {
  background: #fdf2f2; /* Light deep red */
  color: #8f2020;
}

.product-card[data-site="hiscoll"] .product-card__site {
  background: #f2f3f9; /* Light indigo */
  color: #1f2766;
}

.product-card[data-site="dead spartan"] .product-card__site {
  background: #f5f5f5; /* Light gray */
  color: #2e2e2e;
}

.product-card[data-site="chase"] .product-card__site {
  background: #f0f8f7; /* Light teal */
  color: #004d47;
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.product-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.product-card__link:focus-visible {
  outline: 3px solid rgba(104, 114, 82, 0.25);
  outline-offset: 4px;
}

.product-card__site {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  background: #f3efe6;
  color: #5b594d;
  font-size: var(--text-meta);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(140, 133, 102, 0.2);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  width: 100%;
  flex-shrink: 0;
  align-self: stretch;
  position: relative;
  z-index: 1;
  text-decoration: none;
  color: inherit;
}

.product-card__site-link {
  cursor: pointer;
}

.product-card__site-link:hover,
.product-card__site-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.product-card__site-fallback {
  display: inline;
}

/* Reset site header for top-left logo positioning */
.product-card__site {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 8px 16px;
  background: #f3efe6;
  color: #5b594d;
  font-size: var(--text-meta);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(140, 133, 102, 0.2);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  width: 100%;
  flex-shrink: 0;
  align-self: stretch;
  position: relative;
  z-index: 1;
  text-decoration: none;
  color: inherit;
}

/* Reset main content padding for normal positioning */
.product-card__main {
  display: flex;
  flex-direction: column;
  gap: 3px; /* Reduced from 16px by 80% */
  padding: var(--product-card-main-padding-top) var(--product-card-main-horizontal-padding)
    var(--product-card-main-padding-bottom) var(--product-card-main-horizontal-padding);
  min-height: 0;
  flex: 1;
}

.product-card__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f4f2ed;
  border: 1px solid #e6e3d7;
  padding: 6px;
  box-sizing: border-box;
}

.product-card__image,
.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.25s ease;
  display: block;
}

.product-card:hover .product-card__image,
.product-card:hover .product-card__img {
  transform: scale(1.02);
}

.product-card__placeholder {
  position: absolute;
  inset: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: #a89968;
  background: linear-gradient(135deg, #f5f1e8 0%, #e8dfc4 100%);
  font-size: 12px;
  border-radius: 8px;
}

.product-card__save {
  position: absolute;
  top: calc(var(--product-card-site-height) + var(--product-card-main-padding-top) + 8px);
  right: calc(var(--product-card-main-horizontal-padding) + 8px);
  width: auto;
  height: auto;
  border: none;
  background: none;
  background-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: none;
  border-radius: 0;
  transition: color 0.2s ease;
  color: #111111;
  z-index: 3;
}

.product-card__save:hover,
.product-card__save:focus-visible {
  outline: none;
}

.product-card__save--active {
  color: #111111;
}

.product-card__save.is-processing {
  opacity: 0.55;
  pointer-events: none;
}

.product-card__save svg {
  width: 18px;
  height: 18px;
  display: block;
}

.product-card__save svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.product-card__save--active svg path {
  fill: currentColor;
  stroke: currentColor;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
}

.product-card__title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(2 * 1.35em);
}

.product-card__pricing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  container-type: inline-size;
  margin-top: auto;
}

.product-card__price {
  font-size: var(--text-title);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: 1.1;
  flex-shrink: 1;
  min-width: 0;
  text-align: center;
}

@supports (font-size: clamp(1rem, 10cqi, 1.5rem)) {
  .product-card__price {
    font-size: clamp(1rem, 10cqi, var(--text-title));
  }
}

.product-card__price--missing {
  color: var(--color-text-secondary);
}

.product-card__price-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.product-card__meta {
  margin-top: 8px;
  text-align: center;
}

.product-card .price-converted {
  font-size: calc(var(--text-meta) * 0.95);
  color: var(--color-text-tertiary, #6b7280);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  opacity: 0.95;
  text-overflow: ellipsis;
  justify-content: center;
}

.product-card .price-converted::before {
  content: "≈";
  opacity: 0.65;
  font-size: 0.85em;
}

.product-card:hover .price-converted,
.product-card:focus-within .price-converted {
  opacity: 0.9;
}

.product-card__status {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  color: #ffffff;
  font-size: var(--text-meta);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  flex-shrink: 0;
  width: 100%;
  align-self: stretch;
}

.product-card__status--available {
  background: #6f7c4a;
}

.product-card__status--sold {
  background: #8a4f45;
}

.product-card--catalog {
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(34, 30, 20, 0.1);
  padding: 0;
  gap: 0;
  overflow: hidden;
  --product-card-site-height: 52px;
  --product-card-main-padding-top: 14px;
  --product-card-main-padding-bottom: 22px;
  --product-card-main-horizontal-padding: 20px;
}

.product-card--catalog:hover,
.product-card--catalog:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 20px 32px rgba(34, 30, 20, 0.16);
}

.product-card--catalog .product-card__link {
  align-items: stretch;
  padding: 0;
}

.product-card--catalog .product-card__site {
  background: linear-gradient(135deg, #f4efe4 0%, #ece3d0 100%);
  color: #4e4a3f;
  letter-spacing: 0.05em;
  text-transform: none;
  border-bottom: 1px solid rgba(152, 139, 108, 0.25);
  padding: 12px 20px;
  border-radius: 18px 18px 0 0;
  font-size: calc(var(--text-meta, 0.75rem) * 1.05);
}

/* Catalog variant logo styles - overlapping profile style */
.product-card--catalog .product-card__site-logo {
  position: absolute;
  top: 20px; /* Position at the border for catalog variant */
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 48px;
  object-fit: contain;
  object-position: center;
  background: #ffffff;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
  z-index: 10;
  padding: 6px;
  box-sizing: border-box;
}

/* Hide catalog site text when logo is present */
.product-card--catalog .product-card__site--with-logo {
  color: transparent;
  min-height: 24px;
}


.product-card--catalog .product-card__main {
  gap: 16px;
}

.product-card--catalog:has(.product-card__site--with-logo) {
  --product-card-main-padding-top: 40px;
}

.product-card--catalog .product-card__media {
  border-radius: 14px;
  background: #f9f6ef;
}

.product-card--catalog .product-card__body {
  gap: 14px;
}

.product-card--catalog .product-card__title {
  font-weight: var(--font-weight-semibold);
}

body[data-page="catalog"] .product-card--catalog .product-card__pricing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  flex-wrap: nowrap;
}

body[data-page="catalog"] .product-card--catalog .product-card__price {
  font-size: var(--text-title, 1.35rem);
  flex-shrink: 1;
  min-width: 0;
  text-align: center;
}

@supports (font-size: clamp(1rem, 10cqi, 1.5rem)) {
  body[data-page="catalog"] .product-card--catalog .product-card__price {
    font-size: clamp(1.05rem, 10cqi, var(--text-title, 1.35rem));
  }
}

body[data-page="catalog"] .product-card--catalog .price-converted {
  display: inline-flex;
  align-items: center;
  font-size: calc(var(--text-meta) * 0.95);
  opacity: 0.75;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
  justify-content: center;
}

body[data-page="catalog"] .product-card--catalog .price-converted::before {
  content: "\00a0≈\00a0";
  opacity: 0.85;
}

body[data-page="catalog"] .product-card--catalog:hover .price-converted,
body[data-page="catalog"] .product-card--catalog:focus-within .price-converted {
  opacity: 0.98;
}

body[data-page="catalog"] .product-card--catalog .product-card__meta {
  font-size: calc(var(--text-meta) * 0.95);
  color: #6c6657;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

body[data-page="catalog"] .product-card--catalog .product-card__meta--added::before {
  content: "•";
  font-size: 0.9em;
  opacity: 0.6;
}

body[data-page="catalog"] .product-card--catalog .product-card__status {
  margin-top: auto;
  border-radius: 0 0 18px 18px;
  min-height: 36px;
  padding: 0 20px;
  letter-spacing: 0.14em;
  font-size: var(--text-meta);
  background: #6b7b34;
}

body[data-page="catalog"] .product-card--catalog .product-card__status--available {
  background: #6b7b34;
}

body[data-page="catalog"] .product-card--catalog .product-card__status--sold {
  background: #a3473c;
}

/* Cluster header styling for new products view */
.cluster-header {
  background: #ffffff;
  border-radius: 14px;
  padding: 10px 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(212, 205, 188, 0.55);
  box-shadow: 0 14px 26px -20px rgba(36, 46, 22, 0.55);
  animation: fade-in-cluster 0.06s ease-out;
  position: relative;
}

.cluster-header__content,
.cluster-header__fallback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cluster-header__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.cluster-header__link:focus-visible {
  outline: 3px solid rgba(75, 98, 47, 0.35);
  outline-offset: 4px;
  border-radius: 16px;
}

.cluster-header__link:hover .cluster-header__name,
.cluster-header__link:focus-visible .cluster-header__name {
  text-decoration: underline;
}

.cluster-header__left {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.cluster-header__logo {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.cluster-header__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 1;
  filter: saturate(1.06) contrast(1.03);
}

.cluster-header__logo-initial {
  display: none;
  width: 80px;
  height: 80px;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  background: #eef5eb;
  color: #3f5c2d;
  font-size: 1.2rem;
  border-radius: inherit;
}

.cluster-header__logo--fallback {
  display: flex;
  width: 80px;
  height: 80px;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  background: #eef5eb;
  color: #3f5c2d;
  font-size: 1.2rem;
}

.cluster-header__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cluster-header__name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #141a0f;
  line-height: 1.12;
}

.cluster-header__name a {
  color: #141a0f;
  text-decoration: none;
  font-weight: 700;
}

.cluster-header__name a:hover,
.cluster-header__name a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.cluster-header__location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #6d7565;
  font-size: 0.86rem;
}

.cluster-header__flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cluster-header__right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4f5a46;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.cluster-header__updated {
  background: rgba(238, 245, 235, 0.72);
  border: 1px solid rgba(75, 98, 47, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cluster-header__fallback {
  padding: 0;
}

.cluster-header__fallback .cluster-header__name {
  font-size: 1.35rem;
}

.cluster-header::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -8px;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 205, 188, 0.1), rgba(87, 97, 75, 0.28), rgba(212, 205, 188, 0.1));
  pointer-events: none;
}

@media (max-width: 720px) {
  .cluster-header {
    padding: 12px 16px;
  }

  .cluster-header__content,
  .cluster-header__fallback {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .cluster-header__right {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .cluster-header__left {
    gap: 12px;
  }

  .cluster-header__logo,
  .cluster-header__logo-initial,
  .cluster-header__logo--fallback {
    width: 68px;
    height: 68px;
  }

  .cluster-header__name {
    font-size: 1.35rem;
  }
}

@media (max-width: 600px) {
  .product-card {
    border-radius: 14px;
  }

  .product-card__site {
    border-radius: 14px 14px 0 0;
  }

  .product-card__status {
    border-radius: 0 0 14px 14px;
  }
}

@media (max-width: 480px) {
  .product-card__title {
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }
}

@media (max-width: 768px) {
  body[data-page="catalog"] .product-card--catalog .product-card__title {
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }
}

@media (max-width: 600px) {
  body[data-page="catalog"] .product-card--catalog {
    border-radius: 16px;
  }

  body[data-page="catalog"] .product-card--catalog .product-card__site {
    border-radius: 16px 16px 0 0;
  }

  body[data-page="catalog"] .product-card--catalog .product-card__status {
    border-radius: 0 0 16px 16px;
  }
}
