:root {
    color-scheme: light dark;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', Roboto, Helvetica, Arial, sans-serif;
    background: #fafafa;
    min-height: 100vh;
    padding: 0;
    color: #1a1a1a;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
}

.menu-header {
    background: #ffffff;
    padding: 24px 20px 16px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.menu-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.menu-subtitle {
    font-size: 14px;
    color: #666666;
    font-weight: 400;
}

.categories-nav {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 16px 20px;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 99;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.92);
}

.categories-nav::-webkit-scrollbar {
    display: none;
}

.category-chip {
    background: transparent;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #666666;
    position: relative;
}

.category-chip:hover {
    color: #1a1a1a;
    background: #f8f8f8;
}

.category-chip.active {
    background: #1a1a1a;
    color: #ffffff;
}

.menu-content {
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    gap: 48px;
}

.category-section {
    background: transparent;
    scroll-margin-top: 70px;
}

.category-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.dishes-grid {
    display: grid;
    gap: 24px;
}

.dish-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.dish-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.dish-card:active {
    transform: translateY(-2px);
}

.dish-photo {
    width: 100%;
    height: 240px;
    object-fit: cover;
    background: #f8f8f8;
}

.dish-photo.placeholder {
    background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    filter: grayscale(0.3);
}

.dish-info {
    padding: 20px;
}

.dish-name {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.dish-description {
    font-size: 14px;
    color: #666666;
    margin-bottom: 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dish-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f5f5f5;
}

.dish-price {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.dish-weight {
    font-size: 13px;
    color: #999999;
    margin-top: 4px;
    font-weight: 400;
}

.like-button {
    background: #f8f8f8;
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 15px;
    font-weight: 500;
    color: #666666;
}

.like-button:hover {
    background: #f0f0f0;
}

.like-button:active {
    transform: scale(0.96);
}

.like-button.liked {
    background: #ff3b30;
    color: #ffffff;
}

.like-button.liked:hover {
    background: #ff2d21;
}

.like-count {
    font-weight: 600;
    font-size: 14px;
}

.loading, .empty-state {
    text-align: center;
    padding: 60px 24px;
    color: #999999;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* --- АДАПТИВНОСТЬ --- */

@media (min-width: 768px) {
    .dishes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }

    .menu-content {
        padding: 48px 40px;
        gap: 64px;
    }

    .category-title {
        font-size: 32px;
        margin-bottom: 32px;
    }

    .dish-photo {
        height: 280px;
    }
}

@media (min-width: 1024px) {
    .container {
        box-shadow: 0 0 80px rgba(0, 0, 0, 0.05);
    }

    .dishes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .menu-header {
        padding: 32px 20px 20px;
    }

    .menu-header h1 {
        font-size: 28px;
    }

    .categories-nav {
        padding: 16px 20px;
        gap: 8px;
    }

    .category-chip {
        padding: 8px 16px;
        font-size: 14px;
    }

    .menu-content {
        padding: 24px 20px;
        gap: 40px;
    }

    .category-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .dish-card {
        border-radius: 12px;
    }

    .dish-photo {
        height: 200px;
    }

    .dish-info {
        padding: 16px;
    }

    .dish-name {
        font-size: 18px;
    }

    .dish-description {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .dish-price {
        font-size: 22px;
    }

    .dish-price-row {
        margin-top: 12px;
        padding-top: 12px;
    }
}

/* --- ТЕМНАЯ ТЕМА --- */

@media (prefers-color-scheme: dark) {
    body {
        background: #000000;
        color: #ffffff;
    }

    .container {
        background: #000000;
    }

    .menu-header {
        background: #000000;
        border-bottom-color: #1c1c1e;
    }

    .menu-header h1 {
        color: #ffffff;
    }

    .menu-subtitle {
        color: #8e8e93;
    }

    .categories-nav {
        background: rgba(0, 0, 0, 0.88);
        border-bottom-color: #1c1c1e;
    }

    .category-chip {
        color: #8e8e93;
    }

    .category-chip:hover {
        color: #ffffff;
        background: #1c1c1e;
    }

    .category-chip.active {
        background: #ffffff;
        color: #000000;
    }

    .category-section {
        background: transparent;
    }

    .category-title {
        color: #ffffff;
    }

    .dish-card {
        background: #121212;
        border-color: #1c1c1e;
    }

    .dish-card:hover {
        box-shadow: 0 8px 24px rgba(255, 255, 255, 0.03);
    }

    .dish-photo {
        background: #1a1a1a;
    }

    .dish-photo.placeholder {
        background: linear-gradient(135deg, #1c1c1e 0%, #121212 100%);
    }

    .dish-name {
        color: #ffffff;
    }

    .dish-description {
        color: #8e8e93;
    }

    .dish-price {
        color: #ffffff;
    }

    .dish-weight {
        color: #636366;
    }

    .dish-price-row {
        border-top-color: #1c1c1e;
    }

    .like-button {
        background: #1c1c1e;
        color: #8e8e93;
    }

    .like-button:hover {
        background: #2c2c2e;
    }

    .like-button.liked {
        background: #ff3b30;
        color: #ffffff;
    }
}