/* Reset CSS */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Скрытие элементов только визуально (для скринридеров) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    font-size: 18px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Предотвращаем горизонтальную прокрутку */
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: bold;
}

h2 {
    font-size: 1.86rem;
    margin-bottom: 1.2rem;
}

p {
    margin-bottom: 1rem;
}

ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

/* Сброс стилей для хедера */
header {
    background-color: #2c3e50;
    color: white;
    padding: 0.9rem 0 0.7rem 0;
    width: 100%;
    margin: 0;
    line-height: 1.2;
    min-height: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

/* Настройка кнопки меню */
.hamburger-menu {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 100;
    margin-left: 1rem;
}

/* Настройка навигации */
.nav-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    border: none;
}

.nav-links {
    display: flex;
    list-style: none;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
}

.nav-links li {
    margin: 0 1.5rem;
    display: inline-block;
    padding: 0;
    border: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    text-transform: uppercase;
    font-size: 0.96rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0.3rem 0.5rem;
    display: inline-block;
    line-height: 1.2;
}

.nav-links a:hover, .nav-links a.active {
    color: #3498db;
}

/* Стили для логотипа */
.header-logo {
    padding-left: 1.5rem;
    order: -1;
}

.header-logo img {
    height: 40px;
    width: auto;
    vertical-align: middle;
    border-radius: 4px;
}

/* Основной контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    flex: 1 0 auto; /* flex-grow: 1, flex-shrink: 0, flex-basis: auto */
    width: 100%;
}

main {
    flex: 1;
    min-width: 0;
    margin-right: 2rem;
    margin-top: -25px; /* Отрицательный отступ для уменьшения расстояния между хедером и контентом */
    border-top: none;
}

aside {
    width: 300px;
}

aside section.sidebar-widget:first-of-type {
    margin-top: 130px;
}

#sidebar {
	margin-top: 90px;
}

