/* Картки товарів і фото без фону — спільне для сайту й передогляду в адмінці. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 46%), 1fr)); gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s, transform .2s; }
.card:hover, .card:focus-within { border-color: var(--accent); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .card:hover { transform: scale(1.05); z-index: 2; } }
.card-top { position: relative; }
.card .pic { display: block; aspect-ratio: 1; background: var(--blik); overflow: hidden; position: relative; }
.pic img { width: 100%; height: 100%; object-fit: cover; }
.card-text { text-decoration: none; }
.card .name { display: block; margin: 12px 12px 8px; font-size: .92rem; font-weight: 500; line-height: 1.35; }
.price { font: 700 1.2rem/1.3 var(--font-body); font-variant-numeric: tabular-nums; }
.card .price { font-size: 1.02rem; }
.card .price, .card .price .was { white-space: nowrap; }
.was { color: var(--muted); font-weight: 400; font-size: .8em; }
.card-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: auto 12px 12px; }
.card .price.none { font-size: .92rem; color: var(--muted); }
/* обрізаний кут ріже й звичайну рамку, тому рамка — це темна підкладка, а середина лежить на ній */
.q-btn { position: relative; isolation: isolate; padding: 5px 11px; border: 0; background: var(--ink); color: var(--ink); font-size: .78rem; font-weight: 700; line-height: 1.3; white-space: nowrap; text-decoration: none; cursor: pointer; margin-left: auto;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%); }
.q-btn::before { content: ''; position: absolute; inset: 1px; z-index: -1; background: var(--card);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7.4px), calc(100% - 7.4px) 100%, 0 100%); }
.q-btn:hover:not(:disabled) { color: var(--bg); }
.q-btn:hover:not(:disabled)::before { background: var(--ink); }
.q-btn:focus-visible { background: var(--accent); }
.q-btn:focus-visible::before { inset: 2px; }
.q-btn:disabled { opacity: .4; cursor: not-allowed; }
/* вибір кольору, розміру чи кількості: картка подовжується донизу, не зсуваючи сусідів */
.card-opts { display: none; margin: -2px 14px 10px; }
.q-chips { display: flex; gap: 4px; height: 30px; margin-bottom: 4px; overflow-x: auto; scrollbar-width: thin; }
.q-chips button { flex: none; padding: 2px 9px; min-width: 38px; border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--card); font-size: .8rem; cursor: pointer; }
.q-chips button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.q-chips button:disabled { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
@media (hover: hover) {
  .card:hover .card-opts, .card:focus-within .card-opts { display: block; }
  .card:hover:has(.card-opts), .card:focus-within:has(.card-opts) { margin-bottom: calc((34px * var(--rows) + 8px) * -1); z-index: 3; box-shadow: 0 14px 28px rgb(13 14 31 / .18); }
}

/* бейджі: «обрублені» квадратики вгорі зліва, трохи виступають за картку */
.badges { position: absolute; left: -4px; top: 10px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; pointer-events: none; max-width: calc(100% - 44px); }
.badge { display: inline-block; padding: 2px 9px 2px 8px; border-radius: var(--radius); font-size: .68rem; font-weight: 700; line-height: 1.5; text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%); }

.card-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 4px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.card-dots i { width: 14px; height: 3px; background: rgb(13 14 31 / .2); }
.card-dots i.on { background: var(--tin); }
.card:hover .card-dots { opacity: 1; }
@media (hover: none) { .card-dots { display: none; } }

/* новинка зрідка ловить ледь помітний зелений блік */
.pic { position: relative; }
.glint { position: absolute; inset: 9%; pointer-events: none; background: linear-gradient(112deg, transparent 34%, rgb(40 220 125 / .08) 45%, rgb(160 240 195 / .17) 50%, rgb(40 220 125 / .08) 55%, transparent 66%) no-repeat; background-size: 300% 100%; background-position: 100% 0;
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; animation: glint 14s ease-in-out infinite; }
@keyframes glint { 0% { background-position: 100% 0; } 28%, 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .glint { display: none; } }
.pic img.empty { object-fit: contain; padding: 24%; opacity: .18; }
/* PNG без фону: по центру сірої плашки */
.pic:has(img.cut) { background: var(--tile); }
.pic img.cut { object-fit: contain; padding: 9%; }
.shadow .pic img.cut { filter: drop-shadow(0 8px 10px rgb(13 14 31 / .25)); }
/* немає в наявності — чорно-біле */
.out .pic img, .out .thumbs img, .out .pic .jersey { filter: grayscale(1); opacity: .7; }
.shadow.out .pic img.cut { filter: grayscale(1) drop-shadow(0 8px 10px rgb(13 14 31 / .25)); }

@media (max-width: 760px) {
  .grid { gap: 10px; }
  .card .name { margin: 10px 10px 6px; font-size: .87rem; }
  .card-foot { margin: auto 10px 10px; }
  .card .price { font-size: .97rem; }
}

/* серце: додати в обране */
.fav { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; background: none; border: 0; color: var(--ink); cursor: pointer; }
.fav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.fav[aria-pressed=true] { color: var(--accent); }
.fav[aria-pressed=true] svg { fill: currentColor; }
.card-top .fav { position: absolute; top: 6px; right: 6px; z-index: 2; }
