.product-card {
  background-color: var(--white);
  border-radius: 15px;
  padding: .5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  will-change: transform;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  border: 1px solid var(--border);
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.product-card:active {
  transform: translateY(-1px) scale(.995);
}
.product-card:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}
.product-card__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.product-card__image-wrapper {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1/1;
  margin-bottom: 5px;
}
.product-card__thumbnail {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1/1;
  clip-path: inset(0 1px 0 1px);
}
.product-card__badges {
  position: absolute;
  top: .3rem;
  left: .3rem;
  right: .3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .3rem;
  z-index: 2;
  pointer-events: none;
}
.product-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  box-sizing: border-box;
  color: black;
  font-size: .7rem;
  font-weight: bold;
  line-height: 1.4;
  padding: .2rem .4rem;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.product-badge--sale {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--white);
  background: #dc2626;
}
.product-badge--new {
  color: var(--white);
  background: #28a745;
}
.product-badge--preorder {
  color: var(--white);
  background: #7c3aed;
}
.product-card__content {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--ui-space-2);
  padding-top: var(--ui-space-2);
}
.product-card__availability .stock-status--compact {
  min-height: 0;
}
.product-card__title {
  color: rgba(0,0,0,1);
  font-size: var(--ui-font-base);
  margin: 0;
  text-align: left;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.product-card__purchase {
  margin-top: auto;
  display: grid;
  gap: var(--ui-space-2);
  padding: 8px;
  border-radius: 10px;
  background: #f2f5f9;
}
.product-card__price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px var(--ui-space-2);
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.product-card__price {
  white-space: nowrap;
  margin: 0;
  font-size: var(--ui-font-xl);
  font-weight: 700;
  line-height: 1.15;
  color: #172033;
}
.product-card__price-prefix { font-size: .68em; font-weight: 600; color: var(--muted, #475569); }
.product-card__old-price {
  white-space: nowrap;
  font-size: var(--ui-font-sm);
  color: #8a8f9a;
  text-decoration: line-through;
}
.product-card__swiper {
  border-radius: 8px;
  overflow: hidden;
}
.hover-strip {
  display: flex;
  align-items: stretch;
  gap: 5px;
  height: 2px;
  border-radius: 999px;
  background: #eceff3;
  overflow: hidden;
  user-select: none;
  position: relative;
  z-index: 1;
}
.hover-strip.is-empty {
  background: transparent;
  visibility: hidden;
}
.hover-strip__seg {
  flex: 1 1 0;
  border: 0;
  padding: 0;
  background: #d8dde6;
  cursor: pointer;
  transition: background .15s,opacity .15s;
}
.hover-strip__seg.is-active {
  background: #99a2b3;
}
.hover-strip__seg:hover {
  background: #b3bccd;
}
.hover-zones {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 0;
  z-index: 5;
  pointer-events: none;
  border-radius: inherit;
}
.hover-zone {
  flex: 1 1 0;
  pointer-events: auto;
  background: transparent;
}

/* Compact cart controls keep the product image and name clickable. */
.product-card__cart { cursor: default; }
.product-card__cart-actions { display: flex; justify-content: flex-end; }
.product-card__add { width: 100%; }
.product-card__quantity { width: 100%; }
.product-card__cart [hidden] { display: none !important; }
.product-card__cart button:disabled { opacity: .45; cursor: default; }
.product-card__feedback { display: block; margin-top: 4px; font-size: 11px; line-height: 1.4; color: #b42318; }
@media (max-width:400px) {
  .product-card .stock-status__line { align-items: flex-start; }
  .product-card .stock-status__icon { margin-top: 4px; }
  .product-card .stock-status__hint { padding-left: 0; }
  .product-card .stock-status__title,.product-card .stock-status__hint {
    white-space: normal; overflow: visible; text-overflow: clip;
  }
}

.card-sheet {
  position: fixed; inset: auto 0 0; margin: 0 auto; box-sizing: border-box;
  width: min(100%, 560px); max-width: none; max-height: calc(100dvh - 16px);
  padding: 0 16px max(16px, env(safe-area-inset-bottom)); border: 0;
  border-radius: 16px 16px 0 0; color: #0f172a; background: #fff;
  box-shadow: 0 -10px 30px #0f172a14; overscroll-behavior-y: contain;
  transform: translateY(110%);
  transition: transform .22s ease, overlay .22s allow-discrete, display .22s allow-discrete;
}
.card-sheet[open] { transform: translateY(var(--card-sheet-drag, 0px)); }
.card-sheet[style*="--card-sheet-drag"] { transition: none; }
@starting-style {
  .card-sheet[open] { transform: translateY(110%); }
}
.card-sheet::backdrop {
  background: #0f172a66; opacity: 0;
  transition: opacity .22s ease, overlay .22s allow-discrete, display .22s allow-discrete;
}
.card-sheet[open]::backdrop { opacity: 1; }
@starting-style {
  .card-sheet[open]::backdrop { opacity: 0; }
}
html:has(.card-sheet[open]) { overflow: hidden; }
.card-sheet__header {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 8px 0; background: #fff; touch-action: none;
}
.card-sheet__header::before {
  content: ''; position: absolute; top: 5px; left: calc(50% - 18px);
  width: 36px; height: 4px; border-radius: 4px; background: #cbd5e1;
}
.card-sheet__header h2 { margin: 0; font-size: 18px; }
.card-sheet__summary {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: #f1f5f9; border-radius: 12px; overflow-wrap: anywhere;
}
.card-sheet__summary img { flex: 0 0 64px; border-radius: 8px; background: #fff; object-fit: contain; }
.card-sheet__summary strong { font-size: 18px; }
.card-sheet__variants { display: grid; gap: 12px; margin-top: 16px; }
.card-sheet__option-label { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.card-sheet__options { display: flex; flex-wrap: wrap; gap: 8px; }
.card-sheet__options[data-sheet-modes] { margin-top: 16px; }
.card-sheet__options button {
  width: auto; max-width: 100%; height: auto; min-height: 42px;
  padding: 8px 12px; font-size: 14px; overflow-wrap: anywhere;
}
.card-sheet__options button[aria-pressed="true"] { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.card-sheet [hidden] { display: none; }
.card-sheet__status { margin: 12px 0 0; font-size: 14px; color: #475569; }
.card-sheet__actions {
  position: sticky; bottom: 0; display: flex; align-items: center;
  gap: 12px; padding-top: 16px; background: #fff;
}
.card-sheet__actions [data-sheet-add] { flex: 1; min-width: 0; min-height: 48px; }
.card-sheet__quantity { flex: 0 0 auto; padding: 2px; border-radius: 999px; background: #f1f5f9; }
.card-sheet__quantity .cart-control--step { width: 44px; min-height: 44px; border-radius: 999px; }
.card-sheet__quantity .cart-quantity__count { min-width: 26px; font-size: 14px; }
@media(prefers-reduced-motion: reduce) {
  .card-sheet, .card-sheet::backdrop { transition: none; }
}
