/* =====================================================================
   Общие стили всех страниц: база, шапка (логотип | меню | авторизация),
   выбор города, модалки/оверлеи, тост.
   Стили конкретных страниц (каталог, новости, контакты) — в их <style>.
   ===================================================================== */

* { box-sizing: border-box; }
body { font-family: Verdana, Arial, sans-serif; margin: 0; background: #f8fafc; color: #353535; }
a { color: #276fc8; text-decoration: none; }
a:hover { text-decoration: underline; }
.main-content { position: relative; margin: 0 auto; max-width: 1200px; padding: 0 16px; }
.main-content:after { content: ''; clear: both; display: table; }

/* ==== Шапка (единая на всех страницах) ==== */
header { background: #fff; }
.header-top { min-height: 92px; display: flex; align-items: center; gap: 24px; padding-top: 10px; padding-bottom: 8px; }
.logo { flex: 1 1 0; }
.logo a { line-height: 0; display: inline-block; }
.logo img { display: block; max-height: 52px; width: auto; }

/* Выбор города — под логотипом, без обводки */
.city-row { display: flex; align-items: center; gap: 18px; margin-top: 12px; }
.city-picker { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: transparent; border: none; border-radius: 18px; transition: background .15s; }
.city-picker:hover, .city-picker:focus-within { background: #f1f5f9; }
.city-pin { width: 13px; height: 13px; opacity: .75; }
select.city-select { border: none; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: #353535; cursor: pointer; outline: none; padding: 0 18px 0 0; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23353535' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center; }
select.city-select:hover { color: #3a75bb; }

/* Меню по центру шапки */
.header-nav { flex: 0 0 auto; display: flex; gap: 28px; }
.nav-link { color: #353535; font-family: Tahoma, Arial, serif; font-size: 14px; text-decoration: none; padding: 4px 2px; }
.nav-link:hover { color: #3a75bb; text-decoration: underline; }
.nav-link.active { color: #3a75bb; font-weight: 700; }

/* Правый блок: авторизация и (на каталоге) корзина */
.basket { flex: 1 1 0; text-align: right; font-size: 12px; position: relative; line-height: 1.6; }
.your-cart { color: #000; text-decoration: none; }
.your-cart:hover { text-decoration: underline; }
.cart-icon { width: 15px; height: 15px; vertical-align: -3px; margin-right: 5px; opacity: .85; }

/* Вход/регистрация либо приветствие — строкой над корзиной (или вместо неё) */
#authArea { display: block; margin-bottom: 4px; font-size: 12px; white-space: nowrap; }
#authArea a { color: #276fc8; margin-left: 12px; cursor: pointer; text-decoration: none; border-bottom: 1px dashed #276fc8; }
#authArea a:first-child { margin-left: 0; }
#authArea a:hover { border-bottom-style: solid; text-decoration: none; }
#authArea .welcome { color: #353535; margin-left: 12px; }
#authArea .welcome:first-child { margin-left: 0; }
#authArea .welcome b { color: #276fc8; }
#authArea .logout-link { color: #64748b; border-bottom-color: #94a3b8; }

/* ==== Кнопки-вкладки (категории каталога и вкладки входа) ==== */
.cat-btn { padding: 10px 18px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; font-weight: 700; cursor: pointer; font-size: .95rem; color: #353535; font-family: inherit; }
.cat-btn:hover { border-color: #3a75bb; }
.cat-btn.active { background: #3a75bb; color: #fff; border-color: #3a75bb; }
.cat-count { font-weight: 400; font-size: .8rem; opacity: .75; }

/* ==== Оверлеи и модалки (база; специфика страниц — в их <style>) ==== */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: none; z-index: 40; }
.overlay.show { display: block; }
.modal { position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 92%; max-width: 520px; background: #fff; border-radius: 10px; box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); z-index: 60; display: none; padding: 26px; }
.modal.show { display: block; }
.modal h2 { margin-top: 0; font-size: 22px; margin-bottom: 18px; color: #353535; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 6px; color: #374151; }
.form-group input { width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; }
.form-group input:focus { outline: 2px solid #3a75bb; border-color: transparent; }
.modal-footer { margin-top: 22px; display: flex; gap: 10px; justify-content: flex-end; }
button.primary { background: #8dd42c; color: #fff; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-weight: 700; font: inherit; }
button.primary:hover { background: #98d841; }
button.primary:disabled { opacity: .6; cursor: wait; }
button.secondary { background: #fff; border: 1px solid #cbd5e1; color: #374151; padding: 8px 16px; border-radius: 8px; cursor: pointer; font: inherit; }
button.secondary:hover { background: #f8fafc; }
.modal-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: .85rem; padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; display: none; }
.modal-error.show { display: block; }

/* ==== Тост ==== */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(140px); background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: .9rem; transition: transform .3s; z-index: 70; pointer-events: none; max-width: 90vw; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: #b91c1c; }

/* ==== Модалка выбора города (первый заход) ==== */
.city-choice-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.city-choice { display: block; width: 100%; text-align: left; padding: 12px 16px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; font: inherit; font-size: 14px; font-weight: 700; color: #353535; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.city-choice:hover { border-color: #3a75bb; background: #f8fafc; color: #3a75bb; }
