/* ---------- Product card: white, hairline border, soft lift ---------- */
.ap-product {
  position: relative; display: flex; flex-direction: column; width: 100%; min-width: 0;
  border: 1px solid var(--ap-line); border-radius: var(--ap-radius-l); background: #fff; box-shadow: var(--ap-elev-1);
  color: var(--ap-ink); text-decoration: none;
  transition: transform 300ms var(--ap-ease), box-shadow 300ms var(--ap-ease), border-color 300ms ease;
}
.ap-product__media { margin: 6px 6px 0; aspect-ratio: 1; border-radius: 15px; overflow: hidden; background: var(--ap-media); }
.ap-product__media img { width: 100%; height: 100%; padding: 6%; object-fit: contain; mix-blend-mode: multiply; transition: transform 500ms var(--ap-ease); }
.ap-product__area {
  position: absolute; z-index: 1; top: 7px; right: 7px; display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 8px 1px 7px; border-radius: 999px; background: #fffffff0; color: var(--ap-brand-ink);
  box-shadow: 0 1px 3px #10182814; font-size: .5625rem; font-weight: 700; line-height: 2; white-space: nowrap;
}
.ap-product__area svg { width: 11px; height: 11px; flex-shrink: 0; }
.ap-product__installment { display: none; }
.ap-product__body { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 10px 11px 11px; }
.ap-product__merchant { display: flex; align-items: center; gap: 5px; min-width: 0; min-height: 20px; margin-bottom: 4px;
  color: var(--ap-muted); font-size: .625rem; line-height: 1.8; }
.ap-product__merchant > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ap-product__logo { flex: 0 0 18px; width: 18px; height: 18px; border-radius: 5px; overflow: hidden; background: #fff; }
.ap-product__logo img { width: 100%; height: 100%; object-fit: cover; }
.ap-product__title {
  margin-bottom: 8px; font-size: .75rem; font-weight: 700; line-height: 1.75; height: 3.5em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.ap-product__prices { display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; min-height: 42px; margin-top: auto; }
.ap-product__was { display: flex; align-items: center; gap: 6px; min-height: 18px; color: var(--ap-subtle); font-size: .625rem; }
.ap-product__off { display: inline-flex; justify-content: center; min-width: 30px; padding: 0 6px; border-radius: 999px;
  background: var(--ap-danger-soft); color: var(--ap-danger); font-size: .625rem; font-weight: 700; line-height: 1.8; }
.ap-product__price { display: flex; align-items: baseline; gap: 4px; font-size: .9375rem; font-weight: 700; white-space: nowrap; }
.ap-product__price small { color: var(--ap-muted); font-size: .625rem; font-weight: 400; }
.ap-product__pending { font-size: .75rem; color: var(--ap-brand-ink); }
a.ap-product:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
  a.ap-product:hover { transform: translateY(-4px); box-shadow: var(--ap-elev-2); border-color: #e3e8ef; }
  a.ap-product:hover .ap-product__media img { transform: scale(1.05); }
}

/* ---------- Store row ---------- */
.ap-list { display: grid; gap: 10px; }
.ap-store {
  display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 8px;
  border: 1px solid var(--ap-line); border-radius: var(--ap-radius-m); background: #fff; box-shadow: var(--ap-elev-1);
  color: var(--ap-ink); text-decoration: none;
}
.ap-store__cover { flex: 0 0 68px; width: 68px; aspect-ratio: 1; overflow: hidden; border-radius: var(--ap-radius-s); background: #edf5fb; }
.ap-store__cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; }
.ap-store__content { display: flex; flex: 1; flex-direction: column; gap: 8px; min-width: 0; }
.ap-store__identity { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ap-store__logo { flex: 0 0 24px; width: 24px; height: 24px; overflow: hidden; border-radius: 6px; }
.ap-store__logo img { width: 100%; height: 100%; object-fit: cover; }
.ap-store__name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .8125rem; font-weight: 700; }
.ap-store__meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.ap-store__arrow { width: 16px; height: 16px; flex-shrink: 0; color: var(--ap-subtle); }
.ap-store:active { opacity: .82; }
@media (hover: hover) and (pointer: fine) { .ap-store:hover { border-color: var(--ap-brand-line); } }

/* ---------- Brand tile (ایرانی / خارجی) ---------- */
.ap-brand-tile {
  display: flex; flex-direction: column; overflow: hidden; height: 100%;
  border: 1px solid var(--ap-line); border-radius: var(--ap-radius-l); background: #fff; box-shadow: var(--ap-elev-1);
  color: var(--ap-ink); text-decoration: none; transition: transform 300ms var(--ap-ease), box-shadow 300ms var(--ap-ease);
}
.ap-brand-tile__media { aspect-ratio: 1301 / 1367; overflow: hidden; }
.ap-brand-tile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ap-ease); }
.ap-brand-tile__body { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 48px; padding: 8px 12px; }
.ap-brand-tile__title { font-size: .875rem; font-weight: 700; }
.ap-brand-tile__go { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ap-surface); color: var(--ap-ink); }
.ap-brand-tile__go svg { width: 16px; height: 16px; }
.ap-brand-tile:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
  .ap-brand-tile:hover { transform: translateY(-4px); box-shadow: var(--ap-elev-2); }
  .ap-brand-tile:hover .ap-brand-tile__media img { transform: scale(1.04); }
}

