/* ============================================================
   CONCENTRATION.CSS — Калькулятор расчёта по желаемой концентрации
   ============================================================ */

:root {
    --accent: #87FF32;
    --accent-dark: #6fd43a;
    --white: #F4FBF3;
    --black: #101413;
    --primary: #2c7873;
    --secondary: #6fb98f;
    --light: #f0f7ee;
    --dark: #004445;
    --slider-start: #87FF32;
    --slider-end: #2ecc71;
    --text-dark: #101413;
    --text-medium: #444444;
    --text-light: #666666;
    --warning: #FF9A00;
    --good: #2ecc71;
    --low: #e74c3c;
    --danger: #e53935;
    --header-height: 80px;
    --transition: 0.3s ease;
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Manrope', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--black) 0%, #1a2a2a 100%);
    color: var(--white);
    min-height: 100vh;
    padding: 20px;
    padding-top: calc(var(--header-height) + 30px);
}

a {
    text-decoration: none;
    color: inherit;
}

/* Подключение шрифта Surpriz локально */
@font-face {
    font-family: 'Surpriz';
    src: url('fonts/Surpriz-Regular.woff2') format('woff2'),
         url('fonts/Surpriz-Regular.woff') format('woff'),
         url('fonts/Surpriz-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ============================================================
   ОБЩАЯ ШАПКА САЙТА (как на instruction.html/home.html)
   ============================================================ */
.header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 20px 0 20px;
    background: transparent;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.header-wrapper * {
    pointer-events: auto;
}

.header-wrapper.scrolled {
    padding-top: 8px;
    padding-bottom: 8px;
}

.header {
    max-width: 1200px;
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid rgba(16, 20, 19, 0.08);
    padding: 0 16px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.header-wrapper.scrolled .header {
    height: calc(var(--header-height) - 12px);
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
    cursor: pointer;
    margin-right: 5px;
}

.header-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--black);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    transition: transform var(--transition);
    flex-shrink: 0;
}

.header-logo-icon img {
    width: 62%;
    height: 62%;
    object-fit: contain;
    display: block;
}

.header-logo:hover .header-logo-icon {
    transform: scale(1.05) rotate(-4deg);
}

.header-logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.header-logo-text span {
    color: var(--text-dark);
}

.header-logo:hover .header-logo-text {
    color: var(--primary);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    flex-wrap: nowrap;
}

.header-nav li {
    position: relative;
    flex-shrink: 0;
}

.header-nav a {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-nav a i {
    font-size: 0.75rem;
    opacity: 0.5;
}

.header-nav a:hover {
    color: var(--text-dark);
    background: rgba(16, 20, 19, 0.05);
}

.header-nav a:hover i {
    opacity: 0.8;
    color: var(--primary);
}

.header-nav a.active {
    color: var(--primary);
    background: rgba(44, 120, 115, 0.08);
}

.header-nav a.active i {
    opacity: 1;
    color: var(--primary);
}

.header-nav a.delivery-btn {
    color: var(--text-light);
    background: transparent;
    border: none;
    padding: 5px 10px;
}

.header-nav a.delivery-btn:hover {
    color: var(--text-dark);
    background: rgba(16, 20, 19, 0.05);
}

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    z-index: 100;
    flex-shrink: 0;
    margin-left: 5px;
}

.burger span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: all var(--transition);
    transform-origin: center;
}

.burger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

