/* Общие стили */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

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

:root{
    --brand: #1E3F1B;
    --accent: #45a049;
    --text: #222222;
    --muted: #555555;
    --bg: #f9f9f9;
    --surface: #ffffff;
    --radius: 8px;
    --shadow: 0 6px 18px rgba(0,0,0,0.08);
    --container-max: 1200px;
}

/* Design tokens: typography and spacing */
:root{
    --font-base: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: Georgia, 'Times New Roman', serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    font-family: var(--font-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text);
    background-color: var(--bg);
}

.container {
    width: 90%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 15px;
}


/* Skip link для быстрой навигации с клавиатуры */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    background: var(--brand);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    z-index: 10000;
    text-decoration: none;
}

/* Шапка */
header {
    background-image: url('../images/logo.png');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    color: #1E3F1B;
    
    height: 380px; /* Немного увеличим общую высоту для комфорта */
    display: flex;
    align-items: flex-start; /* Начинаем сверху */
    padding-top: 20px;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Весь блок (заголовки + меню) будет слева */
    width: 100%;
}

.header-titles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex-direction: column;
    align-items: center; /* Центрирует "Питомник" строго под "Ульяновкой" */
    margin-bottom: 15px; /* Расстояние от надписей до меню */
}

.header-top {
    display: flex;
    align-items: center;
    gap: 15px;
}

header h1 {
    margin: 0;
    font-family: Montserrat, sans-serif;
    font-size: 6rem; /* Уменьшили с 6rem, чтобы освободить место */
    font-weight: 900;
    line-height: 1;
}

header p {
    font-family: Montserrat, sans-serif;
    color: #5D4037;
    font-size: 3rem; /* Уменьшили с 3rem */
    font-weight: 600;
    margin-top: 5px;
    letter-spacing: 2px;
}

header nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    padding: 0;
}

header nav ul li {
    margin: 0;
}

header nav ul li a {
    color: #5D4037;
    text-decoration: none;
    display: inline-block;
    padding: 0.5rem 1rem;
    position: relative;
    transition: color 0.3s ease;
}

/* Анимированное подчёркивание */
header nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

header nav ul li a:hover::after,
header nav ul li a[aria-current="page"]::after {
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
}

