/* ===== "Ми рекомендуємо" popup ===== */
.rec-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 20, 20, 0.55);
  backdrop-filter: blur(3px);
  animation: rec-fade .3s ease both;
}
@media (min-width: 640px) {
  .rec-overlay { padding: 20px; }
}
.rec-overlay.is-closing { animation: rec-fade .25s ease reverse both; }
.rec-overlay.is-closing .rec-card { animation: rec-out .25s ease both; }

.rec-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-3);
  padding: 22px 14px 14px;
  animation: rec-in .45s cubic-bezier(.2, .8, .25, 1) both;
}
@media (min-width: 640px) {
  .rec-card { max-height: 90vh; padding: 26px 22px 18px; }
}
.rec-card::before {
  /* brand glow on top */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 120px;
  background: radial-gradient(70% 100% at 50% 0%, var(--cta-soft), transparent 75%);
  pointer-events: none;
}

.rec-card__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rec-card__close:hover { border-color: var(--line-strong); }

.rec-card__head {
  position: relative;
  text-align: center;
  margin-bottom: 16px;
  padding-inline: 28px;
}
.rec-card__kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cta-strong);
  background: var(--cta-soft);
  border-radius: 999px;
  padding: 4px 10px;
}
.rec-card__kicker svg { color: #e0a82e; }
.rec-card__title {
  font-size: 22px;
  font-weight: 800;
  margin-top: 10px;
}
.rec-card__lead {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.rec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.rec-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-2);
  animation: rec-item-in .4s cubic-bezier(.2, .8, .25, 1) both;
}
.rec-item:nth-child(1) { animation-delay: .12s; border-color: var(--cta); box-shadow: 0 0 0 1px var(--cta) inset; }
.rec-item:nth-child(2) { animation-delay: .2s; }
.rec-item:nth-child(3) { animation-delay: .28s; }

.rec-item__logo {
  width: 64px;
  height: 48px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}
.rec-item__logo img { width: 100%; height: 100%; object-fit: contain; }

.rec-item__body { min-width: 0; }
.rec-item__name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rec-item__name { font-weight: 700; font-size: 15px; }
.rec-item__badge {
  font-size: 10.5px;
  font-weight: 700;
  color: #7a5608;
  background: #fbe9b7;
  border-radius: 999px;
  padding: 2px 7px;
}
.rec-item__title {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-item__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.rec-item__stats .stat-chip { font-size: 11.5px; padding: 3px 7px; }

.rec-item__cta {
  grid-column: 1 / -1;
  padding: 10px 14px;
}
@media (min-width: 480px) {
  .rec-item { grid-template-columns: 64px 1fr auto; }
  .rec-item__cta { grid-column: auto; width: auto; padding-inline: 18px; }
}

.rec-card__dismiss {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 4px;
}
.rec-card__dismiss:hover { color: var(--teal); }

@keyframes rec-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes rec-in {
  from { opacity: 0; transform: translateY(40px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes rec-out {
  to { opacity: 0; transform: translateY(24px) scale(.98); }
}
@keyframes rec-item-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Compact layout for phones */
@media (max-width: 479px) {
  .rec-card { padding: 18px 12px 10px; }
  .rec-card__close { top: 10px; right: 10px; width: 30px; height: 30px; }
  .rec-card__head { margin-bottom: 12px; }
  .rec-card__title { font-size: 19px; margin-top: 8px; }
  .rec-card__lead { font-size: 12.5px; }
  .rec-list { gap: 6px; }
  .rec-item { grid-template-columns: 52px 1fr; gap: 8px 10px; padding: 10px; }
  .rec-item__logo { width: 52px; height: 40px; }
  .rec-item__stats { margin-top: 4px; }
  .rec-item__cta { padding: 9px 14px; font-size: 13.5px; }
  .rec-card__dismiss { margin-top: 8px; }
}