@media (max-width: 880px) {
    :root { --header-height: 64px; }
    body { padding-top: calc(var(--header-height) + 20px); }
    .header-wrapper { padding: 8px 12px 0 12px; }
    .header { padding: 0 14px; height: var(--header-height); border-radius: 12px; }
    .header-wrapper.scrolled .header { height: calc(var(--header-height) - 8px); }
    .header-logo-text { font-size: 0.95rem; }
    .header-logo-icon { width: 30px; height: 30px; font-size: 15px; }

    .header-nav {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0; right: 0; bottom: 0; left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: var(--white);
        padding: 70px 30px 30px;
        gap: 2px;
        z-index: 60;
        align-items: stretch;
        overflow-y: auto;
        justify-content: flex-start;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .header-nav.open { display: flex; transform: translateX(0); }
    .header-nav a {
        font-size: 1.1rem;
        padding: 14px 18px;
        border-radius: 10px;
        justify-content: flex-start;
        white-space: normal;
        border: none;
        color: var(--text-dark);
    }
    .header-nav a:hover { background: rgba(16, 20, 19, 0.05); }
    .header-nav a.active { background: rgba(44, 120, 115, 0.08); color: var(--primary); }
    .header-nav a i { width: 28px; text-align: center; font-size: 1.1rem; opacity: 0.6; }
    .burger { display: flex; }
    body.menu-open { overflow: hidden; }
}

/* ============================================================
   КАРТОЧКА КАЛЬКУЛЯТОРА
   ============================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(16, 20, 19, 0.5);
    overflow: hidden;
    border: 1px solid rgba(135, 255, 50, 0.1);
}

header {
    background: linear-gradient(135deg, var(--black) 0%, #1a2a2a 100%);
    color: var(--white);
    padding: 30px;
    text-align: center;
    border-bottom: 2px solid var(--accent);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(135, 255, 50, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(111, 185, 143, 0.1) 0%, transparent 50%);
    z-index: 0;
}

.video-notice {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 20px;
    background: rgba(135, 255, 50, 0.1);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(135, 255, 50, 0.3);
    font-weight: 500;
    margin-top: 60px;
}

.header-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

.header-title-line1 {
    font-family: 'Surpriz', cursive;
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 1px;
}

.header-title-line2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--white);
    margin-top: 5px;
    opacity: 0.9;
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(244, 251, 243, 0.8);
    margin-top: 10px;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(135, 255, 50, 0.1);
    color: var(--accent);
    border: 1px solid rgba(135, 255, 50, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    z-index: 2;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.back-btn::before {
    content: "←";
    font-weight: 800;
    font-size: 1.2rem;
    line-height: 1;
}

.back-btn:hover {
    background: rgba(135, 255, 50, 0.2);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .header-title-line1 { font-size: 2.2rem; }
    .header-title-line2 { font-size: 1.3rem; }
    .video-notice { margin-top: 30px; }
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 30px;
}

@media (max-width: 768px) {
    .main-content { padding: 15px; }
}

.input-section, .result-section, .plant-section {
    background: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(16, 20, 19, 0.1);
    border: 1px solid rgba(16, 20, 19, 0.1);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .input-section, .result-section, .plant-section { padding: 20px; }
}

.input-section:hover, .result-section:hover, .plant-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 20, 19, 0.15);
}

.section-title {
    color: var(--text-dark);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-size: 1.6rem;
    position: relative;
    text-align: center;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: var(--accent);
    margin: 0 auto;
    right: 0;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-medium);
    display: block;
    margin-top: 10px;
    text-align: center;
    width: 100%;
    font-weight: 500;
}

.subsection-title {
    color: var(--text-dark);
    margin: 25px 0 15px 0;
    font-weight: 700;
    text-align: center;
    font-size: 1.35rem;
}

.input-group {
    margin-bottom: 25px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

input, select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    background: var(--white);
    color: var(--text-dark);
    font-family: 'Manrope', sans-serif;
}

input:focus, select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(135, 255, 50, 0.2);
}

/* Чекбокс "Нитрат без калия" */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding: 14px 16px;
    background: rgba(44, 120, 115, 0.05);
    border: 1px solid rgba(44, 120, 115, 0.15);
    border-radius: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dark);
}

button {
    border: none;
    padding: 16px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    font-family: 'Manrope', sans-serif;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(135, 255, 50, 0.3);
}

button:active {
    transform: translateY(0);
}

.calculate-container {
    text-align: center;
    margin: 30px 0;
}

.calculate-btn {
    width: 280px;
    padding: 18px 30px;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #87FF32 0%, #2ecc71 100%);
    border-radius: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-dark);
}

.result-card {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(16, 20, 19, 0.08);
    border-left: 4px solid var(--accent);
    border: 1px solid rgba(16, 20, 19, 0.1);
    transition: transform 0.3s ease;
}

.result-note {
    font-size: 0.95rem;
    color: var(--text-medium);
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e0e0e0;
    font-weight: 500;
}

.highlight {
    background-color: rgba(135, 255, 50, 0.15);
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid rgba(135, 255, 50, 0.3);
    color: var(--text-dark);
    font-weight: 600;
}

/* Таблица расхода удобрений */
.consumption-table-container {
    margin-top: 30px;
    overflow-x: auto;
}

.consumption-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .consumption-table { font-size: 0.85rem; }
    .consumption-table th, .consumption-table td { padding: 10px 8px; }
}