/* Активная ссылка */
header nav ul li a[aria-current="page"] {
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

header nav ul li a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Ссылка на VK рядом с заголовком */
.header-vk {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: background-color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.header-vk:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.header-vk img {
    width: 100px;
    height: 100px;
}


/* Фокус и доступность */
a, button {
    transition: box-shadow 0.18s, transform 0.12s, opacity 0.12s;
}

/* Use focus-visible so keyboard users see focus; preserve focus styles for accessibility */
a:focus-visible, button:focus-visible {
    box-shadow: 0 0 0 4px rgba(30,63,27,0.18);
    border-radius: 6px;
    outline: none;
}

/* Прочие элементы управления (кнопки, ссылки) */
.product-link, .load-more-btn, button {
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
}

/* Подвал */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem 0;
}

/* Внешние видимые кнопки (если нужны) можно определить через переменные темы */
.action-btn {
    color: #ffffff;
    background-color: var(--accent);
    text-decoration: none;
    font-size: 1rem;
    text-transform: uppercase;
    font-family: calibri, sans-serif;
    border-radius: 4px;
    border: 2px solid rgba(0,0,0,0.06);
    padding: 0.6rem 1rem;
    box-shadow: 0 6px 14px rgba(0,0,0,0.06);
    cursor: pointer;
    display: inline-block;
    outline: 2px dashed transparent;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 120ms ease;
}

@media (max-width: 480px) {
    .action-btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* (Dark mode support removed - site uses single theme) */

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

/* Планшеты средние: 768px и выше */
@media (min-width: 768px) and (max-width: 1024px) {
    header {
        height: 320px;
        padding-top: 15px;
    }
    
    header h1 {
        font-size: 3.5rem;
    }
    
    header p {
        font-size: 2rem;
    }
    
    header nav ul {
        justify-content: center;
    }
    
    #about h2, #catalog h2, #reviews h2, #news h2, #contact h2, #delivery h2 {
        font-size: 2rem;
    }
    
    #about p, #contact p, #delivery p {
        font-size: 1rem;
    }
    
    .gallery-about {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

/* Планшеты и поддерживаемые размеры: 621px-767px */
@media (min-width: 621px) and (max-width: 767px) {
    header {
        height: 280px;
        padding-top: 12px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    header p {
        font-size: 1.5rem;
    }
    
    header nav ul {
        justify-content: center;
    }
    
    header nav ul li {
        margin: 0.2rem;
    }
    
    header nav ul li a {
        padding: 0.4rem 0.7rem;
        font-size: 0.9rem;
    }
    
    .container {
        width: 92%;
    }
    
    #about h2, #catalog h2, #reviews h2, #news h2, #contact h2, #delivery h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    #about p, #contact p, #delivery p {
        font-size: 0.95rem;
    }
    
    .gallery-about {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.8rem;
    }
    
    .product-card {
        border-radius: 6px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-info {
        padding: 0.8rem;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Большие телефоны и малые планшеты: 481px-620px */
@media (min-width: 481px) and (max-width: 620px) {
    header {
        height: 240px;
        padding-top: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1.2rem;
        margin-top: 0;
    }
    
    .header-top {
        gap: 10px;
    }
    
    header nav ul {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    header nav ul li {
        margin: 0.15rem;
    }
    
    header nav ul li a {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .header-vk {
        width: 40px;
        height: 40px;
    }
    
    .header-vk img {
        width: 80px;
        height: 80px;
    }
    
    .container {
        width: 93%;
    }
    
    #about h2, #catalog h2, #reviews h2, #news h2, #contact h2, #delivery h2 {
        font-size: 1.6rem;
        margin-bottom: 1.3rem;
    }
    
    #about p, #contact p, #delivery p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    #about p:first-of-type {
        font-size: 0.95rem;
    }
    
    .gallery-about {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.8rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .product-card {
        border-radius: 6px;
    }
    
    .product-image {
        height: 130px;
    }
    
    .product-info {
        padding: 0.7rem;
    }
    
    .product-title {
        font-size: 0.95rem;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
    
    .product-description {
        font-size: 0.8rem;
    }
    
    .product-link {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .action-btn {
        padding: 0.65rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .category-btn {
        padding: 0.45rem 0.85rem;
        font-size: 0.85rem;
        margin: 0.2rem;
    }
    
    .load-more-btn {
        padding: 0.65rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Мобильные устройства: 320px-480px */
@media (max-width: 480px) {
    :root {
        --font-size-base: 14px;
        --space-md: 12px;
        --space-lg: 16px;
    }
    
    .container {
        width: 95%;
        padding: 0 12px;
    }
    
    html, body {
        font-size: 14px;
    }
    
    /* Header адаптация */
    header {
        height: auto;
        min-height: 200px;
        padding-top: 12px;
        padding-bottom: 15px;
        background-size: contain;
        background-position: center bottom;
    }
    
    header .container {
        align-items: center;
        text-align: center;
    }
    
    .header-titles {
        flex-direction: column;
        align-items: center;
        gap: 5px;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .header-top {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin: 0;
        word-break: break-word;
        line-height: 1.2;
    }
    
    header p {
        font-size: 1.1rem;
        margin: 0;
        letter-spacing: 1px;
    }
    
    .header-vk {
        width: 35px;
        height: 35px;
        flex-shrink: 0;
    }
    
    .header-vk img {
        width: 60px;
        height: 60px;
    }
    
    /* Навигация мобильная */
    header nav {
        width: 100%;
    }
    
    header nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2px;
        justify-content: center;
        margin: 0;
        padding: 0;
    }
    
    header nav ul li {
        margin: 0;
        width: auto;
    }
    
    header nav ul li a {
        display: inline-block;
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        text-align: center;
        border-radius: 4px;
        margin: 0;
        white-space: nowrap;
    }
    
    header nav ul li a::after {
        height: 2px;
    }
    
    /* Секции и заголовки */
    #about, #images, #catalog, #reviews, #news, #contact, #delivery {
        padding: 2rem 0 !important;
    }
    
    #about .container, #contact .container, #delivery .container {
        max-width: 100%;
    }
    
    #about h2, #catalog h2, #reviews h2, #news h2, #contact h2, #delivery h2 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    #about p, #contact p, #delivery p {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
        line-height: 1.6;
    }
    
    #about p:first-of-type {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }
    
    /* Галереи */
    .gallery-about {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .gallery-about-item img {
        height: auto;
        min-height: 200px;
    }
    
    /* Каталог */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .product-card {
        border-radius: 6px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 0.65rem;
    }
    
    .product-title {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .product-price {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }
    
    .product-description {
        font-size: 0.75rem;
        margin-bottom: 0.65rem;
    }
    
    .product-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Кнопки */
    .action-btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.8rem;
        min-height: 35px;
    }
    
    .category-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
        margin: 0.15rem;
    }
    
    .load-more-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
        min-height: 36px;
    }
    
    /* Фокус и доступность для мобильных */
    a:focus-visible, button:focus-visible {
        box-shadow: 0 0 0 3px rgba(30,63,27,0.25);
    }
    
    #categories-filter {
        margin-bottom: 1rem;
    }
    
    .review-platforms {
        margin-bottom: 1rem;
        gap: 0.5rem;
    }
    
    .platform-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
        margin: 0.1rem;
        min-height: 32px;
    }
}