/* ============ CSS-ПЕРЕМЕННЫЕ ============ */
:root {
    --primary: #0457B5;
    --primary-dark: #034499;
    --primary-light: #e8f0fb;
    --accent: #7BC15B;
    --accent-bg: #f0fbea;
    --warning: #ffc107;
    --warning-bg: #fff3cd;
    --danger: #e53935;
    --danger-bg: #fde8e8;
    --text: #2d2d2d;
    --text-muted: #666;
    --bg: #f5f7fa;
    --surface: #ffffff;
    --border: #e0e0e0;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 50px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 14px rgba(4, 87, 181, 0.12);
    --shadow-lg: 0 10px 30px rgba(4, 87, 181, 0.15);
    --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-dark); }

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

h1, h2, h3, h4 { font-family: var(--font-body); font-weight: 800; color: var(--text); line-height: 1.25; margin: 0 0 14px; }
h1 { font-size: 36px; }
h2 { font-size: 28px; color: var(--primary); }
h3 { font-size: 21px; color: var(--text); }
h4 { font-size: 17px; }
p { margin: 0 0 14px; }

@media (max-width: 700px) {
    h1 { font-size: 26px; }
    h2 { font-size: 22px; }
    h3 { font-size: 18px; }
}

/* ============ ШАПКА ============ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    gap: 20px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-main { font-weight: 800; font-size: 18px; color: var(--primary); }
.logo-sub { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.main-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}
.main-nav a {
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    padding: 6px 0;
    position: relative;
}
.main-nav a:hover { color: var(--primary); }
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.15s;
}
.main-nav a:hover::after { transform: scaleX(1); }
.burger {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 4px;
}
.burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}
@media (max-width: 760px) {
    .burger { display: flex; }
    .main-nav {
        position: absolute;
        top: 100%;
        right: 20px;
        left: 20px;
        background: var(--surface);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        padding: 14px;
        flex-direction: column;
        gap: 0;
        display: none;
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 12px 8px; border-bottom: 1px solid var(--border); }
    .main-nav a:last-child { border-bottom: 0; }
}

/* ============ ПОДВАЛ ============ */
.site-footer {
    background: var(--text);
    color: rgba(255,255,255,0.85);
    padding: 50px 0 0;
    margin-top: 60px;
}
.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 30px;
}
.footer-col h3 {
    color: white;
    font-size: 16px;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-tagline {
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    margin: 0;
}
.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-list li { margin-bottom: 8px; }
.footer-list a {
    color: rgba(255,255,255,0.75);
    font-size: 14px;
}
.footer-list a:hover { color: white; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 20px 0;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    line-height: 1.5;
}
@media (max-width: 800px) {
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 30px; }
}
@media (max-width: 500px) {
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}

/* ============ HERO ============ */
.hero {
    background: linear-gradient(135deg, #0457B5 0%, #023a7d 100%);
    color: white;
    padding: 60px 0 80px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(123,193,91,0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,193,7,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.hero-h1 {
    color: white;
    font-size: 44px;
    margin-bottom: 10px;
    max-width: 800px;
    position: relative;
    z-index: 2;
}
.hero-sub {
    font-size: 18px;
    color: rgba(255,255,255,0.85);
    max-width: 700px;
    margin: 0 0 32px;
    position: relative;
    z-index: 2;
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 18px;
    position: relative;
    z-index: 2;
}
.hero-stat {
    background: rgba(255,255,255,0.1);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
}
.hero-stat strong {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: white;
    line-height: 1;
    margin-bottom: 4px;
}
.hero-stat span {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}
@media (max-width: 700px) {
    .hero { padding: 40px 0 50px; }
    .hero-h1 { font-size: 30px; }
    .hero-sub { font-size: 16px; }
}

/* ============ КОНСТРУКТОР ============ */
.constructor-section {
    margin-top: -40px;
    margin-bottom: 60px;
    position: relative;
    z-index: 3;
}
.calculator-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 24px;
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0,0,0,0.04);
}
@media (max-width: 700px) {
    .calculator-container { padding: 16px; }
    .constructor-section { margin-top: -30px; }
}

/* ============ ПРОГРЕСС ШАГОВ ============ */
.steps-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    padding: 0 10px;
    position: relative;
    gap: 10px;
    flex-wrap: wrap;
}
.steps-progress::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}
.step-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 70px;
    cursor: pointer;
    position: relative;
    z-index: 2;
}
.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #999;
    transition: all 0.3s ease;
    font-size: 16px;
    position: relative;
}
.step-marker.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(4, 87, 181, 0.35);
}
.step-marker.done .step-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.step-marker.done .step-circle::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}
.step-marker.done .step-circle .step-number { display: none; }
.step-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: center;
    line-height: 1.2;
    font-weight: 600;
}
.step-marker.active .step-label { color: var(--primary); }

