/* ============================================
   ADDON PAGE — site/addon.html
   Ported from backdoor-site-beta/d/addon.html inline CSS.
   Functional states (.is-active, .is-loading, .is-added, .price-unavailable)
   added below; visual rules above are 1:1 with beta.
   ============================================ */

/* ===== SCREENSHOT LIGHTBOX (backdoor-site-beta/shared/lightbox.css) ===== */
.ss-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 60px 80px;
  background: rgba(5, 7, 12, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: ss-lb-fade .15s ease-out;
}
.ss-lightbox.open { display: flex; }
@keyframes ss-lb-fade { from { opacity: 0; } to { opacity: 1; } }

.ss-lb-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.08);
  user-select: none;
  pointer-events: none;
  animation: ss-lb-zoom .2s ease-out;
}
@keyframes ss-lb-zoom { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.ss-lb-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s;
  font-family: inherit;
}
.ss-lb-close:hover { background: rgba(255,255,255,0.18); transform: rotate(90deg); }
.ss-lb-close svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.ss-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s;
  font-family: inherit;
}
.ss-lb-nav:hover { background: rgba(255,255,255,0.18); }
.ss-lb-nav.prev { left: 24px; }
.ss-lb-nav.next { right: 24px; }
.ss-lb-nav.prev:hover { transform: translateY(-50%) translateX(-2px); }
.ss-lb-nav.next:hover { transform: translateY(-50%) translateX(2px); }
.ss-lb-nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.ss-lb-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  color: rgba(255,255,255,0.85);
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: none;
}

@media (max-width: 760px) {
  .ss-lightbox { padding: 16px; }
  .ss-lb-nav.prev { left: 8px; }
  .ss-lb-nav.next { right: 8px; }
  .ss-lb-nav { width: 44px; height: 44px; }
  .ss-lb-close { top: 12px; right: 12px; }
}

.ss-item { cursor: zoom-in; }

/* ===== TOP LAYOUT (3-col like single) ===== */
.crumbs {
  padding: 22px 0 28px;
}

.product {
  display: grid;
  grid-template-columns: 300px 1fr 360px;
  gap: 40px;
  padding-top: 24px;
  position: relative;
  z-index: 3;
}
.cover-col .cover {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-strong);
}
.cover-col .platforms {
  position: absolute;
  bottom: 12px; left: 12px;
  display: flex; gap: 6px;
  z-index: 2;
}
.pl-badge {
  padding: 5px 10px;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}

/* ===== INFO column ===== */
.info-col .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  background: rgba(122,93,255,0.12);
  border: 1px solid rgba(122,93,255,0.3);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a48aff;
  margin-bottom: 14px;
}
.info-col h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 6px;
}
.parent-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-muted);
  margin-bottom: 22px;
  text-decoration: none;
}
.parent-link b { color: var(--blue-bright); font-weight: 700; font-size: inherit; }
.parent-link:hover b { text-decoration: underline; }
.parent-link svg { width: 12px; height: 12px; opacity: 0.6; align-self: center; }
.parent-static { display: inline-block; font-size: 14px; color: var(--text-muted); margin-bottom: 22px; }
.parent-static b { color: var(--text); font-weight: 700; }

/* ===== Info list ===== */
.info-list { display: flex; flex-direction: column; gap: 18px; }
.info-list .row .lbl { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.info-list .row .val { font-size: 15px; font-weight: 600; color: var(--text); }

/* ===== PRICE CARD ===== */
.price-col {
  align-self: start;
  position: sticky;
  top: calc(var(--header-h, 64px) + 24px);
}
.price-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-top-color: rgba(255,255,255,0.18);
  border-radius: var(--radius-xl);
  padding: 24px 26px;
}