.consumption-table th {
    background: linear-gradient(135deg, var(--accent) 0%, #2ecc71 100%);
    color: var(--white);
    padding: 12px;
    text-align: center;
    font-weight: 700;
}

.consumption-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(16, 20, 19, 0.1);
    text-align: center;
    color: var(--text-dark);
    font-weight: 500;
}

.consumption-table tr:nth-child(even) { background-color: rgba(135, 255, 50, 0.05); }
.consumption-table tr:hover { background-color: rgba(135, 255, 50, 0.1); }

.export-btn {
    background: linear-gradient(135deg, #87FF32 0%, #2ecc71 100%);
    color: var(--text-dark);
    font-weight: 700;
    margin-top: 30px;
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
}

/* Анимация загрузки для PDF */
.pdf-loading {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(16, 20, 19, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.pdf-loading.active { display: flex; }

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(135, 255, 50, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 600;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Скрытый контейнер PDF */
.pdf-page {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 800px;
    background: white;
    padding: 40px;
    font-family: 'Manrope', sans-serif;
    margin-bottom: 20px;
    color: #000000;
    font-weight: 500;
}

.pdf-page-1 { page-break-after: always; }
.pdf-page-2 { page-break-after: always; }
.pdf-page-3 { page-break-before: always; }

.pdf-page table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
    color: #000000;
}

.pdf-page th {
    background-color: #f0f0f0;
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid #87FF32;
    font-weight: 700;
}

.pdf-page td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
}

.pdf-page h1, .pdf-page h2, .pdf-page h3 { color: #000000; font-weight: 700; }
.pdf-page h1 { color: #87FF32; }

.pdf-consumption-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 12px;
}

.pdf-consumption-table th {
    background: #f0f0f0;
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    font-weight: 700;
}

.pdf-consumption-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: center;
}

.footer-note {
    text-align: center;
    padding: 25px;
    color: var(--text-medium);
    font-size: 0.95rem;
    border-top: 1px solid rgba(16, 20, 19, 0.1);
    background: rgba(16, 20, 19, 0.02);
    font-weight: 500;
}

.contacts-footer {
    margin-top: 30px;
    padding: 20px;
    border-top: 1px solid rgba(16, 20, 19, 0.1);
}

.contacts-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .contacts-container { flex-direction: column; gap: 15px; }
}

.contact-item { text-align: center; }

@media (max-width: 768px) {
    .contact-item { text-align: left; }
}

.contact-label { font-weight: 700; color: var(--text-dark); margin-bottom: 5px; font-size: 1rem; }
.contact-value { color: var(--text-medium); font-weight: 500; }
.contact-link { color: var(--primary); text-decoration: none; transition: color 0.3s; }
.contact-link:hover { color: var(--accent); text-decoration: underline; }

/* Специфичные стили для этой страницы */
.concentration-info {
    background: rgba(135, 255, 50, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(135, 255, 50, 0.2);
    margin-bottom: 25px;
}

.concentration-info p {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-weight: 500;
}

.result-box {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    border: 2px solid var(--accent);
    box-shadow: 0 4px 12px rgba(135, 255, 50, 0.1);
}

.result-box h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(16, 20, 19, 0.1);
    padding-bottom: 10px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 10px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.result-item:last-child { border-bottom: none; }

.result-label { font-weight: 600; color: var(--text-dark); font-size: 1rem; }

.result-amount {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.2rem;
    background: rgba(135, 255, 50, 0.1);
    padding: 8px 15px;
    border-radius: 6px;
    min-width: 120px;
    text-align: center;
}

/* Заметка о сопутствующем элементе (калий из нитрата/фосфата, марганец из железа) */
.companion-note {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-top: -8px;
    font-style: italic;
}

/* Блок результата по калию (переменное содержимое) */
.k-result-box p {
    color: var(--text-dark);
    line-height: 1.6;
}

/* ===== КНОПКА КОРЗИНЫ В ШАПКЕ (как на остальном сайте) ===== */
.header-cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--black);
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 700;
    transition: all var(--transition);
}
.header-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 20, 19, 0.25);
}
.header-cart-btn i {
    font-size: 1.25rem;
}
.header-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent);
    color: var(--text-dark);
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--white);
}
@media (max-width: 880px) {
    .header-cart-btn {
        padding: 8px 10px;
        margin-left: 4px;
    }
    .header-cart-label {
        display: none;
    }
    .header-cart-btn i {
        font-size: 1.15rem;
    }
}