.step-panel { display: none; animation: fadeIn 0.4s ease; }
.step-panel.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.step-title { color: var(--primary); font-size: 24px; margin: 0 0 6px; font-weight: 800; }
.step-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }
.opt-label { display: block; font-weight: 700; margin-bottom: 8px; color: var(--text); }

/* ============ КАРТОЧКИ ДИЕТ ============ */
.diet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 12px 0;
}
.diet-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    position: relative;
}
.diet-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.diet-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary-light) 0%, #f0f7ff 100%);
    box-shadow: 0 4px 16px rgba(4, 87, 181, 0.2);
}
.diet-card.selected::before {
    content: '';
    position: absolute;
    top: 8px; right: 8px;
    width: 22px; height: 22px;
    background: var(--primary);
    border-radius: 50%;
}
.diet-card.selected::after {
    content: '';
    position: absolute;
    top: 12px; right: 16px;
    width: 5px; height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.diet-icon { width: 56px; height: 56px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; }
.diet-icon svg { width: 100%; height: 100%; }
.diet-name { font-weight: 700; color: var(--text); margin-bottom: 4px; font-size: 14px; }
.diet-tag {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    background: var(--accent-bg);
    color: #2e7d32;
    border-radius: var(--radius-lg);
    font-weight: 700;
}
.diet-tag.advanced { background: var(--warning-bg); color: #b07d00; }
.diet-tag.strict { background: var(--danger-bg); color: #c62828; }

/* Карточки диет на странице-каталоге */
.diet-card-static {
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: all 0.2s;
    text-align: left;
    display: block;
    color: var(--text);
}
.diet-card-static:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.diet-card-static .diet-short {
    font-size: 13px;
    color: var(--text-muted);
    margin: 6px 0 10px;
}

/* ============ ОПЦИИ ============ */
.option-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.option-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}
.option-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.option-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(4, 87, 181, 0.15);
}
.option-card .opt-icon { width: 40px; height: 40px; margin: 0 auto 6px; }
.option-card .opt-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.option-card .opt-desc { font-size: 12px; color: var(--text-muted); }

/* ============ ИНПУТЫ И КНОПКИ ============ */
.calculator-input { margin: 14px 0; }
.calculator-input label { display: block; margin-bottom: 8px; font-weight: 700; }
.calculator-input input, .calculator-input select {
    width: 100%;
    padding: 12px 18px;
    border: 1.5px solid #ccc;
    border-radius: var(--radius-lg);
    font-size: 16px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.calculator-input input:focus, .calculator-input select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(4,87,181,0.12);
}
.input-hint { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.step-nav {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}
.step-nav button {
    flex: 1;
    padding: 13px 20px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.btn-back { background: white; border: 2px solid var(--primary); color: var(--primary); }
.btn-back:hover { background: var(--primary-light); }
.btn-next { background: var(--primary); border: 2px solid var(--primary); color: white; }
.btn-next:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-back:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============ ПЛАН: ТУЛБАР ============ */
.plan-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    margin: 16px 0;
}
.plan-stat { flex: 1; min-width: 100px; text-align: center; padding: 4px; }
.plan-stat-num {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.plan-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    font-weight: 600;
}

/* ============ НАВИГАЦИЯ ПО ДНЯМ ============ */
.day-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
}
.day-nav-btn {
    width: 42px;
    height: 42px;
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.day-nav-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}
.day-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.day-nav-info {
    flex: 1;
    font-weight: 800;
    color: var(--primary);
    font-size: 18px;
    text-align: center;
}
.day-nav-info small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: normal;
    margin-top: 2px;
}

