:root {
    --bg-color: rgb(255, 249, 240);
    --accent-color: rgb(185, 158, 113);
    --text-color: rgb(89, 136, 157);
    --text-color-secondary: rgb(120, 150, 165);
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== NAVIGATION ========== */
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(185, 158, 113, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.site-nav:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

.brand-logo {
    height: 70px;
    width: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

.brand-logo:hover {
    transform: scale(1.08) rotate(-2deg);
}

.nav-list {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.nav-link:hover {
    background: rgba(185, 158, 113, 0.1);
    color: var(--accent-color);
}

.nav-link.active {
    background: var(--accent-color);
    color: var(--white);
}

.nav-link.active::after {
    display: none;
}

/* ========== TYPOGRAPHY ========== */
header {
    text-align: center;
    padding: 40px 20px 20px;
}

header img {
    max-width: 320px;
    transition: var(--transition);
}

header img:hover {
    transform: translateY(-4px);
}

h1 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

h2 {
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: var(--accent-color);
    letter-spacing: 2px;
    font-weight: 500;
    margin-bottom: 20px;
    text-transform: uppercase;
}

h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* ========== MAIN CONTENT ========== */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px;
}

.background-wrapper {
    width: 100%;
}

.content-container {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== MENU GRID ========== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 800px;
}

.menu-button {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px 20px;
    background: var(--white);
    color: var(--text-color);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.menu-button::before {
    content: "";
    position: absolute;
    width: 0;
    height: 100%;
    left: 50%;
    top: 0;
    background: linear-gradient(135deg, var(--accent-color) 0%, rgb(165, 138, 93) 100%);
    z-index: 0;
    transition: all 0.4s ease;
    transform: translateX(-50%);
}

.menu-button span {
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.menu-button:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.menu-button:hover::before {
    width: 100%;
}

.menu-button:hover span {
    color: var(--white);
}

.menu-button:active {
    transform: translateY(-2px);
}

/* ========== CARDS ========== */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(185, 158, 113, 0.1);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: var(--transition);
}

.card:hover img {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
}

.card h3 {
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.card h5 {
    margin-bottom: 12px;
    color: var(--text-color-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.card p {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.card a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: rgba(185, 158, 113, 0.1);
}

.card a:hover {
    background: var(--accent-color);
    color: var(--white);
    transform: translateX(4px);
}

/* ========== FORMS ========== */


form p {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

form p label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

form p input,
form p select,
form p textarea {
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid rgba(185, 158, 113, 0.3);
    border-radius: var(--radius-sm);
    background-color: var(--white);
    color: var(--text-color);
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

form p input:focus,
form p select:focus,
form p textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(185, 158, 113, 0.1);
}

/* ========== BUTTONS ========== */
button,
.btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, rgb(165, 138, 93) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 28px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    filter: brightness(1.1);
}

button:active,
.btn:active {
    transform: translateY(0);
}

/* ========== FOOTER ========== */
footer {
    text-align: center;
    padding: 24px;
    font-size: 0.9rem;
    border-top: 1px solid rgba(185, 158, 113, 0.2);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    margin-top: auto;
}

/* ========== POPUP ========== */
.popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 48px;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    border: 2px solid var(--accent-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popUp {
    0% {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.popup-backdrop {
    animation: fadeIn 0.3s ease-out;
}

.popup-content {
    animation: popUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.pagination a {
    background: var(--white);
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.pagination a:hover {
    background: var(--accent-color);
    color: var(--white);
    transform: translateY(-2px);
}

.pagination span {
    background: var(--accent-color);
    color: var(--white);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .site-nav {
        padding: 8px 12px;
    }

    .nav-list {
        gap: 4px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .brand-logo {
        height: 50px;
    }

    header {
        padding: 24px 16px 16px;
    }

    main {
        padding: 20px 16px;
    }

    .menu-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    h1 {
        font-size: 2rem;
    }

    .popup-content {
        margin: 20px;
        padding: 32px 24px;
    }

    .card:hover {
        transform: translateY(-3px);
    }
}

@media (max-width: 480px) {
    .brand-logo {
        height: 40px;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    form {
        padding: 20px;
    }
}

/* ========== UTILITIES ========== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.justify-center {
    justify-content: center;
}

.items-center {
    align-items: center;
}

/* ========== MESSAGES ========== */
.messages-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    font-weight: 600;
    animation: messageAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid;
}

@keyframes messageAppear {
    from {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.message-icon {
    font-size: 1.4rem;
    font-weight: bold;
    flex-shrink: 0;
}

.message-text {
    flex: 1;
    line-height: 1.5;
}

.message-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: var(--transition);
    color: inherit;
    flex-shrink: 0;
}

.message-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* Success */
.message-success {
    background: rgba(46, 213, 115, 0.95);
    color: white;
    border-left-color: rgb(30, 180, 90);
}

[data-theme="dark"] .message-success {
    background: rgba(46, 213, 115, 0.9);
}

/* Error */
.message-error {
    background: rgba(235, 77, 75, 0.95);
    color: white;
    border-left-color: rgb(200, 40, 40);
}

[data-theme="dark"] .message-error {
    background: rgba(235, 77, 75, 0.9);
}

/* Warning */
.message-warning {
    background: rgba(255, 168, 1, 0.95);
    color: white;
    border-left-color: rgb(220, 140, 0);
}

[data-theme="dark"] .message-warning {
    background: rgba(255, 168, 1, 0.9);
}

/* Info */
.message-info {
    background: rgba(52, 152, 219, 0.95);
    color: white;
    border-left-color: rgb(30, 120, 180);
}

[data-theme="dark"] .message-info {
    background: rgba(52, 152, 219, 0.9);
}

/* Debug */
.message-debug {
    background: rgba(149, 165, 166, 0.95);
    color: white;
    border-left-color: rgb(100, 110, 120);
}

@media (max-width: 768px) {
    .messages-container {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .message {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* ========== DARK THEME (теплая, сдержанная) ========== */
[data-theme="dark"] {
    --bg-color: #1b1a17; /* мягкий тёплый фон, не угольный */
    --accent-color: #b99b6b; /* бронзово-золотистый, родственный исходному */
    --text-color: #c9d2d8; /* светло-серый с голубоватым оттенком */
    --text-color-secondary: #9ba2a8; /* немного холоднее, для вторичного текста */
    --white: #252422; /* глубокий кофейный “белый” */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);
}

/* Общий фон */
[data-theme="dark"] body {
    background: linear-gradient(135deg, #1b1a17 0%, #2a2926 100%);
    color: var(--text-color);
}

/* Навигация */
[data-theme="dark"] .site-nav {
    background: rgba(37, 36, 34, 0.9);
    border-bottom: 1px solid rgba(185, 155, 107, 0.2);
}

[data-theme="dark"] .nav-link {
    color: var(--text-color);
}

[data-theme="dark"] .nav-link:hover {
    background: rgba(185, 155, 107, 0.1);
    color: var(--accent-color);
}

[data-theme="dark"] .nav-link.active {
    background: var(--accent-color);
    color: #1b1a17;
}

/* Карточки и меню */
[data-theme="dark"] .card,
[data-theme="dark"] .menu-button {
    background: var(--white);
    border-color: rgba(185, 155, 107, 0.15);
    color: var(--text-color);
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .menu-button:hover {
    border-color: var(--accent-color);
}

/* Формы */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #1e1d1a;
    border-color: rgba(185, 155, 107, 0.3);
    color: var(--text-color);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(185, 155, 107, 0.15);
}

/* Кнопки */
[data-theme="dark"] button,
[data-theme="dark"] .btn {
    background: linear-gradient(135deg, #b99b6b 0%, #9a7f55 100%);
    color: #1b1a17;
}

/* Пагинация */
[data-theme="dark"] .pagination a {
    background: var(--white);
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

[data-theme="dark"] .pagination a:hover {
    background: var(--accent-color);
    color: #1b1a17;
}

/* Футер */
[data-theme="dark"] footer {
    background: rgba(37, 36, 34, 0.85);
    border-top: 1px solid rgba(185, 155, 107, 0.2);
    color: var(--text-color-secondary);
}