/* ============================================================
   style.css — оформление сайта «Cookie Roblox Squad»
   Тёмная тема, неоновые фиолетово-голубые акценты, адаптив.
   Все цвета вынесены в переменные (:root) — меняются в одном месте.
   ============================================================ */

/* ---- Переменные темы (меняйте цвета здесь) ---- */
:root {
  --bg:        #0d0a1a;   /* фон страницы */
  --bg-soft:   #16122b;   /* фон карточек/блоков */
  --bg-soft2:  #1e1940;   /* фон при наведении */
  --text:      #eae6ff;   /* основной текст */
  --text-dim:  #a99fd6;   /* приглушённый текст */
  --neon:      #a855f7;   /* фиолетовый неон */
  --neon2:     #22d3ee;   /* голубой неон */
  --danger:    #f43f5e;   /* красный (удаление/ошибки) */
  --success:   #22c55e;   /* зелёный (успех) */
  --border:    #2c2450;   /* границы */
  --radius:    14px;
  --shadow:    0 8px 30px rgba(0,0,0,.45);
}

/* ---- Базовый сброс ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: radial-gradient(1200px 600px at 70% -10%, #1a1140 0%, var(--bg) 60%);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--neon2); text-decoration: none; transition: color .2s; }
a:hover { color: var(--neon); }

img { max-width: 100%; display: block; }

/* ---- Контейнер по центру ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- Шапка ---- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13,10,26,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; max-width: 1100px; margin: 0 auto;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; color: var(--text);
}
.logo img { width: 40px; height: 40px; }
.logo .glow {
  background: linear-gradient(90deg, var(--neon), var(--neon2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Меню */
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a {
  color: var(--text-dim); padding: 8px 12px; border-radius: 10px;
  font-size: 15px; transition: all .2s;
}
.nav a:hover { color: var(--text); background: var(--bg-soft2); }

/* Счётчик корзины */
.cart-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(90deg, var(--neon), var(--neon2));
  color: #0d0a1a !important; font-weight: 700;
  padding: 8px 14px; border-radius: 10px;
}
.cart-badge:hover { filter: brightness(1.1); }

/* ---- Заголовки секций ---- */
.page-title { font-size: 28px; margin: 28px 0 6px; }
.page-sub { color: var(--text-dim); margin-bottom: 24px; }

/* ---- Сетка товаров ---- */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-bottom: 40px;
}

/* Карточка товара с hover-эффектом */
.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--neon);
  box-shadow: 0 12px 40px rgba(168,85,247,.25);
}
.card-img {
  aspect-ratio: 16/10; background: #0f0b22;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .placeholder { font-size: 46px; opacity: .5; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 17px; font-weight: 600; }
.card-desc { color: var(--text-dim); font-size: 14px; flex: 1; }
.card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.price { font-size: 20px; font-weight: 700;
  background: linear-gradient(90deg, var(--neon), var(--neon2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stock { font-size: 13px; color: var(--text-dim); }
.stock.out { color: var(--danger); }

/* ---- Кнопки ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: none;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all .2s; text-align: center;
}
.btn-primary {
  background: linear-gradient(90deg, var(--neon), var(--neon2));
  color: #0d0a1a;
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 6px 20px rgba(168,85,247,.4); color:#0d0a1a; }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--neon); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); color:#fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Формы ---- */
.form { max-width: 460px; }
.form.wide { max-width: 760px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--text-dim); }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(168,85,247,.25);
}
.field textarea { min-height: 110px; resize: vertical; }

/* ---- Блоки-сообщения ---- */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 15px; }
.alert-error { background: rgba(244,63,94,.12); border: 1px solid var(--danger); color: #fecdd3; }
.alert-success { background: rgba(34,197,94,.12); border: 1px solid var(--success); color: #bbf7d0; }
.alert-info { background: rgba(34,211,238,.10); border: 1px solid var(--neon2); color: #bae6fd; }

/* Панель с выданными куки (моноширинный, можно выделить и скопировать) */
.cookie-box {
  background: #0a0716; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; margin-top: 10px;
  font-family: 'Consolas', 'Courier New', monospace; font-size: 13px;
  color: var(--neon2); word-break: break-all; white-space: pre-wrap;
}

/* ---- Таблицы (корзина, заказы, админка) ---- */
.table-wrap { overflow-x: auto; margin-bottom: 24px; }
table { width: 100%; border-collapse: collapse; min-width: 520px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--text-dim); font-weight: 600; }
tr:hover td { background: rgba(255,255,255,.02); }

/* Мелкие поля количества в корзине */
.qty-input { width: 70px !important; }

/* ---- Итог корзины ---- */
.summary {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; max-width: 360px; margin-left: auto;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; }
.summary-total { font-size: 22px; font-weight: 700; }

/* ---- Подвал ---- */
.footer {
  border-top: 1px solid var(--border); margin-top: 40px;
  padding: 24px 16px; color: var(--text-dim); font-size: 14px;
}
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.footer a { margin-right: 14px; }

/* ---- Утилиты ---- */
.center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--text-dim); }
.empty {
  text-align: center; padding: 60px 20px; color: var(--text-dim);
}
.empty .big { font-size: 46px; margin-bottom: 12px; }

/* Плавное появление контента */
main { animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- Адаптив (мобильные) ---- */
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; }
  .nav { width: 100%; margin-left: 0; justify-content: flex-start; }
  .page-title { font-size: 23px; }
  .summary { max-width: 100%; margin-left: 0; }
}

/* Уважаем настройку "уменьшить анимацию" в системе пользователя */
@media (prefers-reduced-motion: reduce) {
  *, main { animation: none !important; transition: none !important; }
}
