:root {
  --bg: #12110f;
  --bg2: #1b1916;
  --card: #211e1a;
  --card2: #292521;
  --line: #3a342d;
  --text: #efe6d8;
  --muted: #b7aa98;
  --accent: #cd412b;
  --accent2: #e06a2f;
  --ok: #7bc67b;
  --danger: #ff6b6b;
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; color: var(--text); background: var(--bg); min-height: 100vh; }
.bg { position: fixed; inset: 0; background:
  radial-gradient(1200px 500px at 20% -10%, rgba(205,65,43,.22), transparent 60%),
  radial-gradient(900px 400px at 90% 0%, rgba(224,106,47,.12), transparent 60%),
  linear-gradient(180deg, #171512 0%, #0f0e0c 100%); z-index: -1; }
.topbar { max-width: 1240px; margin: 0 auto; padding: 24px 20px 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center; font-weight: 800; color: #fff; letter-spacing: .5px; box-shadow: var(--shadow); }
.brand-title { font-size: 28px; font-weight: 800; line-height: 1; }
.brand-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.user-badge { padding: 10px 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.container { max-width: 1240px; margin: 0 auto; padding: 10px 20px 40px; display: grid; gap: 18px; }
.card { background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 30%), var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-head { margin-bottom: 18px; }
.card-head h2 { margin: 0 0 4px; font-size: 24px; }
.card-head p { margin: 0; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.btn { border: 1px solid #5a4638; background: #332b25; color: var(--text); padding: 11px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; transition: .15s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), #b63a27); border-color: #d45540; color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 8px 12px; font-size: 13px; border-radius: 8px; }
.input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #171411; color: var(--text); }
.input:focus { outline: 1px solid var(--accent2); border-color: var(--accent2); }
.status-line { min-height: 20px; margin-top: 10px; font-size: 14px; }
.auth-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: stretch; }
.step { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.05); color: #ddd0bf; }
.step code { background: #151210; padding: 3px 7px; border-radius: 6px; color: #fff; border: 1px solid var(--line); }
.code-box { background: #171411; border: 1px solid #4a3f35; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.code-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.code-value { font-family: Consolas, "Courier New", monospace; font-size: clamp(22px, 3.5vw, 34px); font-weight: 700; letter-spacing: 1px; word-break: break-all; color: #fff; min-height: 42px; }
.code-meta { display: flex; align-items: center; gap: 12px; }
.timer { background: rgba(205,65,43,.15); color: #ff8f7f; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.linked-box { display: flex; justify-content: space-between; gap: 16px; align-items: center; background: #171411; border: 1px solid #435043; border-radius: 12px; padding: 18px; }
.linked-title { color: var(--ok); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.linked-name { font-size: 24px; font-weight: 700; margin: 4px 0; }
.balance-box { text-align: right; }
.balance-value { font-size: 34px; font-weight: 800; color: #fff; }
.topup-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.product { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.product-img { height: 130px; background: linear-gradient(135deg, #302922, #1e1915); background-size: cover; background-position: center; }
.product-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-name { font-weight: 700; font-size: 16px; }
.product-desc { font-size: 13px; line-height: 1.35; min-height: 34px; }
.product-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-price { font-weight: 800; font-size: 18px; }
.cart { display: flex; flex-direction: column; gap: 10px; }
.cart-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); background: #1a1714; border-radius: 10px; align-items: center; }
.cart-name { font-weight: 600; }
.cart-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge { padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.pending { background: rgba(224,106,47,.16); color: #ffb07a; }
.badge.claimed { background: rgba(123,198,123,.14); color: #9dd89d; }
.empty { color: var(--muted); padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }
.dialog { border: none; padding: 0; background: transparent; width: min(980px, calc(100vw - 24px)); color: var(--text); }
.dialog::backdrop { background: rgba(0,0,0,.6); }
.dialog-inner { margin: 0; max-height: calc(100vh - 24px); overflow: auto; }
.admin-login { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-login .input { max-width: 280px; }
.admin-actions { display: flex; gap: 10px; margin-bottom: 14px; }
.product-form { background: #181512; border: 1px solid var(--line); padding: 14px; border-radius: 10px; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form-grid .full { grid-column: span 4; }
.form-grid .check { flex-direction: row; align-items: center; gap: 8px; padding-top: 24px; color: var(--text); }
.form-actions { display: flex; gap: 10px; margin-top: 12px; }
.admin-products { display: flex; flex-direction: column; gap: 8px; }
.admin-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #1a1714; align-items: center; }
.admin-item-title { font-weight: 700; }
.admin-item-meta { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.admin-item-actions { display: flex; gap: 8px; }
@media (max-width: 960px) { .grid-2, .auth-grid { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: span 2; } }
/* Admin editor */
.editor-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.editor-preview { background: #141210; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.editor-preview-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.editor-preview-img { width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; background: linear-gradient(135deg, #302922, #1e1915) center/cover no-repeat; border: 1px dashed #4a4036; }
.editor-preview-img.has-image { border-style: solid; }
.editor-preview-hint { font-size: 12px; margin-top: 8px; }
.admin-item-left { display: flex; gap: 12px; align-items: center; min-width: 0; }
.admin-thumb { width: 64px; height: 48px; border-radius: 8px; background: #302922 center/cover no-repeat; border: 1px solid var(--line); flex: 0 0 auto; }
.admin-item { grid-template-columns: 1fr auto; }
.dialog { width: min(1100px, calc(100vw - 24px)); }

@media (max-width: 960px) { .grid-2, .auth-grid { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: span 2; } .editor-layout { grid-template-columns: 1fr; } .editor-preview-img { max-width: 320px; } }
@media (max-width: 560px) { .topbar { flex-direction: column; align-items: stretch; } .topbar-right { justify-content: space-between; } .brand-title { font-size: 24px; } .form-grid { grid-template-columns: 1fr; } .form-grid .full { grid-column: span 1; } .form-grid .check { padding-top: 0; } .linked-box { flex-direction: column; align-items: stretch; } .balance-box { text-align: left; } .admin-item { grid-template-columns: 1fr; } .admin-item-actions { justify-content: flex-start; } }

/* ================= Admin shell (GameStores-style) ================= */
.no-scroll { overflow: hidden; }
.admin-container { max-width: 1360px; }
.admin-shell { display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: start; }
.admin-nav { position: sticky; top: 16px; background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 40%), var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.admin-nav-title { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 4px 10px 10px; }
.admin-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; color: var(--text); padding: 11px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; transition: .15s; }
.admin-nav-item span { font-size: 16px; }
.admin-nav-item:hover { background: rgba(255,255,255,.04); }
.admin-nav-item.active { background: linear-gradient(135deg, rgba(205,65,43,.28), rgba(224,106,47,.12)); border-color: rgba(205,65,43,.45); }
.admin-nav-note { margin-top: 14px; padding: 12px; font-size: 12px; line-height: 1.5; color: var(--muted); border-top: 1px solid var(--line); }
.admin-nav-note code { background: #151210; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: #fff; }

.panel { background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 30%), var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h2 { margin: 0 0 4px; font-size: 24px; }
.panel-head p { margin: 0; }
.panel-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-toolbar .input { max-width: 320px; }
.panel-toolbar select.input { max-width: 200px; cursor: pointer; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-card { background: #181512; border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.settings-card h3 { margin: 0; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.field .input { font-weight: 400; }
.field-hint { font-size: 12px; color: #8f8272; font-weight: 400; line-height: 1.4; }
.field-hint code { background: #151210; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: #e9ddcd; }
.mono { font-family: Consolas, "Courier New", monospace; }

/* Toggle switch */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; background: #141210; border: 1px solid var(--line); border-radius: 10px; }
.switch-row > span { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.switch-row b { font-weight: 700; }
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 26px; border-radius: 999px; background: #3a332c; border: 1px solid #4d4339; position: relative; cursor: pointer; transition: .18s; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #cfc3b3; transition: .18s; }
.switch:checked { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: #d45540; }
.switch:checked::after { transform: translateX(20px); background: #fff; }

/* Product table */
.product-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #181512; }
.product-table-head, .product-row { display: grid; grid-template-columns: minmax(220px, 2.4fr) 1fr 1.1fr 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; }
.product-table-head { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: #141210; border-bottom: 1px solid var(--line); font-weight: 700; }
.product-row { border-bottom: 1px solid rgba(255,255,255,.045); }
.product-row:last-child { border-bottom: none; }
.product-row:hover { background: rgba(255,255,255,.025); }
.product-row-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-row-thumb { width: 58px; height: 42px; border-radius: 8px; background: linear-gradient(135deg, #302922, #1e1915) center/cover no-repeat; border: 1px solid var(--line); flex: 0 0 auto; }
.product-row-text { min-width: 0; }
.product-row-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-row-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.product-row-cat { color: var(--muted); font-size: 13px; }
.product-row-price { display: flex; flex-direction: column; gap: 2px; }
.product-row-price .price-now { font-weight: 800; color: #fff; }
.product-row-status { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.product-row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.status-badge { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.status-badge.on { background: rgba(123,198,123,.15); color: #9dd89d; }
.status-badge.off { background: rgba(255,107,107,.14); color: #ff8f8f; }
.status-badge.featured { background: rgba(224,106,47,.18); color: #ffb07a; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 12px; }
.price-now { font-weight: 800; }
.icon-danger:hover { color: #ff8f8f; border-color: #6b3a3a; }
.admin-products { display: flex; flex-direction: column; }

/* Editor overlay/window */
.editor-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8,7,6,.72); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 28px 16px; overflow: auto; }
.editor-window { width: min(1180px, 100%); background: linear-gradient(180deg, rgba(255,255,255,.035), transparent 24%), var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.6); display: flex; flex-direction: column; }
.editor-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.editor-top h2 { margin: 0 0 4px; font-size: 22px; }
.editor-top p { margin: 0; }
.icon-btn { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: #1a1714; color: var(--muted); cursor: pointer; font-size: 16px; flex: 0 0 auto; }
.icon-btn:hover { color: #fff; border-color: #5a4638; }
.editor-form { display: flex; flex-direction: column; min-height: 0; }
.editor-columns { display: grid; grid-template-columns: 1.65fr 1fr; gap: 18px; padding: 20px 24px; overflow: auto; }
.editor-col-main, .editor-col-side { display: flex; flex-direction: column; gap: 16px; }
.editor-block { background: #181512; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.editor-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.editor-block-head h3 { margin: 0; font-size: 15px; text-transform: uppercase; letter-spacing: .07em; }
.editor-block-head .muted { font-size: 12px; }
.editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor-fields .span-2 { grid-column: span 2; }
.editor-side-fields { display: flex; flex-direction: column; gap: 14px; }
.editor-preview { background: #141210; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.editor-preview-img { width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; background: linear-gradient(135deg, #302922, #1e1915) center/cover no-repeat; border: 1px dashed #4a4036; display: grid; place-items: center; overflow: hidden; }
.editor-preview-img.has-image { border-style: solid; }
.editor-preview-img.has-image .editor-preview-empty { display: none; }
.editor-preview-empty { font-size: 12px; color: #7d7263; }
.editor-preview-hint { font-size: 12px; margin-top: 8px; }
.editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 24px; border-top: 1px solid var(--line); background: #171411; border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.editor-footer-actions { display: flex; gap: 10px; }
.editor-footer .status-line { margin-top: 0; }

/* Admin variants editor */
.variants-editor { display: flex; flex-direction: column; gap: 10px; }
.variants-list { display: flex; flex-direction: column; gap: 8px; }
.variant-row { display: grid; grid-template-columns: 1.4fr .7fr 1fr 1fr auto; gap: 8px; align-items: center; }
.variant-row .input { padding: 8px 10px; font-size: 13px; }
.variant-row .v-remove { width: 34px; height: 34px; }
.variant-row .v-image { grid-column: 1 / -1; }
.variants-editor .field-hint { font-size: 12px; line-height: 1.5; }

@media (max-width: 620px) {
  .variant-row { grid-template-columns: 1fr 1fr; }
  .variant-row .v-remove { grid-column: span 2; justify-self: end; }
  .variant-row .v-image { grid-column: 1 / -1; }
}

/* Public card sale */
.product-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.product-price .price-old { font-size: 13px; }
.sale-badge { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 6px; letter-spacing: .02em; }
.featured-flag { position: absolute; top: 10px; left: 10px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.product { position: relative; }

@media (max-width: 1080px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-nav-title, .admin-nav-note { display: none; }
  .admin-nav-item { width: auto; }
  .editor-columns { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .product-table-head { display: none; }
  .product-row { grid-template-columns: 1fr 1fr; padding: 14px; gap: 10px; }
  .product-row-info { grid-column: span 2; }
  .product-row-actions { grid-column: span 2; justify-content: flex-start; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .editor-overlay { padding: 0; }
  .editor-window { border-radius: 0; min-height: 100vh; }
  .editor-top, .editor-columns, .editor-footer { padding: 16px; }
  .editor-fields { grid-template-columns: 1fr; }
  .editor-fields .span-2 { grid-column: span 1; }
  .product-row { grid-template-columns: 1fr; }
  .product-row-info, .product-row-actions { grid-column: span 1; }
}

/* ================= Storefront layout (index.html) ================= */
.store-header {
  position: relative;
  z-index: 30;
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent 70%), rgba(20,18,16,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.store-header-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions .user-badge { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.store-layout {
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}
.store-left { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* --- Онлайн сервера (слева) --- */
.server-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 24%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.server-status-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6b6258;
  box-shadow: 0 0 0 0 rgba(63,196,110,.5);
}
.server-status.is-online .server-status-dot {
  background: #3fc46e;
  animation: onlinePulse 2s infinite;
}
.server-status.is-offline .server-status-dot { background: #d1493a; }
@keyframes onlinePulse {
  0% { box-shadow: 0 0 0 0 rgba(63,196,110,.45); }
  70% { box-shadow: 0 0 0 8px rgba(63,196,110,0); }
  100% { box-shadow: 0 0 0 0 rgba(63,196,110,0); }
}
.server-status-text { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.server-status-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.server-status-text strong { font-size: 20px; font-weight: 800; color: #fff; }
.server-status-sub { font-size: 12px; color: var(--muted); }

.store-layout .panel {
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 24%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.store-layout .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.store-layout .panel-head h2 { margin: 0 0 4px; font-size: 21px; }
.store-layout .panel-head p { margin: 0; font-size: 13px; }

/* пустое информационное поле */
.info-panel {
  min-height: 170px;
  background:
    linear-gradient(135deg, rgba(205,65,43,.06), transparent 45%),
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 24%),
    var(--card);
}

/* --- Товары --- */
.store-layout .products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}
.store-layout .product {
  position: relative;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 50% 42%, #2b2520, #151210 78%);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: .15s;
}
.store-layout .product:hover { border-color: #5a4638; transform: translateY(-2px); }
.store-layout .product { cursor: pointer; }
.store-layout .product:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.store-layout .product-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.store-layout .product-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
.store-layout .product-noimg {
  height: 100%;
  display: grid;
  place-items: center;
  color: #6f6558;
  font-size: 12px;
}
.store-layout .product-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 24px 9px 9px;
  background: linear-gradient(180deg, transparent, rgba(10,8,6,.55) 25%, rgba(10,8,6,.94));
  z-index: 2;
}
.store-layout .product-name { font-weight: 700; font-size: 13px; line-height: 1.2; color: #fff; }
.store-layout .product-desc {
  font-size: 10.5px;
  line-height: 1.25;
  color: rgba(255,255,255,.72);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.store-layout .product-foot { display: flex; align-items: center; justify-content: space-between; gap: 5px; flex-wrap: wrap; }
.store-layout .product-price { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.store-layout .product-price .price-now { font-size: 13px; color: #fff; }
.store-layout .product-price .price-old { font-size: 10px; }
.store-layout .product-foot .btn { padding: 5px 8px; font-size: 11px; border-radius: 6px; }
.store-layout .featured-flag { z-index: 3; }

/* --- Корзина --- */
.cart-panel {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: calc(100vh - 36px);
  max-height: calc(100vh - 36px);
  min-height: 0;
  overflow: hidden;
}
.cart-balance {
  display: flex; justify-content: space-between; align-items: center;
  background: #171411; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.cart-balance strong { font-size: 22px; font-weight: 800; color: #fff; }
.cart-topup { display: flex; flex-direction: column; gap: 8px; }
.cart-topup .topup-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.store-layout .cart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #4a3f35 transparent;
}
.store-layout .cart::-webkit-scrollbar { width: 8px; }
.store-layout .cart::-webkit-scrollbar-track { background: transparent; }
.store-layout .cart::-webkit-scrollbar-thumb { background: #3d342b; border-radius: 8px; }
.store-layout .cart::-webkit-scrollbar-thumb:hover { background: #4a3f35; }
.store-layout .cart .empty { padding: 16px; font-size: 13px; }

/* --- Auth popover --- */
.auth-popover {
  position: absolute;
  top: calc(100% - 4px);
  right: 22px;
  width: min(400px, calc(100vw - 32px));
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 30%), var(--card);
  border: 1px solid #4a3f35;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  padding: 20px;
  z-index: 60;
  animation: authIn .16s ease;
}
@keyframes authIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.auth-pop-head h3 { margin: 0 0 4px; font-size: 19px; }
.auth-pop-head p { margin: 0 0 14px; font-size: 12px; }
.auth-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; font-size: 13px; }
.auth-popover .code-label { margin-bottom: 6px; }
.auth-popover .code-value { font-size: clamp(18px, 4vw, 26px); letter-spacing: .5px; min-height: 34px; }
.auth-popover .code-meta { margin-top: 8px; flex-wrap: wrap; gap: 8px; }
.auth-command {
  margin-top: 10px;
  background: #151210;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  color: #fff;
  text-align: center;
  word-break: break-all;
}
.auth-get { width: 100%; margin-top: 12px; }
.auth-hint { font-size: 12px; margin-top: 8px; }
.auth-hint code { background: #151210; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: #e9ddcd; }
.auth-linked { text-align: center; padding: 4px 0; }
.auth-balance {
  margin-top: 14px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: #171411; border: 1px solid var(--line); border-radius: 10px;
}
.auth-balance strong { font-size: 20px; color: #fff; }
.auth-unlink { width: 100%; margin-top: 10px; }

.store-footer { max-width: 1360px; margin: 0 auto; padding: 0 22px 30px; text-align: center; }
.store-footer a { font-size: 12px; text-decoration: none; border-bottom: 1px dashed currentColor; }

/* --- Модальное окно товара --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8,6,5,.72);
  backdrop-filter: blur(6px);
  animation: modalFade .16s ease;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.product-modal {
  position: relative;
  width: min(820px, 100%);
  max-height: min(90vh, 640px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 30%), var(--card);
  border: 1px solid #4a3f35;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: modalPop .16s ease;
}
@keyframes modalPop { from { transform: translateY(10px) scale(.985); } to { transform: none; } }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 5; width: 34px; height: 34px; font-size: 13px; }
.pm-media {
  position: relative;
  min-height: 300px;
  background: radial-gradient(circle at 50% 42%, #2b2520, #151210 78%);
}
.pm-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.pm-media .product-noimg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #6f6558;
  font-size: 13px;
}
.pm-info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-width: 0;
}
.pm-info h3 { margin: 0; font-size: 22px; line-height: 1.25; padding-right: 30px; }
.pm-info p { margin: 0; font-size: 13px; line-height: 1.5; }
.pm-variants { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.pm-variant {
  background: #171411;
  border: 1px solid var(--line);
  color: #cfc3b4;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: .12s;
}
.pm-variant:hover { border-color: #6b5544; color: #fff; }
.pm-variant.active {
  background: linear-gradient(135deg, rgba(205,65,43,.25), rgba(224,106,47,.18));
  border-color: var(--accent);
  color: #fff;
}
.pm-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.pm-price .price-now { font-size: 26px; font-weight: 800; color: #fff; }
.pm-price .price-old { font-size: 15px; }
.pm-buy { width: 100%; margin-top: 4px; padding: 12px; font-size: 15px; }
.pm-info .status-line { min-height: 18px; }

@media (max-width: 720px) {
  .product-modal { grid-template-columns: 1fr; max-height: 92vh; }
  .pm-media { min-height: 220px; max-height: 34vh; }
  .pm-info { padding: 18px; }
}

@media (max-width: 1080px) {
  .store-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; height: auto; max-height: none; overflow: visible; }
  .store-layout .cart { flex: 0 0 auto; max-height: none; overflow: visible; padding-right: 0; }
}
@media (max-width: 620px) {
  .store-header-inner { padding: 12px 14px; }
  .store-layout { padding: 14px; }
  .auth-popover { right: 14px; left: 14px; width: auto; }
  .store-layout .panel { padding: 16px; }
  .info-panel { min-height: 120px; }
}

