/* shop_design §5.1 — product card */
.product {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  height: 100%;
  animation: product-fade .6s var(--ease) both;
}

@keyframes product-fade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ── Media (shop_design product-card__image-wrap) ── */
.product-media {
  position: relative;
  width: 100%;
  min-width: 0;
}

.product-media__frame {
  display: block;
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.product-media__frame:hover .product-media__img {
  transform: scale(1.04);
}

.product-media__ratio {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  pointer-events: none;
}

@supports not (aspect-ratio: 4 / 5) {
  .product-media__ratio {
    height: 0;
    padding-top: 125%;
  }
}

.product-media__badges {
  z-index: 2;
}

.product-media__img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  object-position: center 72%;
  display: block;
  -webkit-object-fit: cover;
  pointer-events: none;
  transition: transform .9s var(--ease);
}

.product-media__img--empty {
  background: var(--bg-2);
}

.wishlist {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: var(--paper);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  cursor: pointer;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
}

/* Зона дотику 44px за iOS HIG — візуальний розмір лишається 32px */
.wishlist::after {
  content: '';
  position: absolute;
  inset: -6px;
}

/* На тач кнопка видима завжди: без hover вона лишалась прозорою, але клікабельною */
@media (hover: hover) and (pointer: fine) {
  .wishlist {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .35s var(--ease), transform .35s var(--ease);
  }

  .product:hover .wishlist { opacity: 1; transform: none; }
}

.wishlist svg,
.wishlist-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--ink);
  fill: none;
  stroke-width: 1.3;
}

.wishlist.is-active svg,
.wishlist-btn.is-active svg { fill: var(--accent); stroke: var(--accent); }

/* Hover-підказка: лише для пристроїв з курсором — на тач перекриває фото */
.quick-add { display: none; }

@media (hover: hover) and (pointer: fine) {
  .quick-add {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    background: var(--ink);
    color: var(--bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    transform: translateY(110%);
    opacity: 0;
    transition: transform .45s var(--ease), opacity .45s var(--ease);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    pointer-events: none;
  }

  .product:hover .quick-add { transform: none; opacity: 1; }

  .quick-add .sizes { display: flex; gap: 7px; flex-wrap: wrap; }
  .quick-add .sizes span { padding: 2px 3px; }
  .quick-add .sizes span.oos { opacity: .45; }
  .quick-add .add { font-weight: 700; }
}

.p-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.product-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 10px;
  min-width: 0;
}

.product-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.p-name-wrap {
  min-width: 0;
  flex: 1 1 auto;
}

.p-name {
  font-family: 'Archivo', sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -.005em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
}

.p-sub {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.p-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .04em;
  white-space: nowrap;
  padding-top: 2px;
  font-weight: 500;
  flex: none;
}

.p-price s { color: var(--ink-2); opacity: .55; margin-right: 6px; }
.p-price b { color: var(--accent); font-weight: 500; }

.p-low-stock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #c45a14;
  display: flex;
  align-items: center;
  gap: 6px;
}

.p-low-stock::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c45a14;
  flex: none;
  animation: low-stock-pulse 1.8s ease-in-out infinite;
}

@keyframes low-stock-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.detail-low-stock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #c45a14;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-low-stock::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c45a14;
  flex: none;
  animation: low-stock-pulse 1.8s ease-in-out infinite;
}

.p-preorder {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #5b7fd4;
}

.detail-preorder {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #5b7fd4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-preorder::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5b7fd4;
  flex: none;
}

.swatches { display: flex; gap: 5px; margin-top: 8px; }

.sw {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .15);
  cursor: pointer;
  transition: transform .25s var(--ease);
}

.sw:hover { transform: scale(1.25); }

@media (max-width: 640px) {
  .p-name {
    font-size: 14px;
  }

  .p-info {
    gap: 8px;
  }

  .p-price {
    font-size: 11px;
  }
}