/* ---------- Coupon ---------- */
.ap-coupon {
  position: relative; display: flex; flex-direction: column; width: 100%; overflow: hidden;
  border: 1px solid var(--ap-line); border-radius: var(--ap-radius-l); background: #fff; box-shadow: var(--ap-elev-1);
}
.ap-coupon__top { position: relative; }
.ap-coupon__art { aspect-ratio: 1080 / 400; }
.ap-coupon__art img { width: 100%; height: 100%; object-fit: cover; }
.ap-coupon__logo { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; padding: 3px; border-radius: 12px;
  background: #fff; overflow: hidden; box-shadow: 0 2px 8px #172b4d1a; }
.ap-coupon__logo img { width: 100%; height: 100%; object-fit: contain; }
.ap-coupon__value { position: absolute; left: 10px; bottom: 10px; padding: 3px 10px; border-radius: 10px;
  background: var(--ap-danger); color: #fff; font-size: .6875rem; font-weight: 700; }
.ap-coupon__body { position: relative; display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 12px 12px 10px; }
.ap-coupon__title { font-size: .8125rem; font-weight: 700; line-height: 1.7; }
.ap-coupon__terms { display: flex; flex-wrap: wrap; gap: 0 10px; color: var(--ap-muted); font-size: .6875rem; line-height: 1.8; }
.ap-coupon__terms span + span::before { content: '•'; margin-inline-end: 10px; color: #c3cad6; }
.ap-coupon__code {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; margin-top: 4px; padding: 6px 12px;
  border: 1.5px dashed #9fd0f7; border-radius: var(--ap-radius-s); background: var(--ap-brand-soft); color: var(--ap-brand-ink);
}
.ap-coupon__code code { font: 700 .9375rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; color: var(--ap-ink); }
.ap-coupon__copy { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; }
.ap-coupon__copy svg { width: 16px; height: 16px; }
.ap-coupon__code.is-copied { border-style: solid; border-color: #9ad8b5; background: #ecf9f1; color: var(--ap-success); }
.ap-coupon__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin-top: auto; }
.ap-coupon__expiry { display: inline-flex; align-items: center; gap: 4px; color: var(--ap-subtle); font-size: .6875rem; }
.ap-coupon__expiry svg { width: 14px; height: 14px; }
.ap-coupon__shop { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-inline-start: auto;
  color: var(--ap-link); font-size: .75rem; text-decoration: none; }
.ap-coupon__shop svg { width: 16px; height: 16px; }
