/* ========== Базовые стили ========== */
:root {
    --orange: #F97316;
    --orange-dark: #EA580C;
    --orange-light: #FFEDD5;
    --green: #22C55E;
    --green-dark: #16A34A;
    --green-light: #DCFCE7;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-600: #4B5563;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    color: var(--gray-800);
    background: white;
}

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

/* ========== Шапка ========== */
.header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 40px;
}

/* Логотип */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo__img {
    width: 40px;
    height: 40px;
}

.logo__text {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
}

.logo__dot {
    color: var(--orange);
}

/* Навигация */
.nav {
    display: flex;
    gap: 32px;
}

.nav__link {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    transition: var(--transition);
}

.nav__link:hover,
.nav__link--active {
    color: var(--orange);
}

/* Поиск */
.search {
    display: flex;
    background: var(--gray-100);
    border-radius: 40px;
    overflow: hidden;
}

.search__input {
    padding: 10px 16px;
    border: none;
    background: transparent;
    width: 250px;
    outline: none;
}

.search__btn {
    padding: 10px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.search__btn:hover {
    background: var(--gray-200);
}

/* ========== Hero блок ========== */
.hero {
    background: linear-gradient(135deg, var(--orange-light) 0%, white 100%);
    padding: 60px 0;
}

.hero__inner {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero__content {
    flex: 1;
}

.hero__title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero__title-accent {
    color: var(--orange);
    background: white;
    padding: 0 8px;
    border-radius: 12px;
}

.hero__desc {
    font-size: 18px;
    color: var(--gray-600);
    margin-bottom: 32px;
    max-width: 500px;
}

.hero__buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

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

.btn--primary:hover {
    background: var(--orange-dark);
    transform: translateY(-2px);
}

.btn--secondary {
    background: white;
    color: var(--orange);
    border: 2px solid var(--orange);
}

.btn--secondary:hover {
    background: var(--orange-light);
}

.hero-stats {
    display: flex;
    gap: 40px;
}

.hero-stats__number {
    font-size: 32px;
    font-weight: 700;
    color: var(--orange);
    display: block;
}

.hero-stats__label {
    color: var(--gray-600);
}

.hero__image {
    flex: 1;
}

.hero__image img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

/* ========== Секция категорий ========== */
.section-header {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--gray-800);
}

.section-subtitle {
    color: var(--gray-600);
    font-size: 18px;
}

.section-link {
    position: absolute;
    right: 0;
    top: 10px;
    color: var(--orange);
    text-decoration: none;
    font-weight: 500;
}

.categories {
    padding: 60px 0;
    background: var(--gray-50);
}

.categories__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.category-card {
    background: white;
    padding: 24px;
    text-align: center;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--orange);
}

.category-card__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--orange-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-card__icon img {
    width: 32px;
    height: 32px;
}

.category-card__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.category-card__count {
    font-size: 13px;
    color: var(--gray-600);
}

.category-card--more {
    background: var(--orange-light);
    border-color: var(--orange);
}

/* ========== Популярные продукты ========== */
.popular {
    padding: 60px 0;
}

.products__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: var(--transition);
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.product-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.product-card__title {
    font-size: 18px;
    font-weight: 600;
}

.product-card__category {
    font-size: 12px;
    color: var(--orange);
    background: var(--orange-light);
    padding: 4px 8px;
    border-radius: 20px;
}

.product-card__calories {
    text-align: center;
    padding: 16px;
    background: var(--gray-100);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

.product-card__calories-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--orange);
}

.product-card__calories-unit {
    font-size: 14px;
    color: var(--gray-600);
}

.product-card__macros {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.macro {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
}

.macro--protein {
    background: #EFF6FF;
}
.macro--protein .macro__value {
    color: #3B82F6;
}

.macro--fat {
    background: #FEF2F2;
}
.macro--fat .macro__value {
    color: #EF4444;
}

.macro--carbs {
    background: #F0FDF4;
}
.macro--carbs .macro__value {
    color: var(--green);
}

.macro__value {
    font-size: 18px;
    font-weight: 700;
    display: block;
}

.macro__label {
    font-size: 11px;
    color: var(--gray-600);
}

.product-card__btn {
    display: block;
    text-align: center;
    padding: 10px;
    background: var(--gray-100);
    color: var(--gray-800);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.product-card__btn:hover {
    background: var(--orange);
    color: white;
}

/* ========== Преимущества ========== */
.features {
    padding: 60px 0;
    background: var(--gray-50);
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.feature {
    text-align: center;
    padding: 32px 24px;
    background: white;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-4px);
}

.feature__icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature__title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature__desc {
    color: var(--gray-600);
    font-size: 14px;
}

/* ========== Подвал ========== */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 48px 0 24px;
}

.footer__inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer .logo__text {
    color: white;
}

.footer__desc {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.footer__title {
    color: white;
    font-size: 18px;
    margin-bottom: 20px;
}

.footer__links {
    list-style: none;
}

.footer__links li {
    margin-bottom: 12px;
}

.footer__links a {
    color: var(--gray-400);
    text-decoration: none;
    transition: var(--transition);
}

.footer__links a:hover {
    color: var(--orange);
}

.footer__bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--gray-800);
    font-size: 13px;
    color: var(--gray-500);
}

