
@font-face {
    font-family: 'HelveticaNeueCyr Thin';
    src: url('../fonts/helveticaneuecyr_thin.otf') format('opentype');
    font-weight: 300; /* Тонкое начертание */
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'HelveticaNeueCyr Roman';
    src: url('../fonts/helveticaneuecyr_roman.otf') format('opentype');
    font-weight: normal; /* Обычное начертание */
    font-style: normal;
    font-display: swap;
}


.feature-name {
    font-weight: bold;
}

.popular-products-grid {
    width: 100%;
    padding: 30px 0 60px; /* Уменьшен верхний отступ, увеличен нижний */
    box-sizing: border-box;
    background-color: white;
    margin: 0 auto;
    max-width: 1800px; /* Ограничение максимальной ширины */
}

.learn-more .arrow {
    font-size: 18px;         /* = как у текста */
    font-weight: 300;        /* тонкая линия */
    font-family: 'HelveticaNeueCyr Roman', Arial, sans-serif; /* простой шрифт без декора */
    line-height: 1;          /* плотность */
    transform: scaleX(1.4);  /* шире галочка */
    display: inline-block;
    transition: transform 0.3s ease;
   
}

.popular-products-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* Изменено с space-evenly */
    gap: 20px;
    width: calc(100% + 30px); /* Компенсируем увеличенный gap */
    margin: 0 -15px; /* Компенсация для выравнивания */
    padding: 0 15px; /* Уменьшены боковые отступы */
    padding-left: 33px;
}

.popular-product-item {
    flex: 0 0 calc(25% - 25px); /* 4 элемента в ряд с отступами */
    max-width: calc(25% - 25px);
    min-width: 250px;
    height: 520px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
    background-color: white;
    border-radius: 10px;
    position: relative;
    margin-bottom: 30px; /* Отступ между рядами */
    height: auto; 
    min-height: 520px;
    overflow: hidden; /* Предотвращает выход содержимого за пределы карточки */
}

.article-badge {
    margin-right: 0; /* Убедитесь, что у бейджа нет дополнительных отступов */
    font-family: 'Roboto', sans-serif;
}

