/* ============================================================
   KendoCraft :: Store — redesign v3 (спокойный, удобный для ПК)
   Подключать ПОСЛЕ style.css и store_style.css.
   Десктоп: слева липкое меню категорий, справа товары. Телефон: одна колонка.
   ============================================================ */
:root { --ease:cubic-bezier(.2,.7,.2,1); --bg:#09060f; --panel:#120d1c; --panel-2:#171024; --line:rgba(255,255,255,.08); --mute:#a79bb8; }
body { background-color:var(--bg); background-image:none; }

/* ---------- Фон: статичный, без анимаций ---------- */
.store-aurora { position:fixed; inset:0; z-index:-1; pointer-events:none;
  background: radial-gradient(55% 45% at 85% -5%, rgba(138,43,226,.38), transparent 70%),
              radial-gradient(45% 40% at 0% 100%, rgba(185,103,255,.14), transparent 70%); }

/* ---------- Раскладка страницы ---------- */
.store-section { display:grid; grid-template-columns:minmax(0,1fr); padding:clamp(24px,4vw,56px) clamp(14px,4vw,24px) 90px; }
.store-top { display:contents; }
.store-hero, .store-tabs, .purchases-ticker, .store-section-content { min-width:0; }

/* ---------- Шапка: панель с блоками в стиле игры ---------- */
.store-hero { position:relative; overflow:hidden; margin-bottom:24px; padding:clamp(28px,5vw,54px) clamp(22px,4vw,48px);
  border-radius:28px; border:1px solid rgba(185,103,255,.28);
  background: linear-gradient(115deg, rgba(138,43,226,.42), rgba(185,103,255,.07) 58%, rgba(255,255,255,.02)), var(--panel); }
.store-hero::before { content:""; position:absolute; inset:0; pointer-events:none; background-size:48px 48px;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px,transparent 1px), linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px);
  -webkit-mask-image:linear-gradient(90deg,#000,transparent 75%); mask-image:linear-gradient(90deg,#000,transparent 75%); }
.store-hero::after { content:""; position:absolute; pointer-events:none; right:clamp(8px,4vw,56px); top:50%; width:210px; height:170px; translate:0 -50%;
  background:
    linear-gradient(135deg,#c58bff,#8a2be2) 100% 0 / 76px 76px no-repeat,
    linear-gradient(135deg,rgba(197,139,255,.6),rgba(138,43,226,.3)) 42% 54% / 76px 76px no-repeat,
    linear-gradient(135deg,rgba(197,139,255,.3),rgba(138,43,226,.12)) 100% 100% / 76px 76px no-repeat;
  box-shadow:0 0 0 0 transparent; filter:drop-shadow(0 14px 22px rgba(138,43,226,.45)); }
.store-title { position:relative; z-index:1; margin:0; text-align:left; font-size:clamp(2.3rem,6vw,4rem); line-height:1.05; letter-spacing:.04em;
  color:#fff; text-shadow:0 2px 28px rgba(138,43,226,.55); }
.store-title::before { display:none; }
.store-title::after { content:""; display:block; width:64px; height:5px; margin:18px 0 0; border-radius:3px; clip-path:none; opacity:1;
  background:linear-gradient(90deg,var(--accent-1),var(--accent-2)); }

/* ---------- Категории ---------- */
.store-tabs { display:flex; flex-direction:row; flex-wrap:nowrap; justify-content:flex-start; gap:8px; margin:0 0 20px; padding:6px; overflow-x:auto; scrollbar-width:none;
  border:1px solid var(--line); border-radius:18px; background:var(--panel); }
.store-tabs::-webkit-scrollbar { display:none; }
.store-tab { display:flex; align-items:center; gap:10px; flex:1 0 auto; min-height:48px; padding:10px 18px; white-space:nowrap; text-align:left;
  border:0; border-radius:13px; background:transparent; color:#bfb3d1; box-shadow:none; transform:none;
  font:700 .88rem 'Orbitron',sans-serif; transition:background .25s, color .25s; }
.store-tab::before { display:none; }
.store-tab::after { content:attr(data-count); margin-left:auto; padding:2px 9px; border-radius:999px; background:rgba(255,255,255,.08); font-size:.72rem; }
.store-tab:hover { transform:none; box-shadow:none; background:rgba(185,103,255,.12); color:#fff; }
.store-tab.active { background:linear-gradient(135deg,var(--accent-1),var(--accent-2)); color:#fff; box-shadow:0 8px 20px -8px rgba(138,43,226,.8); }
.store-tab.active::after { background:rgba(255,255,255,.22); }
.store-tab:focus-visible, .store-card .buy-btn:focus-visible, .store-card .info-btn:focus-visible, .close-btn:focus-visible { outline:2px solid #fff; outline-offset:2px; }

@media (min-width:960px) {
  .store-section { grid-template-columns:250px minmax(0,1fr); column-gap:36px; }
  .store-hero { grid-column:1 / -1; grid-row:1; }
  .store-tabs { grid-column:1; grid-row:2 / span 3; align-self:start; position:sticky; top:24px; flex-direction:column; gap:6px; padding:8px; margin:0; overflow:visible; }
  .store-tab { flex:none; width:100%; min-height:54px; font-size:.95rem; }
  .purchases-ticker { grid-column:2; grid-row:2; }
  .store-section-content { grid-column:2; grid-row:3; }
}

/* ---------- Лента покупок: спокойная полоса внутри колонки ---------- */
.purchases-ticker { margin:0 0 24px; padding:10px 0; border-radius:16px; border:1px solid var(--line); background:var(--panel); }
.purchases-ticker::before { width:60px; background:linear-gradient(90deg,var(--panel),transparent); }
.purchases-ticker::after  { width:60px; background:linear-gradient(270deg,var(--panel),transparent); }
.purchases-track { gap:0; animation-duration:30s; }
.purchase-item, .purchase-item:hover { gap:12px; padding:0 22px 0 10px; background:none; border:0; border-radius:0; border-right:1px solid var(--line); }
.purchase-item img { width:38px; height:38px; border-radius:9px; }
.purchase-item__nick { font-size:.92rem; }
.purchase-item__detail { font-size:.8rem; }
@media (min-width:1024px) {
  .purchases-ticker { padding:10px 0; } .purchases-track { gap:0; }
  .purchase-item { gap:12px; padding:0 22px 0 10px; border-radius:0; } .purchase-item img { width:38px; height:38px; border-radius:9px; }
  .purchase-item__nick { font-size:.92rem; } .purchase-item__detail { font-size:.8rem; }
}

/* ---------- Карточки ---------- */
.store-grid { counter-reset:none; grid-template-columns:repeat(auto-fill,minmax(min(100%,250px),1fr)); gap:20px; grid-auto-flow:dense; }

.store-card { --t:.4; position:relative; display:flex; flex-direction:column; align-items:stretch; text-align:left; overflow:hidden; padding:0;
  border-radius:22px; border:1px solid var(--line); background:var(--panel);
  transition:transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.store-card:hover { transform:translateY(-4px); border-color:rgba(185,103,255,.5); background:var(--panel); box-shadow:0 20px 44px -22px rgba(138,43,226,.6); }
.store-card::before { background:radial-gradient(320px circle at var(--mx,50%) var(--my,0%), rgba(185,103,255,.16), transparent 62%); }
.store-card > * { position:relative; z-index:1; }
.store-card > :not(img):not(.discount-badge) { margin-left:20px; margin-right:20px; }
.store-card > :last-child { margin-bottom:20px; }
.store-card > .discount-badge { position:absolute; z-index:3; top:12px; left:12px; right:auto; }

/* шкала уровня: чем дороже привилегия, тем длиннее полоса */
#tab-privileges .store-card::after { content:""; position:absolute; z-index:2; left:0; top:0; height:3px; width:calc(10% + var(--t) * 90%);
  background:linear-gradient(90deg,var(--accent-1),var(--accent-2)); }

.store-card img { width:100%; height:auto; aspect-ratio:4/3; object-fit:contain; padding:20px; margin:0 0 16px; border-radius:0; filter:none;
  background:radial-gradient(60% 70% at 50% 55%, rgba(185,103,255,calc(.16 + var(--t) * .2)), transparent 72%), linear-gradient(180deg,var(--panel-2),var(--panel));
  transition:transform .5s var(--ease); }
.store-card:hover img { transform:scale(1.05); filter:none; }

.store-card h3 { margin-top:0; margin-bottom:6px; font:700 1.35rem/1.2 'Orbitron',sans-serif; color:#fff; }
.store-card .store-price, .store-card .store-price-old { display:inline-block; margin-top:0; margin-bottom:14px; }
.store-card .store-price { margin-right:10px; font:800 1.6rem 'Orbitron',sans-serif; color:#d9b3ff; text-shadow:none; }
.store-card .store-price-old { margin-right:8px; font-size:1.05rem; color:#7d7190; }
.store-card p { min-height:0; margin-top:0; margin-bottom:10px; font-size:.92rem; line-height:1.5; color:var(--mute); }

.card-buttons { margin-top:auto; padding-top:6px; gap:8px; }
.store-card > .buy-btn { margin-top:auto; }
/* .store-card .x (0,2,0) перебивает устаревшее ".store-card button" из style.css */
.store-card .buy-btn { width:auto; min-height:48px; margin:0; padding:12px 16px; border-radius:13px; font:700 .92rem 'Exo 2',sans-serif; letter-spacing:.01em;
  background:linear-gradient(135deg,var(--accent-1),var(--accent-2)); box-shadow:inset 0 1px 0 rgba(255,255,255,.25); }
.store-card .buy-btn:hover { box-shadow:inset 0 1px 0 rgba(255,255,255,.25), 0 10px 24px -8px rgba(138,43,226,.8); }
.store-card .info-btn { width:auto; min-height:44px; margin:0; padding:10px 16px; border-radius:13px; background:transparent; border:1px solid rgba(255,255,255,.14); color:#d8c6f2; font-weight:600; font-size:.88rem; }
.store-card .info-btn:hover { background:rgba(185,103,255,.12); border-color:var(--accent-2); color:#fff; box-shadow:none; }
.card-buttons .buy-btn, .card-buttons .info-btn { width:100%; }

/* ---------- Этернум: широкая карточка-витрина ---------- */
.store-card--featured { --t:1; order:-1; grid-column:1 / -1; border-color:transparent;
  background:linear-gradient(var(--panel),var(--panel)) padding-box, linear-gradient(135deg,var(--accent-2),rgba(138,43,226,.15) 45%,var(--accent-1)) border-box;
  box-shadow:0 30px 70px -36px rgba(138,43,226,.8); }
.store-card--featured:hover { border-color:transparent; }
.store-card--featured h3 { font-size:clamp(1.8rem,4vw,2.6rem); }
.store-card--featured .store-price { font-size:clamp(1.8rem,3.4vw,2.3rem); }
.store-card--featured p { color:#d9b3ff; font-size:.85rem; font-weight:700; letter-spacing:.03em; max-width:42ch; }
@media (min-width:700px) {
  .store-card--featured { display:grid; grid-template-columns:minmax(220px,38%) 1fr; align-content:stretch; column-gap:0; }
  .store-card--featured img { grid-column:1; grid-row:1 / span 6; height:100%; min-height:300px; aspect-ratio:auto; margin:0; padding:28px; }
  .store-card--featured > :not(img):not(.discount-badge) { grid-column:2; margin-left:40px; margin-right:32px; justify-self:start; }
  .store-card--featured h3 { align-self:end; margin-top:32px; }
  .store-card--featured > :nth-last-child(2) { align-self:start; }
  .store-card--featured .card-buttons { width:calc(100% - 72px); max-width:460px; justify-self:start; align-self:start; margin-top:8px; }
}
@media (min-width:1180px) {
  .store-card--featured .card-buttons { display:flex; flex-direction:row; }
  .store-card--featured .card-buttons > * { flex:1; }
}

/* ---------- Смартфоны: компактные карточки ---------- */
@media (max-width:559px) {
  .store-grid { grid-template-columns:1fr; gap:14px; }
  .store-card { display:grid; grid-template-columns:96px 1fr; column-gap:14px; align-items:start; padding:12px; border-radius:20px; }
  .store-card > :not(img):not(.discount-badge) { margin:0; }
  .store-card > :last-child { margin-bottom:0; }
  .store-card img { grid-column:1; grid-row:1 / span 4; width:96px; aspect-ratio:1; padding:8px; border-radius:14px; }
  .store-card h3, .store-card .store-price, .store-card .store-price-old { grid-column:2; justify-self:start; }
  .store-card h3 { font-size:1.1rem; } .store-card .store-price { font-size:1.35rem; } .store-card .store-price, .store-card .store-price-old { margin-bottom:6px; }
  .store-card > .discount-badge { position:static; grid-column:2; justify-self:start; margin:0 0 6px; }
  .store-card p, .store-card .card-buttons, .store-card > .buy-btn { grid-column:1 / -1; }
  .store-card p { margin-top:10px; } .store-card .card-buttons, .store-card > .buy-btn { margin-top:12px; }
  .store-card--featured img { grid-row:1 / span 4; }
  #tab-privileges .store-card::after { display:none; }
  .store-hero::after { opacity:.35; right:-30px; }
  .store-tab { padding:10px 12px; font-size:.8rem; }
  .store-tab::after { display:none; }
  .store-card img { width:88px; } .store-card { grid-template-columns:88px 1fr; }
}

/* ---------- Окно описания ---------- */
.modal { background:rgba(6,4,10,.8); }
.modal-content { display:flex; flex-direction:column; width:min(92%,640px); max-height:84vh; padding:0; overflow:hidden; border-radius:24px;
  background:var(--panel); border:1px solid rgba(185,103,255,.32); animation:modalPop .3s var(--ease) both; }
@keyframes modalPop { from { opacity:0; transform:translate(-50%,-47%) scale(.97); } to { opacity:1; transform:translate(-50%,-50%); } }
.modal-content::before { display:none; }
.modal-content h2 { flex:none; margin:0; padding:24px 76px 20px 28px; border-bottom:1px solid rgba(185,103,255,.25);
  font:700 1.7rem/1.2 'Orbitron',sans-serif; color:#fff; -webkit-text-fill-color:#fff;
  background:linear-gradient(115deg,rgba(138,43,226,.5),rgba(138,43,226,.06)); -webkit-background-clip:border-box; background-clip:border-box; }
.modal-scroll { flex:1; min-height:0; max-height:none; margin:0; padding:14px 28px 28px 14px; overflow-y:auto; -webkit-mask-image:none; mask-image:none; }
.modal-scroll li { padding-top:7px; padding-bottom:7px; margin-bottom:0; }
.modal-scroll strong { padding:2px 8px; border-radius:7px; background:rgba(185,103,255,.16); color:#ecd9ff; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:.86em; font-weight:600; }
.close-btn { z-index:5; top:16px; right:16px; width:42px; height:42px; display:grid; place-items:center; border-radius:50%; background:rgba(255,255,255,.1); color:#fff; font-size:24px; }
@media (max-width:600px) {
  .modal-content { top:auto; bottom:0; left:0; width:100%; max-height:90vh; transform:none; border-radius:24px 24px 0 0; animation:sheetIn .35s var(--ease) both; }
  .modal-content h2 { padding:22px 70px 18px 20px; font-size:1.4rem; }
  .modal-scroll { padding:10px 20px 28px 6px; }
}
@keyframes sheetIn { from { opacity:0; transform:translateY(46px); } to { opacity:1; transform:none; } }

/* ---------- Анимации: только появление карточек ---------- */
@keyframes rise { from { opacity:0; transform:translateY(18px); } }
@media (prefers-reduced-motion:no-preference) {
  .fx .store-card:not(.in) { opacity:0; }
  .fx .store-card.in { animation:rise .6s var(--ease) var(--d,0ms) backwards; }
}
@media (hover:none) { .store-card:hover { transform:none; } .store-card:hover img { transform:none; } }
@media (prefers-reduced-motion:reduce) { .modal-content, .purchases-track { animation:none; } .store-card, .store-card img { transition:none; } }