/* Sale countdown timer (header inside price-card) */
.sale-timer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(122,88,203,0.14) 0%, rgba(26,148,255,0.10) 100%);
  border: 1px solid rgba(122,88,203,0.32);
  border-top-color: rgba(122,88,203,0.55);
  border-radius: 12px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.sale-timer::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(26,148,255,0.18), transparent 70%);
  pointer-events: none;
}
.sale-timer .st-ic {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7a58cb 0%, #1a94ff 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(122,88,203,0.4);
}
.sale-timer .st-ic svg { width: 18px; height: 18px; color: #fff; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sale-timer .st-text {
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  font-weight: 500;
  line-height: 1.25;
}
.sale-timer .st-vals { display: flex; gap: 6px; margin-left: auto; position: relative; }
.sale-timer .st-unit {
  text-align: center;
  background: rgba(0,0,0,0.32);
  border-radius: 8px;
  padding: 6px 8px 4px;
  min-width: 42px;
}
.sale-timer .st-num {
  font-size: 17px; font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em; line-height: 1;
  font-feature-settings: "tnum";
}
.sale-timer .st-lbl {
  font-size: 8px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-top: 3px;
}

.price-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.price-now {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
  line-height: 1;
}
.price-now .currency { margin-left: 3px; }
.price-discount {
  display: inline-flex; align-items: center;
  padding: 5px 9px;
  background: rgba(74,124,255,0.18);
  color: var(--blue-bright);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.price-was {
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: line-through;
  width: 100%;
  margin-top: -6px;
}
.price-unavailable {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
}

.price-ctas { display: flex; align-items: stretch; gap: 10px; }
.price-ctas .fav-btn {
  flex: 0 0 56px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all .2s;
}
.price-ctas .fav-btn:hover { color: #ff7878; border-color: rgba(255,120,120,0.35); background: rgba(255,120,120,0.06); }
.price-ctas .fav-btn svg { width: 22px; height: 22px; }
.price-ctas .fav-btn.is-active {
  color: #ff7878;
  border-color: rgba(255,120,120,0.45);
  background: rgba(255,120,120,0.10);
}
.price-ctas .fav-btn.is-active svg { fill: currentColor; }
.price-ctas .fav-btn.is-loading { opacity: 0.6; cursor: progress; }
.price-ctas .fav-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.price-ctas .cart-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 22px;
  background: linear-gradient(135deg, #7a5dff 0%, #4a7cff 100%);
  color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 700;
  border: none; border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(122,93,255,0.3);
  transition: all .15s;
}
.price-ctas .cart-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(122,93,255,0.45); }
.price-ctas .cart-btn.is-added,
.price-ctas .cart-btn.ok {
  background: linear-gradient(135deg, #5ed4a3, #3fa778);
  box-shadow: 0 10px 30px rgba(94,212,163,0.3);
}
.price-ctas .cart-btn.is-loading { opacity: 0.7; cursor: progress; transform: none; }
.price-ctas .cart-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.price-ctas .cart-btn svg { width: 18px; height: 18px; }

/* ===== SCREENSHOTS ===== */
.screenshots-section { margin-top: 48px; }
.screenshots-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.screenshots-head h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.screenshots-arrows { display: flex; gap: 8px; }
.ss-arrow {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7);
  cursor: pointer; transition: all .2s;
}
.ss-arrow:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.2); }
.ss-arrow:disabled { opacity: 0.35; cursor: not-allowed; }
.ss-arrow svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.screenshots-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-top: 6px;
  padding-bottom: 4px;
}
.screenshots-track::-webkit-scrollbar { display: none; }
.ss-item {
  flex: 0 0 calc((100% - 32px) / 3);
  aspect-ratio: 16/9;
  border-radius: 14px;
  overflow: hidden;
  background-size: cover; background-position: center 35%;
  border: 1px solid rgba(255,255,255,0.06);
  cursor: zoom-in;
  scroll-snap-align: start;
  transition: transform .2s, border-color .2s;
  transform-origin: center bottom;
}
.ss-item:hover { transform: scale(1.02); border-color: rgba(255,255,255,0.2); }

