/* ============================================================
   RAGE SHOP — page styles (on top of styles.css tokens)
   ============================================================ */

/* ---------- Header commerce buttons ---------- */
.shop-cart-btn {
  gap: 8px;
  white-space: nowrap;
}
.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 20px;
  background: #000;
  color: #fff;
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.shop-acct-btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: border-color .2s, background .2s;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-acct-btn:hover { border-color: rgba(230, 33, 47, .55); background: rgba(230, 33, 47, .06); }
@media (max-width: 720px) {
  .shop-head-discord { display: none; }
}
@media (max-width: 560px) {
  .shop-acct-btn { display: none; }
}

/* ---------- Hero badges ---------- */
.shop-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.shop-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .02);
  font-size: 13px;
  color: var(--muted);
}
.shop-badge b { color: var(--text); font-weight: 700; }
.shop-badge .hot { color: var(--red-2); }

/* ---------- Toolbar ---------- */
.shop-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.shop-tools .f-chip { font-size: 13px; }
.shop-search {
  margin-inline-start: auto;
  min-width: 220px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color .2s;
}
.shop-search:focus { outline: none; border-color: rgba(230, 33, 47, .6); }
.shop-search::placeholder { color: var(--dim); }
@media (max-width: 760px) {
  .shop-search { margin-inline-start: 0; width: 100%; }
}

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(262px, 1fr));
  gap: 14px;
}
.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: 4px;
}

/* ---------- Product card ---------- */
.card {
  --c: var(--red);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px;
  background: linear-gradient(180deg, #111117, #0d0d12);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 2px;
  background: var(--c);
  opacity: .6;
  transition: width .35s var(--ease), opacity .3s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(230, 33, 47, .4);
  box-shadow: 0 22px 60px -30px var(--c);
}
.card:hover::before { width: 100%; opacity: 1; }

.rar {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 2;
  font-family: var(--font-latin);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  color: #000;
  background: var(--c);
  padding: 2px 10px;
  border-radius: 20px;
}
.old {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 2;
  background: #2ecc71;
  color: #04220f;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 20px;
}

.ico {
  position: relative;
  height: 158px;
  margin: 16px 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  background: #0b0b0e;
  border: 1px dashed var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.ico img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ico img.v { object-fit: contain; padding: 10px; }
.it .e img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; display: block; }

.card h3 { font-size: 17px; font-weight: 800; }
.card > p {
  flex: 1;
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.85;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.price { font-weight: 800; font-size: 16px; }
.price s { display: block; color: var(--dim); font-size: 11.5px; font-weight: 400; }
.price small { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.price .toman { font-size: 11.5px; color: var(--muted); font-weight: 400; }

.add {
  background: var(--red);
  color: #fff;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 700;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  transition: background .2s, transform .2s;
}
.add:hover { background: var(--red-2); }
.add.alt { background: var(--line); }
.add.alt:hover { background: #2a2a35; }

/* ---------- Shop rules section spacing ---------- */
.shop-rules-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--dim);
}

/* ============================================================
   Overlays
   ============================================================ */
.shade {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .66);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.shade.on { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: min(420px, 100%);
  background: var(--panel);
  border-inline-end: 1px solid var(--line);
  z-index: 500;
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  transform: translateX(110%);
  visibility: hidden;
  transition: transform .32s var(--ease), visibility .32s;
}
.drawer.on { transform: none; visibility: visible; }

.dh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dh h2 { font-size: 18px; font-weight: 800; }
.x {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 15px;
  transition: border-color .2s;
}
.x:hover { border-color: rgba(230, 33, 47, .55); }

.items { flex: 1; overflow: auto; }
.it {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px;
  margin-bottom: 10px;
}
.it .e { font-size: 28px; }
.it div.n { flex: 1; font-size: 13.5px; }
.it div.n small { display: block; color: var(--muted); font-size: 12px; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty b { font-size: 13.5px; min-width: 14px; text-align: center; }
.qty button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--line);
  font-size: 13px;
  transition: background .2s;
}
.qty button:hover { background: #2a2a35; }

.foot {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}
.foot input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 13.5px;
}
.foot input:focus { outline: none; border-color: rgba(230, 33, 47, .6); }
.row { display: flex; gap: 8px; }
.row button { background: var(--line); padding: 0 16px; border-radius: 3px; font-size: 13px; transition: background .2s; }
.row button:hover { background: #2a2a35; }
.shop-acct-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 3px;
  font-size: 13px;
  color: var(--muted);
  transition: color .2s, border-color .2s;
}
.shop-acct-link:hover { color: var(--text); border-color: rgba(230, 33, 47, .5); }

.sum { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.sum.t { color: var(--text); font-size: 17px; font-weight: 800; }

.pay {
  background: linear-gradient(90deg, var(--red), var(--red-2));
  color: #fff;
  padding: 14px;
  font-weight: 800;
  font-size: 15px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%);
  transition: filter .2s;
}
.pay:hover:not(:disabled) { filter: brightness(1.1); }
.pay:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Gate modal (payment result) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.on { display: flex; }
.box {
  background: var(--panel);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 30px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 70px rgba(230, 33, 47, .35);
}
.box .big { font-size: 52px; line-height: 1; }
.box h2 { margin: 10px 0 8px; font-size: 20px; }
.box p { color: var(--muted); line-height: 1.9; font-size: 13.5px; }
.box code {
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 4px;
  color: var(--red-2);
  font-family: var(--font-latin);
  letter-spacing: .08em;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 100px);
  background: var(--panel-2);
  border: 1px solid var(--red);
  border-radius: 3px;
  padding: 12px 22px;
  font-size: 13.5px;
  z-index: 600;
  transition: transform .3s var(--ease);
}
.toast.on { transform: translate(-50%, 0); }

