/* ============================================================
   ЕДИНЫЙ СТИЛЬ ДЛЯ poisk.html и cart.html
   Светлая тема — по умолчанию. Тёмная — по кнопке.
   ============================================================ */

/* ---------- СВЕТЛАЯ ТЕМА (по умолчанию) ---------- */
:root,
html[data-theme="light"] {
  --bg: #f8fafc;
  --bg-grad-start: #ffffff;
  --bg-grad-end:   #eef2f7;
  --card-bg: #ffffff;
  --card-bg-alt: #f1f5f9;
  --border: #cbd5e1;
  --border-soft: #e2e8f0;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-text: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --success: #059669;
  --success-hover: #047857;
  --danger: #dc2626;
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12);
  --hover-row: rgba(2, 132, 199, 0.06);
}

/* ---------- ТЁМНАЯ ТЕМА ---------- */
html[data-theme="dark"] {
  --bg: #0f172a;
  --bg-grad-start: #0f172a;
  --bg-grad-end:   #0f172a;
  --card-bg: #1e293b;
  --card-bg-alt: #0f172a;
  --border: #334155;
  --border-soft: #243247;
  --accent: #38bdf8;
  --accent-hover: #0284c7;
  --accent-text: #042f2e;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  --hover-row: rgba(148, 163, 184, 0.08);
}

/* ---------- БАЗА ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background: linear-gradient(180deg, var(--bg-grad-start), var(--bg-grad-end));
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  padding: 40px 20px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background-color .25s, color .25s;
}

.container { width: 100%; max-width: 1100px; }

/* ---------- ХЕДЕР ---------- */
header {
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

p.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* ---------- КНОПКИ ---------- */
button {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  transition: background .2s, color .2s, transform .1s;
}
button:hover { background: var(--accent-hover); color: #fff; }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- ПОЛЯ ВВОДА ---------- */
input[type="text"],
input[type="tel"],
input[type="search"] {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
input::placeholder { color: var(--text-muted); }
input:focus { border-color: var(--accent); }

/* ---------- ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ---------- */
.theme-toggle {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--card-bg); }

/* ---------- АДАПТИВ ---------- */
@media (max-width: 720px) {
  body { padding: 20px 12px 60px; }
  h1 { font-size: 20px; }
  header { margin-bottom: 18px; }
}