.day-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 10px 0;
    max-height: 96px;
    overflow-y: auto;
    padding: 4px;
}
.day-chip {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.day-chip:hover { border-color: var(--primary); transform: scale(1.05); }
.day-chip.active { background: var(--primary); border-color: var(--primary); color: white; }
.day-chip.done { background: var(--accent); border-color: var(--accent); color: white; }

/* ============ КАРТОЧКИ ПРИЕМОВ ПИЩИ ============ */
.meal-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin: 10px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
    transition: box-shadow 0.2s;
    animation: slideIn 0.3s ease;
}
.meal-card:hover { box-shadow: var(--shadow-sm); }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.meal-card-static {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin: 10px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.meal-time-block {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    min-width: 80px;
    text-align: center;
    flex-shrink: 0;
}
.meal-time-icon { width: 24px; height: 24px; margin: 0 auto 4px; }
.meal-time-text { font-size: 13px; font-weight: 700; }
.meal-body { flex: 1; min-width: 200px; }
.meal-title { font-weight: 700; margin-bottom: 4px; font-size: 15px; }
.meal-info { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.meal-macros { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.macro-pill {
    background: var(--accent-bg);
    color: #2e7d32;
    padding: 3px 10px;
    border-radius: var(--radius-lg);
    font-weight: 700;
}
.macro-pill.kcal { background: var(--primary-light); color: var(--primary); }
.macro-pill.p { background: var(--primary-light); color: var(--primary); }
.macro-pill.f { background: var(--warning-bg); color: #b07d00; }
.macro-pill.c { background: var(--accent-bg); color: #2e7d32; }
.meal-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.meal-btn {
    padding: 6px 14px;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--primary);
    background: white;
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.15s;
    font-family: inherit;
}
.meal-btn:hover { background: var(--primary-light); }
.meal-btn.done-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.meal-btn.skip-btn.active { background: var(--danger); border-color: var(--danger); color: white; }

.custom-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 16px 0;
}
.custom-add-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr 0.8fr auto;
    gap: 8px;
    align-items: stretch;
}
.custom-add-row select, .custom-add-row input {
    padding: 10px 14px;
    border: 1.5px solid #ccc;
    border-radius: var(--radius-lg);
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}
.custom-add-row button {
    padding: 10px 20px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    font-family: inherit;
    transition: background 0.15s;
}
.custom-add-row button:hover { background: var(--primary-dark); }
@media (max-width: 700px) {
    .custom-add-row { grid-template-columns: 1fr; }
}

/* ============ ИНСТРУМЕНТЫ ============ */
.tools-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.tool-btn {
    flex: 1;
    min-width: 130px;
    padding: 12px 14px;
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}
.tool-btn:hover { background: var(--primary); color: white; }
.tool-btn svg { width: 16px; height: 16px; }
.tool-btn.primary { background: var(--primary); color: white; }
.tool-btn.primary:hover { background: var(--primary-dark); }

/* ============ ПРОГРЕСС-БАР ============ */
.progress-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 8px 0;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #5fa83c 100%);
    transition: width 0.4s ease;
    border-radius: var(--radius-lg);
}

.dose-row {
    background-color: var(--accent-bg);
    border-left: 3px solid var(--accent);
    padding: 10px 14px;
    margin: 10px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.info-note {
    background-color: var(--accent-bg);
    border-left: 4px solid var(--accent);
    padding: 12px 16px;
    margin: 14px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.warning {
    background-color: var(--warning-bg);
    border-left: 4px solid var(--warning);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.error-block {
    background-color: var(--danger-bg);
    border-left: 4px solid var(--danger);
    padding: 12px 16px;
    margin-top: 16px;
    display: none;
    font-size: 14px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.shop-list {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 14px;
    display: none;
}
.shop-list.active { display: block; animation: fadeIn 0.3s ease; }
.shop-list h3 { color: var(--primary); margin-top: 0; }
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
}
.shop-item {
    background: var(--accent-bg);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    border-left: 3px solid var(--accent);
}

/* ============ КОНТЕНТНЫЕ БЛОКИ НА ГЛАВНОЙ ============ */
.content-block { padding: 50px 0; }
.content-block-text p { font-size: 16px; color: #333; }
.content-block-text ul { padding-left: 20px; }
.content-block-text li { margin: 8px 0; }
.block-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}
.block-header h2 { margin: 0; }
.block-link {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
}

/* ============ КАРТОЧКИ МЕНЮ ============ */
.menus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.menu-card {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.2s;
    position: relative;
}
.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.menu-card-link {
    display: block;
    padding: 18px;
    color: var(--text);
    text-decoration: none;
}
.menu-card-title {
    color: var(--primary);
    font-size: 17px;
    margin: 0 0 8px;
    font-weight: 800;
    line-height: 1.3;
}
.menu-card-desc {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 0 12px;
    line-height: 1.5;
}
.menu-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.menu-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-weight: 700;
}
.menu-tag.big { padding: 6px 14px; font-size: 14px; }
.menu-meta-item {
    background: #f5f5f5;
    color: var(--text-muted);
    padding: 3px 10px;
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-weight: 600;
}
.menu-card-likes {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.menu-card-likes strong { color: var(--text); }
.menu-views { margin-left: auto; }

/* ============ КАТЕГОРИИ-ТАГИ ============ */
.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.category-pill {
    padding: 10px 18px;
    background: white;
    border: 2px solid var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 700;
    transition: all 0.15s;
}
.category-pill:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ============ СТРАНИЦА МЕНЮ ============ */
.breadcrumbs {
    padding: 16px 20px;
    font-size: 13px;
    color: var(--text-muted);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .current { color: var(--text); font-weight: 700; }
.breadcrumbs span:not(.current) { margin: 0 6px; }

.menu-page { padding-bottom: 40px; }
.menu-head { margin-bottom: 30px; }
.menu-head h1 { font-size: 32px; margin-bottom: 10px; color: var(--text); }
.menu-lead {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 18px;
}
.menu-head-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.like-block {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.like-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid var(--danger);
    background: white;
    color: var(--danger);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.like-btn:hover { background: var(--danger-bg); transform: translateY(-1px); }
.like-btn.liked {
    background: var(--danger);
    color: white;
}
.like-btn.liked:hover { background: #c62828; }
.like-btn.bumping { animation: heartBump 0.4s ease; }
@keyframes heartBump {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.18); }
    60% { transform: scale(0.95); }
}
.like-count { font-size: 18px; font-weight: 800; }
.menu-stats-secondary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}

.menu-summary { margin-bottom: 30px; }
.menu-days { margin-bottom: 30px; }
.menu-day-acc {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 10px;
    overflow: hidden;
}
.menu-day-acc summary {
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 800;
    color: var(--primary);
    list-style: none;
    position: relative;
    user-select: none;
}
.menu-day-acc summary::-webkit-details-marker { display: none; }
.menu-day-acc summary::after {
    content: '+';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--primary);
    transition: transform 0.2s;
}
.menu-day-acc[open] summary::after { content: '−'; }
.menu-day-body {
    padding: 0 18px 14px;
    border-top: 1px solid var(--border);
}

.menu-cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 30px;
    border-radius: var(--radius-md);
    text-align: center;
    margin: 30px 0;
}
.menu-cta h2 { color: white; }
.menu-cta p { color: rgba(255,255,255,0.85); }
.cta-btn {
    display: inline-block;
    padding: 14px 28px;
    background: white;
    color: var(--primary);
    border-radius: var(--radius-lg);
    font-weight: 800;
    margin-top: 8px;
    transition: all 0.15s;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--primary); }

.category-header {
    padding: 30px 20px;
}
.category-header h1 { font-size: 32px; color: var(--text); }
.category-header .lead {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

/* ============ МОДАЛКА ============ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    animation: fadeBg 0.2s ease;
}
@keyframes fadeBg { from { opacity: 0; } to { opacity: 1; } }
.modal-window {
    position: relative;
    background: white;
    border-radius: var(--radius-md);
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-window h2 { color: var(--primary); margin: 0 0 8px; }
.modal-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }
.modal-window input, .modal-window textarea {
    width: 100%;
    padding: 10px 16px;
    border: 1.5px solid #ccc;
    border-radius: var(--radius-lg);
    font-size: 15px;
    box-sizing: border-box;
    margin-bottom: 14px;
    font-family: inherit;
}
.modal-window textarea { border-radius: var(--radius-md); resize: vertical; }
.modal-window input:focus, .modal-window textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(4,87,181,0.12);
}
.modal-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    background: #f5f5f5;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-muted);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-actions { display: flex; gap: 10px; margin-top: 10px; }
.modal-actions button { flex: 1; padding: 12px 18px; border-radius: var(--radius-lg); font-weight: 700; font-size: 15px; cursor: pointer; border: 2px solid var(--primary); font-family: inherit; }
.modal-info {
    background: var(--accent-bg);
    border-left: 3px solid var(--accent);
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-top: 8px;
    display: none;
}
.modal-info.show { display: block; }
.modal-error {
    background: var(--danger-bg);
    border-left: 3px solid var(--danger);
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-top: 8px;
    color: #c62828;
}

@media print {
    .site-header, .site-footer, .steps-progress,
    .calculator-input, .step-nav, .meal-actions,
    .tools-row, .diet-grid, .option-cards,
    .day-nav, .custom-add-row, .day-quick,
    .like-block, .menu-cta, .modal, .breadcrumbs { display: none !important; }
    .meal-card, .meal-card-static { break-inside: avoid; }
    body { background: white; }
}

/* ============ РЕКЛАМНАЯ ЗОНА ПОД ШАПКОЙ ============ */
.ad-zone {
    background: #f5f7fa;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}
.ad-zone-inner {
    display: grid;
    gap: 14px;
    align-items: center;
}
.ad-zone-single .ad-zone-inner {
    grid-template-columns: 1fr;
    justify-items: center;
}
.ad-zone-double .ad-zone-inner {
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
}
@media (max-width: 800px) {
    .ad-zone-double .ad-zone-inner {
        grid-template-columns: 1fr;
    }
}
.ad-slot {
    position: relative;
    min-height: 60px;
    width: 100%;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ad-slot-primary { min-height: 90px; }
.ad-slot-secondary { min-height: 90px; }
.ad-label {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    pointer-events: none;
}
.ad-body {
    width: 100%;
    text-align: center;
    line-height: 0;
}
.ad-body > * { line-height: normal; }
.ad-body img, .ad-body iframe {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

@media print {
    .ad-zone { display: none !important; }
}