/* ============================================================
   Item preview
   ============================================================ */
.pv {
  --c: var(--red);
  position: fixed;
  inset: 0;
  z-index: 540;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pv.on { display: flex; }
.pvb {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
  width: min(1040px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--c);
  border-radius: 6px;
  padding: 22px;
  box-shadow: 0 0 80px -18px var(--c);
}
.pvx { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; }
.stage {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.stage img, .stage video, .stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: #000;
}
.thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.th {
  flex: 0 0 84px;
  height: 54px;
  border-radius: 3px;
  border: 2px solid var(--line);
  background: var(--panel-2);
  overflow: hidden;
  font-size: 18px;
}
.th.on { border-color: var(--red); }
.th img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pvi h2 { font-size: 22px; font-weight: 900; margin: 8px 0 6px; }
.pvi .lead { color: var(--muted); line-height: 1.9; font-size: 13.5px; margin: 0; max-width: none; }
.pvi ul {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 0;
}
.pvi li {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.8;
}
.pvi li::before { content: "// "; color: var(--red-2); font-family: var(--font-latin); font-size: 11px; }
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.pl {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px 6px;
  text-align: center;
  font-size: 12px;
  transition: border-color .2s, background .2s;
}
.pl b { display: block; font-size: 14px; }
.pl s { display: block; color: var(--dim); font-size: 11px; }
.pl:hover { border-color: rgba(230, 33, 47, .45); }
.pl.on { border-color: var(--red); background: rgba(230, 33, 47, .14); }
.pvbtn { display: flex; gap: 8px; }
.pvbtn .add { flex: 1; padding: 13px; font-size: 14px; }
@media (max-width: 760px) {
  .pvb { grid-template-columns: 1fr; }
}

/* ============================================================
   Account panel
   ============================================================ */
.modal .acct-box { max-width: 560px; text-align: right; max-height: 88vh; overflow: auto; }
.acct-box .sec { margin: 16px 0 4px; font-weight: 800; font-size: 14px; }
.kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  margin: 6px 0;
  font-size: 12.5px;
}
.kv b { font-weight: 700; }
.lcode {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  padding: 14px;
  font-size: 22px;
  letter-spacing: 5px;
  text-align: center;
  direction: ltr;
  font-family: var(--font-latin);
}
.lcode:focus { outline: none; border-color: rgba(230, 33, 47, .6); }
.acct-box .add { flex: 1; padding: 12px; }
.acct-box h2 { font-size: 20px; }

/* ---------- Checkout gate icon animation ---------- */
@keyframes shopPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.box .big { animation: shopPulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .box .big { animation: none; }
}
