/* 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: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__main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 16px 20px;
  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: 10px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(90, 102, 70, 0.1);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  color: #5a6652;
  z-index: 3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-card__save:hover,
.product-card__save:focus-visible {
  background: rgba(246, 248, 237, 0.95);
  border-color: rgba(90, 102, 70, 0.2);
  outline: none;
  transform: translateY(-1px);
}

.product-card__save--active {
  background: rgba(104, 114, 82, 0.95);
  border-color: rgba(90, 102, 70, 0.3);
  color: #ffffff;
}

.product-card__save.is-processing {
  opacity: 0.6;
  pointer-events: none;
  transform: none;
}

.product-card__save svg {
  width: 16px;
  height: 16px;
  fill: 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--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);
}

.product-card--catalog .product-card__main {
  padding: 20px 20px 24px;
  gap: 18px;
}

.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;
  }
}
