/* front-page.css – стили для дополнительной секции "Рекомендуем" на главной */

.video-background {
    position: relative;
    overflow: hidden;
    min-height: 685px;
    display: flex;
    align-items: center;
    color: #fff; /* если текст должен быть белым на видео */
}
.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

/* По умолчанию (десктоп) видео показываем, картинку скрываем */
.video-background .bg-video {
    display: block;
}
.video-background .mobile-bg-img {
    display: none;
}

/* Планшеты и телефоны: скрываем видео, показываем картинку */
@media (max-width: 768px) {
    .video-background .bg-video {
        display: none;
    }
    .video-background .mobile-bg-img {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: -1;
    }
}


.recommended {
    padding: 60px 0;
    background: transparent; /* или цвет фона, если нужен */
}

.recommended-content:not(:first-child){
    margin-top: 36px;
}

.recommended h2 {
    font-size: var(--font-head2);
    font-weight: 600;
    margin-bottom: 40px;
    text-align: center; /* по желанию */
    color: var(--text-dark, #333);
}

/* сетка товаров */
/* =============================================
   ОБЪЕДИНЁННЫЕ СТИЛИ ДЛЯ .recommended
   (учтены theme.css, style.css, responsive.css, main.css)
   ============================================= */
/* Hover-цвет для заголовков карточек (из theme.css) */
.product-card:hover h4,
.catalog-item:hover h4 {
    color: var(--primary-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: transparent;
    overflow: hidden;
    transition: transform 0.3s;
    text-align: center;
    padding: 20px;
}

.product-img {
    cursor: pointer;
}

.product-img-placeholder {
    width: 100%;
    height: 150px;
    background: transparent;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* обрезает изображение, если оно больше контейнера */
}

.product-card h4 {
    margin: 15px 0 0;
}

/* Фон и отступы блока */
.recommended {
    background-image: /*url(../img/header.png),*/ url(../img/sales_top.jpg);
    background-size: 100% 100%;
    background-repeat: repeat-x, no-repeat;
    padding: 60px 0;           /* перебивает 70px из style.css */
}

.recommended h2 {
    font-size: var(--font-head2);
    font-weight: 600;
    margin-bottom: 40px;
    color: #333;
}

.product-card a {
    display: block;
    text-align: center;
    text-decoration: none;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: none;
}

.product-card .product-img {
    margin-bottom: 15px;
}

.product-card .product-img img,
.product-card .product-img picture {
    width: 100%;
    height: 100%;
    object-fit: cover; /* заполняет весь блок, обрезая края при необходимости */
    display: block;
}

.product-card h4 {
    font-size: var(--font-head4);
    font-weight: 500;
    color: #333;
    margin: 10px 0 0;
    transition: none;
}

.product-card a:hover,
.product-card a:focus,
.product-card a:active {
    background: transparent;
    border: none;
    box-shadow: none;
    transform: none;
}

.product-card a:hover h4 {
    color: #333;             
}

/* ===== Секция "Продукция" ===== */
.catalog {
    padding: 60px 0;
    background: #fff;
}

.catalog .section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.section-header h2 {
    font-size: var(--font-head2);
    font-weight: 600;
    color: #333;
}

.catalog .all-link {
    color: var(--primary-color, #E02E7A);
    font-weight: 500;
    text-decoration: none;
}
.catalog .all-link:hover {
    text-decoration: underline;
}

.catalog .items.flexbox {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch; /* обеспечивает одинаковую высоту карточек в ряду */
}

/* Обёртка-ссылка — управляет шириной и выравниванием высоты */
.catalog .item-link {
    display: flex;          /* включаем flex, чтобы внутренний .item растягивался */
    width: 25%;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    color: inherit;
}

/* Внутренний блок .item теперь будет занимать всю высоту ссылки */
.catalog .item-link .item {
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;               /* растягиваем на всю доступную высоту */
}

/* Карточка с тенью и рамкой */
.catalog .item.shadow.border {
    background: #fff;
    border: 1px solid #e8e8e8;
    margin: 0 -1px -1px 0;
    transition: all 0.3s ease;
}

.catalog .item .wrap {
    position: relative;
    display: block;
    padding: 20px 15px;
    text-align: center;
    flex: 1;               /* чтобы содержимое внутри .wrap тоже растягивалось */
}

.catalog .item .image {
    margin-bottom: 15px;
}

.catalog .item .image .wrap {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.catalog .product-img-placeholder {
    width: 100%;
    max-width: 120px;
    height: 100px;
    /* background: #f5f5f5; */
    background: #fff;
    display: block;
    margin: 0 auto;
}

.catalog .item .body-info .title {
    font-size: var(--font-small);
    font-weight: 500;
}

/* Текст (span) */
.catalog .item .body-info .title .dark-color {
    color: #333;
    transition: color 0.2s;
    cursor: pointer;
}

/* Hover на всю карточку — тень и рамка */
.catalog .item-link:hover .item.shadow.border {
    box-shadow: 0 5px 25px 0 rgba(18, 25, 38, 0.1);
    border-color: transparent;
    z-index: 1;
}

/* Цвет текста меняется ТОЛЬКО при наведении непосредственно на span */
.catalog .item-link .body-info .title .dark-color:hover {
    color: var(--primary-color, #E02E7A) !important;
}

/* about */
.about-wrapper {
    display: flex;
    gap: 50px;
    align-items: center;
    flex-wrap: wrap;
}
.about-text {
    flex: 1;
}
.about-image {
    flex: 1;
}
.about-img-placeholder {
    height: 300px;
}
.about-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* контакты */
.contacts-wrapper {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}
.contacts-info {
    flex: 1;
}
.contacts-map {
    flex: 1;
}
.map-placeholder {
    width: 100%;
    height: 300px;
    background: #d9d9d9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.contact-item {
    margin-bottom: 20px;
}
.contact-item strong {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

/* форма запроса */
.form-block {
    display: flex;
    gap: 40px;
    align-items: center;
    background: #f8f9fa;
    padding: 40px;
    border-radius: 12px;
}
.form-image-placeholder {
    width: 200px;
    height: 200px;
    background: #dee2e6;
}
.form-content {
    flex: 1;
}
.form-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}
.special-order{
    margin-bottom: 64px;
}
.special-order h2{
    font-size: var(--font-head2);
    font-weight: 600;
    margin-bottom: 36px;
}

.special-order .special-description{
    margin-bottom: 24px;
    font-size: var(--font-text);
}

/* ========== Блок новостей на главной ========== */
.news-section {
    padding: 60px 0;
    background: #fff; /* можно изменить */
}
.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}
.news-header h2 {
    font-size: var(--font-head2);
    font-weight: 600;
    margin: 0;
}
.news-header .all-news-link {
    color: var(--primary-color, #E02E7A);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px dashed;
}
.news-header .all-news-link:hover {
    opacity: 0.7;
}
.news-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.news-card {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}
.news-card:hover {
    transform: translateY(-5px);
}
.news-card a {
    text-decoration: none;
    color: inherit;
    flex-grow:1;
    display:flex;
    flex-direction: column;
}
.news-card.major {
    flex: 1 1 50%; /* Занимает 65% ширины, но может сжиматься */
    min-width: 300px;
    position: relative;
    overflow: hidden;
    height: 540px; /* Фиксированная высота, сопоставимая с высотой малых карточек */
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}
.news-card.major .news-img-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.news-card.major .news-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-card.major .news-overlay {
    position: absolute;
    right: 0;
    bottom: 0;
    height: calc(100% - 200px);
    width: 48%; /* Ширина текстового блока справа */
    background: #fff;
    color: var(--text-dark, #333);
    padding: 25px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.news-card.major .news-date, .news-card.major .news-type {
    font-size: var(--font-small);
    opacity: 0.8;
    margin-bottom: 8px;
}
.news-card.major .news-title {
    font-size: var(--font-head4);
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}
.minor-group {
    flex: 1 1 48%; /* Занимает оставшиеся 35% ширины */
    display: flex;
    gap: 20px;
    min-width: 280px;
}
.news-card.minor {
    flex: 1 1 25%; /* Каждая малая карточка занимает 1/3 ширины */
    min-width: 280px;
    height: 540px; /* Та же высота, что и у большой, для выравнивания */
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.news-card.minor .news-img-wrapper {
    height: 200px; /* Фиксированная высота изображения */
    overflow: hidden;
}
.news-card.minor .news-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-card.minor .news-text {
    padding: 20px;
    flex: 1; /* Занимает всё доступное пространство */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.news-card.minor .news-date, .news-card.minor .news-type {
    font-size: var(--font-small);
    color: #999;
    margin-bottom: 8px;
}
.news-card.minor .news-title {
    font-size: var(--font-head4);
    font-weight: 600;
    margin: 0;
    color: var(--text-dark, #333);
    line-height: 1.3;
}

.product-img-placeholder img{
    width: 100%;
}

/* ===== Карточки-ссылки для рекомендуемых товаров ===== */
.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s;
}
.product-card-link:hover {
    transform: translateY(-5px);
}
.product-card-link:hover .product-card h4 {
    color: var(--primary-color);
}
.product-card-link .img-placeholder {
    width: 100%;
    height: 140px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* если нужно убрать лишние отступы у заголовка */
.product-card-link .product-card h4 {
    transition: color 0.2s;
}

/* ===== БЛОК "О КОМПАНИИ" ===== */
.about {
    position: relative;
    padding: 80px 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    /* Затемнение для читаемости текста */
    background-color: rgba(0, 0, 0, 0.2); /* fallback, если картинка не загрузится */
    background-blend-mode: overlay;
    z-index: 1;
}

/* Затемняющий слой (полупрозрачный) – улучшает читаемость белого текста */
.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Ссылка "О компании" */
.about-link {
    display: inline-block;
    font-size: var(--font-small);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 15px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.about-link:hover {
    border-bottom-color: var(--primary-light);
    color: #fff;
}

/* Заголовок H1 – белый */
.about-title {
    font-size: var(--font-head1);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 25px 0;
    color: #ffffff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Текстовое описание – белый */
.about-description {
    font-size: var(--font-text);
    line-height: 1.6;
    color: #f0f0f0;
    max-width: 700px;
    margin-bottom: 35px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.about-description p {
    margin-bottom: 1em;
}

/* Контейнер кнопок */
.about-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Базовый стиль кнопок – белые на прозрачном фоне */
.btn {
    display: inline-block;
    padding: 14px 30px;
    font-size: var(--font-button);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid;
    background: transparent;
}

/* Стиль primary – белая кнопка с оранжевой рамкой */
.btn-primary {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Стиль secondary – прозрачная кнопка, белая рамка, белый текст */
.btn-secondary {
    border-color: #ffffff;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* Дополнительно: если нужен третий стиль (outline light) */
.btn-outline-light {
    border-color: #ffffff;
    color: #ffffff;
}

.btn-outline-light:hover {
    background-color: rgba(255,255,255,0.1);
}

section.section.description {
    font-size: var(--font-text);
    margin-top: 24px;
}

section.section.description p{
    margin: 12px 0px;
}

.contacts-title {
    font-size: var(--font-head2);
    font-weight: 600;
    margin-bottom: 36px;
}

.contacts-map-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 40px;
}

.contacts-info {
    flex: 1 1 45%;           /* левая колонка занимает ~45% */
    min-width: 300px;
    display: grid;
    grid-template-columns: 1fr 1fr;   /* две равные колонки */
    gap: 20px;                        /* отступы между блоками */
}

.map-container {
    flex: 1 1 50%;           /* правая колонка с картой */
    min-width: 300px;
}

/* Адаптивность: на экранах меньше 768px колонки становятся одна под другой,
   а сетка контактов превращается в один столбец */
@media (max-width: 768px) {
    .contacts-map-container {
        flex-direction: column;
    }
    .contacts-info {
        grid-template-columns: 1fr;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .about {
        padding: 50px 0;
    }
    .about-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Адаптивность */
@media (max-width: 1199px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 991px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .news-grid {
        flex-direction: column;
    }
    .news-card.major,
    .minor-group {
        flex: 1 1 100%;
        height: auto; /* Сбрасываем фиксированную высоту */
        flex-direction: column;
    }
    .news-card.major {
        height: auto;
        position: static;        /* убираем возможный relative */
    }

    .news-card.major a {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    /* img-wrapper перестаёт быть абсолютным, становится вертикальным flex-контейнером */
    .news-card.major .news-img-wrapper {
        position: relative;      /* вместо absolute */
        top: auto;
        left: auto;
        width: 100%;
        height: auto;            /* высота определяется содержимым */
        z-index: auto;
        display: flex;
        flex-direction: column;
    }

    /* Картинка внутри — фиксированной высоты, как у minor */
    .news-card.major .news-img-wrapper img {
        width: 100%;
        height: 250px;           /* как у minor */
        object-fit: cover;
        display: block;
        flex-shrink: 0;
    }

    /* Оверлей — теперь идёт внутри wrapper под картинкой, в потоке */
    .news-card.major .news-overlay {
        position: relative;      /* убираем absolute */
        right: auto;
        bottom: auto;
        width: 100%;
        height: auto;
        background: #fff;
        padding: 20px;
        z-index: auto;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        flex-shrink: 0;
    }
}
@media (max-width: 767px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 50px 0;
    }
    .product-grid, .catalog-grid, .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    .form-block {
        padding: 25px;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .main-nav .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    .product-grid, .catalog-grid, .news-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    .news-card.minor {
        flex: 1 1 100%;
    }
}

/* Адаптивность */
@media (max-width: 1199px) {
    .catalog .item-link { width: 33.333%; }
}
@media (max-width: 991px) {
    .catalog .item-link { width: 50%; }
}
@media (max-width: 767px) {
    .catalog .item-link { width: 100%; }
    .catalog .section-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .catalog .all-link {
        margin-top: 10px;
    }
}

/* Адаптивность для класса .product-card (замена .product_card из main.css) */
@media (max-width: 1199px) {
    .product-card {
        width: 33.333%;
    }
}
@media (max-width: 991px) {
    .product-card {
        width: 50%;
    }
}
@media (max-width: 767px) {
    .product-card {
        width: 100%;
    }
    .recommended h2 {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}