/* ===== DESCRIPTION ===== */
.details-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
.details-block h2 {
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.description-text {
  font-size: 15px; line-height: 1.65;
  color: var(--text-muted);
}
.description-text p + p { margin-top: 12px; }
.description-text b { color: var(--text); font-weight: 600; }
.description-empty { font-size: 14px; color: var(--text-dim); font-style: italic; }

/* ===== Related addons ===== */
.related-section { margin-top: 64px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.related-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .18s, border-color .18s;
}
.related-card:hover { border-color: var(--border-blue); transform: translateY(-2px); }
.related-cover {
  aspect-ratio: 16/9;
  background-size: cover; background-position: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.related-cover .dlc-mini {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 8px;
  background: rgba(122,93,255,0.85);
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  backdrop-filter: blur(6px);
}
.related-info { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.related-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.related-parent { font-size: 12px; color: var(--text-muted); }
.related-foot {
  margin-top: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.related-price { font-size: 15px; font-weight: 800; font-feature-settings: "tnum"; }
.related-price .currency { margin-left: 2px; }
.related-disc {
  padding: 3px 7px;
  background: rgba(74,124,255,0.18);
  color: var(--blue-bright);
  border-radius: 5px;
  font-size: 11px; font-weight: 700;
}

/* Deadline timer (catalog-style) */
@keyframes pulse-icon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.9); }
}
.game-deadline-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--red-bright);
  letter-spacing: -0.005em;
}
.game-deadline-inline svg {
  width: 11px; height: 11px;
  stroke-width: 2.2;
  animation: pulse-icon 2s ease-in-out infinite;
}
.game-deadline-inline.last { color: var(--red); font-weight: 700; }

/* Responsive */
@media (max-width: 1100px) {
  .product { grid-template-columns: 280px 1fr; }
  .price-col { grid-column: 1 / -1; position: static; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .details-grid { grid-template-columns: 1fr; }
  .ss-item { flex: 0 0 calc((100% - 16px) / 2); }
}
@media (max-width: 820px) {
  .product { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .ss-item { flex: 0 0 100%; }
}

/* ===== MOBILE FOUNDATION (B2) ===== */
@media (max-width: 600px) {
  .crumbs { padding: 16px 0 14px; }

  .product { gap: 24px; padding-top: 16px; }
  .cover-col { max-width: 260px; margin: 0 auto; width: 100%; }
  .cover-col .platforms { bottom: 10px; left: 10px; gap: 5px; }

  .info-col .eyebrow { padding: 4px 10px; font-size: 10px; margin-bottom: 12px; }
  .info-col h1 { font-size: 26px; }
  .parent-link { font-size: 13px; margin-bottom: 16px; }
  /* Long parent game titles must wrap rather than horizontally overflow */
  .parent-link b { overflow-wrap: anywhere; word-break: break-word; }
  .parent-static { font-size: 13px; margin-bottom: 16px; }
  .info-list { gap: 14px; }

  .price-card { padding: 18px 16px; }
  .sale-timer { padding: 12px; gap: 10px; margin-bottom: 14px; }
  .sale-timer .st-ic { width: 34px; height: 34px; }
  .sale-timer .st-unit { min-width: 40px; padding: 4px 6px 3px; }
  .sale-timer .st-num { font-size: 14px; }
  .sale-timer .st-text { font-size: 11px; }

  .price-row { margin-bottom: 18px; }
  .price-now { font-size: 28px; }

  .price-ctas { gap: 8px; }
  .price-ctas .fav-btn { flex: 0 0 48px; border-radius: 12px; }
  .price-ctas .fav-btn svg { width: 20px; height: 20px; }
  .price-ctas .cart-btn {
    padding: 14px;
    font-size: 13px;
    gap: 8px;
    min-width: 0;
    border-radius: 12px;
  }
  .price-ctas .cart-btn svg { width: 16px; height: 16px; }
  /* "В корзину за 12999₽" must wrap inside button, not overflow */
  .cart-btn-label { white-space: normal; line-height: 1.2; }

  /* Screenshots already fall to flex:0 0 100% at 760; hide arrows on phones */
  .screenshots-section { margin-top: 32px; }
  .screenshots-head { margin-bottom: 14px; }
  .screenshots-head h2 { font-size: 18px; }
  .screenshots-arrows { display: none; }
  .screenshots-track { gap: 12px; }

  .details-grid { margin-top: 32px; gap: 24px; }
  .details-block h2 { font-size: 20px; margin-bottom: 14px; }
  .description-text { font-size: 13px; line-height: 1.6; }

  .related-section { margin-top: 40px; }
  .related-info { padding: 12px 14px; }
  .related-name { font-size: 13px; }
  .related-foot { margin-top: 8px; }
  .related-price { font-size: 14px; }
}
