/*
 * Product card v3 — editorial commerce for collectible stone objects.
 * Inter is the only type family. The composition follows a gallery label:
 * image first, provenance second, transaction last.
 */
:root {
  --product-card-ground: #eee9de;
  --product-card-text: #24231f;
  --product-card-muted: #6f695e;
  --product-card-line: rgba(36, 35, 31, 0.18);
  --product-card-line-strong: rgba(36, 35, 31, 0.48);
  --product-card-cta: #1f4438;
  --product-card-bone: #f4f1ea;
}

/* The object, not a white container, is the visual focus. */
.esv-product-card,
.esv-collection-v2-grid > .esv-product-card,
.esv-product-shelf > .esv-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: visible;
  isolation: isolate;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--product-card-text);
  font-family: "Inter", sans-serif;
  cursor: pointer;
  transition: transform 240ms ease;
}

.esv-collection-v2-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(56px, 6vw, 88px) clamp(28px, 3.5vw, 56px);
}

/* The native 4:5 crop gives the photography the scale of an editorial plate. */
.esv-product-card .esv-product-media-wrap {
  position: relative;
  overflow: hidden;
  background: var(--product-card-ground);
}

.esv-product-card .esv-product-media {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5 !important;
  overflow: hidden;
  background: #e5dfd3;
}

.esv-product-card .esv-product-media::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, rgba(20, 20, 17, 0.09), transparent 22%);
  opacity: 0.55;
}

.esv-product-card .esv-product-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.001);
  transition: transform 900ms cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 520ms ease;
}

.esv-product-card .esv-product-image-detail {
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .esv-product-card:hover .esv-product-image-primary,
  .esv-product-card:hover .esv-product-image-static,
  .esv-product-card:has(:focus-visible) .esv-product-image-static {
    transform: scale(1.025);
  }

  .esv-product-card.has-detail:hover .esv-product-image-detail,
  .esv-product-card.has-detail:has(:focus-visible) .esv-product-image-detail {
    opacity: 1;
    transform: scale(1.025);
  }
}

.esv-product-card .esv-product-modal-trigger-media {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.esv-product-card .esv-product-modal-trigger-media:focus-visible {
  outline: 1px solid var(--product-card-text);
  outline-offset: 4px;
}

/* Only the commercial exception is shown; availability is otherwise silent. */
.esv-card-status {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  display: block;
  max-width: calc(100% - 76px);
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--product-card-muted);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

/* Comfortably tappable while visually quiet. */
.esv-card-wishlist {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 241, 234, 0.76);
  color: var(--product-card-text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  backdrop-filter: blur(10px);
  transition: opacity 220ms ease, background-color 220ms ease,
    color 220ms ease, transform 220ms ease;
}

.esv-product-card:hover .esv-card-wishlist,
.esv-product-card:has(:focus-visible) .esv-card-wishlist {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.esv-card-wishlist:hover {
  background: rgba(244, 241, 234, 0.96);
  transform: scale(1.04);
}

.esv-card-wishlist[data-favorited="true"] {
  color: var(--product-card-cta);
}

.esv-card-wishlist:focus-visible {
  outline: 1px solid var(--product-card-cta);
  outline-offset: 2px;
}

.esv-card-wishlist svg {
  width: 18px;
  height: 18px;
}

/* Compact hierarchy: material, name, facts/value, action. */
.esv-product-card-copy,
.esv-collection-v2-grid .esv-product-card-copy,
.esv-product-shelf .esv-product-card-copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 158px;
  padding: 15px 1px 0;
}

@media (hover: hover) and (pointer: fine) {
  .esv-product-card:hover,
  .esv-product-card:has(:focus-visible) {
    transform: translateY(-2px);
  }

  .esv-product-card:hover .esv-product-media-wrap,
  .esv-product-card:has(:focus-visible) .esv-product-media-wrap {
    box-shadow: 0 14px 30px rgba(36, 35, 31, 0.1);
  }
}

.esv-card-eyebrow {
  display: block;
  min-height: 1.5em;
  margin: 0 0 0.375rem;
  overflow: hidden;
  color: var(--product-card-muted);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.15em;
  line-height: 1.5;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.esv-card-title {
  display: -webkit-box;
  height: 2.34em;
  min-height: 2.34em;
  max-height: 2.34em;
  margin: 0;
  font-size: clamp(1.02rem, 0.93rem + 0.22vw, 1.16rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.17;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Large canvases retain image scale instead of shrinking the collection to four columns. */
@media (min-width: 1440px) {
  .esv-collection-v2-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .esv-collection-v2-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 56px clamp(20px, 3vw, 32px);
  }
}

@media (max-width: 639px) {
  .esv-collection-v2-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 58px;
  }
}

.esv-card-value-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 12px;
  min-height: 1.45em;
  margin-top: 12px;
}

.esv-card-price {
  flex: none;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.2;
  white-space: nowrap;
}

.esv-card-action-slot {
  position: relative;
  z-index: 4;
  margin-top: auto;
  padding-top: 12px;
  pointer-events: auto;
  transition: opacity 220ms ease, transform 280ms ease;
}

.esv-card-action-slot > .esv-card-cta,
.esv-card-action-slot > .esv-product-actions.is-compact {
  margin-top: 0;
}

/* Acquisition remains textual and only gains emphasis after intent. */
.esv-card-cta,
.esv-collection-v2-grid .esv-card-cta,
.esv-product-shelf .esv-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  margin-top: 0;
  padding: 0 1px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--product-card-muted);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 240ms ease;
}