.article-badge-new, .article-badge-hit {
    margin-right: 0; /* Убедитесь, что у бейджей нет дополнительных отступов */
}
/* Адаптация количества элементов в ряду */
@media (max-width: 1200px) {
    .popular-product-item {
        max-width: 400px;
        height: 400px;
    }
    .product-image-container {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .popular-product-item {
        max-width: 350px;
        height: 350px;
    }
    .product-image-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .popular-product-item {
        max-width: 100%;
        height: auto;
        aspect-ratio: 1/1.2; /* Для мобилок можно изменить пропорции */
    }
    .product-image-container {
        height: 60vw;
    }
}

.product-image-container {
    aspect-ratio: auto;
    height: 350px;
    background: white;

    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    transition: all 0.3s ease-in-out;
    position: relative;
    border: 1px solid #00A9CE;
    overflow: hidden; /* Предотвращает выход картинки за пределы контейнера при увеличении */
}

/* Стили для бейджей остаются без изменений */
.article-badge {
    position: relative;
    width: 100px;
    height: 100px;
    background-image: url('/images/icons/for_article.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: top right;
    font-weight: bold;
    color: white;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.article-badge::after {
    content: attr(data-article);
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'HelveticaNeueCyr Roman', Arial, sans-serif;
    text-shadow: none;
    font-weight: 300;
}

.article-badge-wrapper {
    position: absolute;
    top: 0;
    right: 3px;
    display: flex;
    gap: 3px;
    z-index: 10;
    align-items: flex-start;
    height: 100px;
    justify-content: flex-end;
}

.article-badge-new {
    width: 35px;
    height: 33px;
    background-image: url('/images/icons/for_article_new.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;

    color: white;
    font-size: 12px;

    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'HelveticaNeueCyr Roman', Arial, sans-serif;
}

.article-badge-new::after {
    content: "NEW";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'HelveticaNeueCyr Roman', Arial, sans-serif;
    text-shadow: none;
    font-weight: 300;
    letter-spacing: 1.3px;
    font-size: 10px; 
}

/* Удаляем старые классы выравнивания, так как теперь все прижато по умолчанию */
.article-badge-wrapper.align-right,
.article-badge-wrapper.align-new-right {
    /* Оставляем только right: 15px из основного стиля */
    all: unset;
    position: absolute;
    top: 0;
    right: 3px;
    display: flex;
    gap: 3px;
    z-index: 10;
    align-items: flex-start;
    height: 100px;
    justify-content: flex-end;
}

.article-badge-hit {
    width: 35px;
    height: 33px;
    background-image: url('/images/icons/for_article_hit.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;

    color: white;
    font-size: 12px;

    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Roboto', sans-serif;
}

.article-badge-hit::after {
    content: "HIT!";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'HelveticaNeueCyr Roman', Arial, sans-serif;
    text-shadow: none;
    font-weight: 300;
    color: white;
    letter-spacing: 1.3px;
    font-size: 10px; 
}

.popular-product-img {
    max-width: 80%;
    max-height: 80%;
    transition: transform 0.3s ease-in-out;
    margin-left: 10%;
}

.popular-product-item:hover .popular-product-img {
    transform: scale(1.05);
}

.product-text-content {
    text-align: left;
    padding: 0 15px;
    margin-bottom: 20px;
    font-family: 'HelveticaNeueCyr Thin', Arial, sans-serif;
}

.popular-product-name {
    font-weight: bold;
    font-size: 20px;
    margin-bottom: 16px;
    color: #333;
    font-family: 'Roboto', sans-serif;

    /* Добавлено для выравнивания текста у всех карточек */
    line-height: 1.3;
    height: calc(1.3em * 2);  /* ровно 2 строки */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.popular-product-feature {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
    font-family: 'HelveticaNeueCyr Roman', Arial, sans-serif;
}

.learn-more-container {
    display: flex;
    justify-content: center; /* Центрирует весь блок по ширине */
    width: 100%;
    margin-top: 1%;
    margin-bottom: 10px;
    padding-top: 30px;
    padding-bottom: 10px;
}

.learn-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #00a9ce;
    font-size: 18px;
    transition: all 0.3s ease;
    font-family: 'HelveticaNeueCyr Roman', Arial, sans-serif;
    text-decoration: none;
}

/* Обертка для текста, чтобы подчеркивать только его */
.learn-more-text {
    position: relative;
    display: inline-block;
}

/* Подчеркивание только для текста */
.learn-more-text::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.learn-more:hover {
    color: #007c9b;
}

.learn-more:hover .learn-more-text::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.learn-more .arrow {
    font-family: 'HelveticaNeueCyr Roman', Arial, sans-serif;
    font-size: 18px;
    font-weight: 300;
    line-height: 1;
    transform: scaleX(1.4);
    display: inline-block;
    transition: transform 0.3s ease;
}

.learn-more:hover .arrow {
    transform: scaleX(1.4) translateY(5px);
}
.new-slider-wrapper {
    background-color: white;
    width: 100%;
    margin-top: -60px;
}

.white-background-container {
  position: relative;
  z-index: 1; /* Убедитесь, что это выше, чем у других элементов */
  background-color: white;
  width: 100%;
}

/* По умолчанию: показываем десктопные изображения, скрываем мобильные */
.new-slide img {
  display: block;
  width: 100%;
  height: auto;
}

.new-slide .mobile-img {
  display: none;
}

/* Для мобильных экранов */
@media (max-width: 768px) {
   .product-text-content {
    padding-left: 15px !important;  /* Фиксируем отступ слева */
    position: relative;
    left: -15px;
  }

   .popular-products-grid {
    padding-left: 15px !important;  /* ← отступ слева */
    padding-right: 15px !important; /* ← отступ справа */
    box-sizing: border-box;
  }
  .popular-products-row {
    width: 100%;
    margin: 0;
    padding: 0 !important;
    gap: 0;
    display: block; /* Меняем flex на block для мобильной версии */
    box-sizing: border-box;
  }

  .popular-product-item {
    width: calc(100% - 10px) !important; /* 5px с каждой стороны */
    max-width: none !important;
    margin: 5px !important; /* 5px отступы со всех сторон */
    box-sizing: border-box;
    flex: none !important; /* Отключаем flex-свойства */
    min-width: auto !important;
    height: auto;
    min-height: auto;
  }

  .popular-product-item .product-image-container {
    box-sizing: border-box; /* граница справа не обрезается */
  }

  .product-image-container {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1/1;
    margin-bottom: 15px;
  }

  .new-slide .mobile-img {
    display: block;
    width: 100%;
    height: auto;
  }

  .new-slider-btn {
    font-size: 24px;
    padding: 6px 12px;
  }

  .new-slider-container {
    padding: 0 10px;
  }
}

@media (min-width: 1280px) and (max-width: 1536px) {
    .popular-products-grid {
        padding-left: 5% !important;
        padding-right: 5% !important;
    }
}