/* ===== CSS-переменные ===== */
:root {
    --primary: #A6445B;
    --primary-dark: #A6445B;
    --secondary: #2EC4B6;
    --accent: #FFBF46;
    --bg: #ffffff;
    --surface: #FFE6EC;
    --text: #2D3436;
    --text-secondary: #636E72;
    --border: #f8a2b6;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius: 12px;
    --font-main: 'Segoe UI', Roboto, sans-serif;
    --font-headers: 'Segoe UI', Roboto, sans-serif;
    --header-height: 64px;
}

/* ===== Сброс и базовые стили ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Шапка ===== */
.header {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

/* ===== Навигация ===== */
.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }

/* ===== Бургер-меню (по умолчанию скрыто) ===== */
.burger-menu {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text);
}

/* ===== Поиск на главной ===== */
.search-bar-main {
    display: block;
    width: 100%;
    margin-bottom: 15px;
    position: relative;   /* <-- добавить эту строку */
}

.search-bar-main input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg);
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    color: var(--text);
}

.search-bar-main input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.15);
}

/* ===== Футер ===== */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

/* ===== Кнопка переключения темы ===== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 12px;
    padding: 6px;
    cursor: pointer;
    transition: background 0.2s, border 0.2s, box-shadow 0.2s;
}
.theme-toggle:hover { 
    background: var(--bg);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

/* ===== Тёмная тема ===== */
[data-theme="dark"] {
    --primary: #FF8A50;
    --primary-dark: #E55A2B;
    --secondary: #2EC4B6;
    --accent: #FFD166;
    --bg: #2D1B2E;
    --surface: #1E1621;
    --text: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border: #2a2a4a;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
}

/* Кнопка профиля в хедере */
.profile-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.profile-dropdown-toggle:hover {
    background: var(--bg);
}

.profile-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-name {
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.profile-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 200;
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.profile-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: var(--text);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
    text-align: left;
}

.profile-dropdown-menu .dropdown-item:hover {
    background: var(--bg);
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

.logout-item {
    color: #e74c3c !important;
}

/* Скрываем колокольчик, если нет авторизации */
body:not(.logged-in) .notification-bell {
    display: none;
}

@media (min-width: 769px) {
    .recipe-tags {
        display: flex !important;
    }
}