.esv-card-cta svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.25;
  transition: transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.esv-card-cta:hover,
.esv-collection-v2-grid .esv-card-cta:hover,
.esv-product-shelf .esv-card-cta:hover {
  background: transparent;
  color: var(--product-card-cta);
}

.esv-card-cta:hover svg {
  transform: translateX(4px);
}

.esv-card-cta:focus-visible {
  outline: 1px solid var(--product-card-cta);
  outline-offset: 3px;
}

/* Inquiry and direct purchase share the same visual grammar. */
.esv-product-card .esv-product-actions.is-compact {
  margin-top: 0;
}

.esv-product-card .esv-product-actions.is-emphasized button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: var(--product-card-muted);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
}

.esv-product-card .esv-product-actions.is-emphasized svg {
  transition: transform 220ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .esv-card-action-slot {
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
  }

  .esv-product-card:hover .esv-card-action-slot,
  .esv-product-card:has(:focus-visible) .esv-card-action-slot {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .esv-product-card .esv-product-actions.is-emphasized button:hover {
    color: var(--product-card-cta);
  }

  .esv-product-card .esv-product-actions.is-emphasized button:hover svg {
    transform: translate3d(3px, -2px, 0);
  }
}

@media (max-width: 429px) {
  .esv-product-card-copy,
  .esv-collection-v2-grid .esv-product-card-copy,
  .esv-product-shelf .esv-product-card-copy {
    padding-top: 13px;
  }

  .esv-card-title {
    font-size: 1rem;
  }

  .esv-card-value-row {
    align-items: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .esv-product-card .esv-product-media img,
  .esv-card-wishlist,
  .esv-card-cta,
  .esv-card-cta svg,
  .esv-card-action-slot {
    transition: none;
  }

  .esv-product-card:hover .esv-product-image-primary,
  .esv-product-card:hover .esv-product-image-static,
  .esv-product-card.has-detail:hover .esv-product-image-detail,
  .esv-card-wishlist:hover,
  .esv-card-cta:hover svg,
  .esv-card-action-slot {
    transform: none;
  }

  .esv-product-card {
    transform: none;
    transition: none;
  }
}

/* Transaction feedback remains global because it is emitted by the card CTA. */
.esv-buy-flow {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  max-width: min(92vw, 420px);
  transform: translateX(-50%);
}

.esv-buy-flow-msg {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 18px;
  background: var(--product-card-text);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  color: var(--product-card-bone);
  font-size: 13.5px;
  letter-spacing: 0.01em;
  line-height: 1.45;
}

.esv-buy-flow-msg.is-success {
  background: var(--product-card-cta);
}

.esv-buy-flow-msg.is-sold {
  background: #6f2a22;
}

.esv-buy-flow-msg.is-error {
  background: #5a554e;
}

.esv-buy-flow-close {
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.esv-buy-flow-close:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 2px;
}