/* Сайдбар */
.sidebar-widget {
    background-color: white;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-widget h2 {
    border-bottom: 2px solid #f1f1f1;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.sidebar-widget ul {
    list-style: none;
    padding-left: 0;
}

.sidebar-widget li {
    margin-bottom: 0.5rem;
}

/* Заголовок страницы */
.page-title {
    text-align: center;
    margin: 1.05rem 0;
    color: #2c3e50;
    font-size: 2.2rem;
    font-weight: bold;
}

/* Обертка для контента главной страницы */
.content-wrapper {
    margin-bottom: 2rem;
    position: relative;
    background-color: white;
}

.hero-image {
    margin-bottom: 0;
    border-radius: 5px 5px 0 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 0;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: bottom;
}

/* Статья на главной странице */
.article {
    background-color: white;
    padding: 2rem;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 0;
}

/* Ссылка для контакта */
.contact-link {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #2c3e50;
    color: white;
    border-radius: 0 0 5px 5px;
    text-align: center;
}

.contact-link a {
    color: #3498db;
    font-weight: bold;
}

.contact-link a:hover {
    color: #5dade2;
    text-decoration: none;
}

/* Страница контактов */
.contact-page {
    background-color: white;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Форма */
.contact-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

/* Уведомления */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.alert-success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.alert-danger {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* Подвал */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 2.5rem 1.5rem 1.5rem;
    margin-top: 2rem;
    width: 100%;
    flex-shrink: 0; /* Запрещаем сжатие */
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 0.6rem;
}

.footer-column a {
    color: #a4b0be;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    display: inline-block;
}

.footer-column a:hover {
    color: white;
    text-decoration: none;
}

.footer-column p {
    color: #a4b0be;
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

footer .footer-column .contact-item {
    margin-bottom: 0.8rem;
    padding: 0;
    background-color: transparent;
    border: none;
    border-left: none;
    border-radius: 0;
    transition: none;
}

footer .footer-column .contact-item:hover {
    transform: none;
    box-shadow: none;
}

footer .footer-column .contact-item strong {
    color: white;
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    font-weight: 600;
}

footer .footer-column .contact-item a {
    color: #3498db;
    font-size: 0.95rem;
    font-weight: normal;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer .footer-column .contact-item a:hover {
    color: white;
    text-decoration: none;
}

footer .footer-column .contact-item p {
    color: #a4b0be;
    margin: 0;
    font-size: 0.95rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #a4b0be;
    font-size: 0.9rem;
}

.footer-bottom p {
    margin: 0;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.social-links a {
    color: #a4b0be;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: white;
}

/* Стили для страницы "Продукция" */
.products-container {
    background-color: white;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.products-intro {
    margin-bottom: 2rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: auto;
    min-height: 120px;
}

.product-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-name {
    padding: 1rem;
    text-align: center;
}

.product-name h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.product-link:hover {
    transform: translateY(-5px);
    text-decoration: none;
}

/* Стили для страницы "О компании" */
.about-container {
    background-color: white;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.about-image {
    margin-bottom: 2rem;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

.about-content {
    line-height: 1.7;
}

.about-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.about-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Стили для страницы блокировки формы */
.blocked-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 2rem;
}

.blocked-message p {
    margin-bottom: 1rem;
}

.blocked-message strong {
    color: #721c24;
    font-weight: bold;
}

.return-link {
    text-align: center;
    margin-top: 2rem;
}

.return-link a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.return-link a:hover {
    background-color: #2980b9;
    text-decoration: none;
}

/* Стили для skip-link (для пользователей клавиатуры) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #2c3e50;
    color: white;
    padding: 8px;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}

/* Улучшенный фокус для элементов навигации */
a:focus, button:focus, input:focus, textarea:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Стили для footer-links (старые, для совместимости) */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links li {
    margin: 0 10px;
}

.footer-links a {
    color: #a4b0be;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
}

/* Улучшенная контрастность для текста */
.sidebar-widget h2 {
    color: #2c3e50;
    font-weight: bold;
}

.alert {
    font-weight: 500;
}

.container {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

main {
    flex: 1;
    min-width: 0;
    margin-right: 0; /* Убираем правый отступ, теперь используем gap */
    margin-top: 0; /* Убираем отрицательный отступ */
}

aside {
    width: 300px;
    margin-top: 0; /* Убираем отступ сверху */
}

/* Медиа-запросы для адаптивности */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
    }

    main {
        margin-right: 0;
        margin-bottom: -30px !important;
    }

    aside {
        width: 100%;
    }

    aside section.sidebar-widget:first-of-type {
        margin-top: 0 !important;
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0;
        position: sticky;
        top: 0;
        min-height: 3.2rem;
        margin-top: 0;
        border: none;
    }

    nav {
        margin-top: 0;
        padding-top: 0;
        border: none;
    }

    .hamburger-menu {
        display: block;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        left: 1rem;
        font-size: 1.8rem;
        margin-left: 0;
        border: none;
    }

    .header-logo {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        padding-right: 0;
        border: none;
    }

    .header-logo img {
        height: 32px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 0;
        border: none;
    }

    .nav-links.active {
        display: flex;
        margin-top: 1rem;
        padding-top: 0;
        padding-bottom: 1rem;
    }

    .nav-links li {
        margin: 0;
        padding: 0.3rem 0;
        border: none;
    }

    .nav-links a {
        border: none;
    }

    .article, .contact-page {
        padding: 1.5rem;
    }

    .page-title {
        padding: 0 1rem;
        margin: 0.84rem 0;
        font-size: 1.8rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .product-image {
        height: auto;
        min-height: 160px;
    }

    .products-container,
    .about-container {
        padding: 1.5rem;
    }

    main {
        margin-bottom: -30px !important;
        border-top: none;
    }

    aside section.sidebar-widget:first-of-type {
        margin-top: 0 !important;
    }

    .container {
        padding-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0;
    }

    .article, .contact-page {
        padding: 1rem;
    }

    .hero-image {
        margin-bottom: 0;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .product-image {
        height: auto;
        min-height: 120px;
    }

    .products-container,
    .about-container {
        padding: 1rem;
    }

    .container {
        padding-bottom: 2.5rem;
    }

    aside section.sidebar-widget:first-of-type {
        margin-top: 0;
    }

    main {
        margin-bottom: -30px !important;
    }

    .product-card {
        margin-bottom: 1.5rem;
    }

    .btn {
        padding: 0.85rem 1.5rem;
    }

    footer {
        margin-top: auto;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-column {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}