/* ========== Адаптивность ========== */
@media (max-width: 768px) {
    .header__inner {
        flex-direction: column;
        gap: 16px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .hero__inner {
        flex-direction: column;
    }

    .hero__title {
        font-size: 32px;
    }

    .features__grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer__inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .section-link {
        position: static;
        display: inline-block;
        margin-top: 12px;
    }
}
.category-filter.active {
    background: var(--orange) !important;
    color: white !important;
}

.category-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-card__category {
    transition: all 0.3s;
}

.product-card__category:hover {
    background: var(--orange) !important;
    color: white !important;
}
/* ========== Мобильная версия ========== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .hero__title {
        font-size: 28px;
    }

    .hero__buttons {
        flex-direction: column;
    }

    .btn {
        text-align: center;
    }

    .categories__grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .products__grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .features__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer__inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }

    /* Рекомендации на мобильных */
    .recommendation-card {
        margin-bottom: 0;
    }

    /* Хлебные крошки на мобильных */
    .breadcrumbs {
        font-size: 11px;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
    }

    /* Шапка на мобильных */
    .header__inner {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }

    .search {
        order: 2;
    }

    .search__input {
        width: 180px;
    }

    /* Детальная страница продукта */
    .product-detail {
        padding: 20px;
    }

    /* Блок с дополнительными показателями */
    .detail-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .categories__grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .category-card {
        padding: 12px;
    }

    .category-card__icon {
        width: 48px;
        height: 48px;
    }

    .category-card__icon img {
        width: 24px;
        height: 24px;
    }

    .product-card__macros {
        gap: 8px;
    }

    .macro {
        padding: 6px;
    }

    .macro__value {
        font-size: 14px;
    }

    /* Рекомендации - по 1 карточке в строку на очень маленьких экранах */
    .recommendations-grid {
        grid-template-columns: 1fr;
    }
}
/* ========== Детальная страница продукта ========== */
/* Десктопная версия - изображение слева, информация справа */
.product-detail-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.product-detail-image {
    flex: 1;
    max-width: 400px;
}

.product-detail-info {
    flex: 2;
}

/* Сетка рекомендаций - на десктопе 4 колонки */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ========== Мобильная версия (до 768px) ========== */
@media (max-width: 768px) {
    /* На мобильных - колонка, изображение после заголовка */
    .product-detail-layout {
        flex-direction: column;
        gap: 20px;
    }

    .product-detail-image {
        max-width: 100%;
        order: 2; /* Изображение после информации */
    }

    .product-detail-info {
        width: 100%;
        order: 1; /* Информация сверху */
    }

    /* Рекомендации на мобильных - 2 колонки */
    .recommendations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Очень маленькие экраны (до 480px) */
@media (max-width: 480px) {
    /* Рекомендации - 1 колонка */
    .recommendations-grid {
        grid-template-columns: 1fr;
    }

    .product-detail-image {
        order: 1; /* На очень маленьких экранах изображение сверху */
    }

    .product-detail-info {
        order: 2;
    }
}
/* ========== Детальная страница продукта ========== */
/* Скрываем дублирующийся заголовок на мобильных, если он есть */
.product-title {
    font-size: 28px;
    margin: 0 0 20px 0;
}

/* Десктопная версия - изображение слева, информация справа */
.product-detail-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.product-detail-image {
    flex: 1;
    max-width: 400px;
}

.product-detail-info {
    flex: 2;
}

/* Сетка рекомендаций - на десктопе 4 колонки */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ========== Мобильная версия (до 768px) ========== */
@media (max-width: 768px) {
    .product-title {
        font-size: 24px;
        margin: 0 0 15px 0;
    }

    /* На мобильных - колонка, изображение между заголовком и КБЖУ */
    .product-detail-layout {
        flex-direction: column;
        gap: 0;
    }

    .product-detail-image {
        max-width: 100%;
        margin-bottom: 20px;
    }

    .product-detail-info {
        width: 100%;
    }

    .kbju-block {
        margin-top: 0;
    }

    /* Рекомендации на мобильных - 2 колонки */
    .recommendations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Очень маленькие экраны (до 480px) */
@media (max-width: 480px) {
    /* Рекомендации - 1 колонка */
    .recommendations-grid {
        grid-template-columns: 1fr;
    }
}
