:root {
  --curtain-trans: 0.7s cubic-bezier(0.19,1,0.22,1);
  --text-trans: 0.4s cubic-bezier(0.23,1,0.32,1);
  --text-stagger: 0.12s;
}

/* --------- BASE STYLES --------- */
.product-block-title {
  padding-top: 0rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15rem;
  width: 100%;
}

.products-title {
  text-align: center;
  font-family: "KingRichard-Italic", sans-serif;
  font-size: clamp(2rem, 6vw, 6.4375rem);
  font-style: normal;
  font-weight: 400;
  line-height: 1.05;
  color: #381809;
  text-transform: uppercase;
  width: 100%;
  opacity: 0;
  will-change: transform, opacity;
}

.product-section {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  background: #fcfcfc;
  padding-left: 4vw;
  padding-right: 4vw;
  box-sizing: border-box;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 860px));
  gap: 2rem;
  margin: 0 auto;
  justify-content: center;
}

.product-card {
  border-radius: 25px;
  aspect-ratio: 16 / 11;
  position: relative;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.65s;
  will-change: transform;
  overflow: hidden;
}

.product-card:nth-child(1) {
  background-image: url("../resources/images/product_protein.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}
.product-card:nth-child(2) {
  background-image: url("../resources/images/product_bones.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}
.product-card:nth-child(2):hover .curtain h3,
.product-card:nth-child(2):hover .curtain p,
.product-card:nth-child(2):hover .curtain .bullet-columns li {
  color: #381809;
}
.product-card:nth-child(3) {
  background-image: url("../resources/images/product_electro.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}
.product-card:nth-child(4) {
  background-image: url("../resources/images/product_vit.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}
.product-card:nth-child(5) {
  background-image: url("../resources/images/minerals_new.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}
.product-card:nth-child(6) {
  background-image: url("../resources/images/product_amino.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}
.product-card:nth-child(7) {
  background-image: url("../resources/images/product_digestion.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}
.product-card:nth-child(8) {
  background-image: url("../resources/images/product_creatine.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.product-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(34, 42, 64, 0.24);
  z-index: 2;
}

.product-card span {
  position: relative;
  top: 40px;
  left: 43px;
  background: #41606a;
  color: #fff;
  padding: 8px 32px;
  border-radius: 100px;
  font-family: "Manrope Medium";
  font-size: clamp(0.875rem, 1vw, 1.125rem);
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  z-index: 3;
  transition: opacity 0.3s ease;
  will-change: transform, opacity;
}
.product-card:hover span {
  opacity: 0;
}

/* --------- CURTAIN ANIMATION BASE --------- */
.curtain {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.01);
  z-index: 1;
  transition: height var(--curtain-trans), opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  color: white;
  text-align: center;
  border-radius: 0 0 25px 25px;
  opacity: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateZ(0);
  pointer-events: none;
  will-change: transform, opacity;
}

/* ---- TEXT IN CURTAIN: базовые состояния (без delay) ---- */
.curtain h3,
.curtain p,
.curtain .bullet-columns {
  opacity: 1;
  transform: none;
  transition: opacity var(--text-trans), transform var(--text-trans);
}

.curtain h3 {
  font-family: "Manrope Medium";
  font-size: clamp(1rem, 1.4vw, 1.6875rem);
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 40px;
  will-change: transform, opacity;
}
.curtain p {
  font-family: "Manrope Medium";
  font-size: clamp(0.875rem, 1vw, 1.125rem);
  color: #ffffff;
  line-height: 1.6;
  width: 85%;
  text-align: center;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  will-change: transform, opacity;
}
.bullet-columns {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 5rem;
  margin-top: 1.4rem;
}
.bullet-columns ul {
  display: flex;
  align-self: stretch;
  flex-direction: column;
  justify-content: center;
  list-style: disc outside;
  padding: 0;
  padding-left: 1.2em;
  margin: 0;
  text-align: left;
}
.bullet-columns li {
  font-family: "Manrope Medium", sans-serif;
  font-size: clamp(0.875rem, 1vw, 1.125rem);
  color: white;
  margin-bottom: 0.7em;
  line-height: 1.5;
  will-change: transform, opacity;
}

/* --------- DESKTOP ONLY: СТАГГЕР и СБРОС DELAY --------- */
@media (min-width: 601px) {
  .product-card:hover .curtain {
    height: 100%;
    border-radius: 25px;
    opacity: 1;
  }

    .curtain h3,
  .curtain p,
  .curtain .bullet-columns {
    opacity: 0;
    transform: translateY(20px);
  }
  /* Сброс задержки вне hover (чтобы не было багов при быстром уходе мыши) */
  .product-card .curtain h3,
  .product-card .curtain p,
  .product-card .curtain .bullet-columns {
    transition-delay: 0s;
  }
  /* Стагерные задержки появления текста при наведении */
  .product-card:hover .curtain h3 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--text-stagger) * 1);
  }
  .product-card:hover .curtain p {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--text-stagger) * 2);
  }
  .product-card:hover .curtain .bullet-columns {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--text-stagger) * 3);
  }
}

/* --------- MOBILE: НЕ ТРОГАНО --------- */
@media (max-width: 600px) {
  .product-block-title {
    padding-top: 0rem;
    margin-bottom: 6.625rem;
    width: 100%;
  }
  .product-block-title br {
    display: none;
  }
  .products-title {
    font-size: 2.5rem;
    line-height: 0.91;
    font-weight: 400;
    font-style: normal;
    z-index: 10;
  }
  .product-grid {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 100%;
    max-width: 100%;
    padding: 0;
    padding-top: 0rem;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
  }
  .product-card {
    width: 92vw;
    max-width: 480px;
    min-width: 0;
    margin: 0 auto;
    aspect-ratio: 16/11;
    border-radius: 25px;
    box-shadow: none;
  }
  .product-card span {
    left: 1.5rem;
    top: 1.625rem;
    padding: 0.1875rem 0.9375rem;
    font-size: 0.7rem;
  }
  .curtain {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 25px;
    height: auto;
    width: 100%;
    overflow: hidden;
  }
  .curtain h3 {
    font-size: 0.875rem;
    margin-bottom: 22px;
  }
  .curtain p {
    font-size: 0.625rem;
    width: 90%;
    margin-bottom: 13px;
  }
  .product-card.touch-active .curtain {
    height: auto;
    max-height: auto;
    border-radius: 25px;
    opacity: 1;
    pointer-events: all !important;
    overflow: hidden !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y !important;
    z-index: 20;
  }
  .bullet-columns {
    display: flex;
    flex-direction: row;
    gap: 1.2rem;
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
    align-items: flex-start;
  }
  .bullet-columns ul {
    text-align: left;
    min-width: 0;
    width: 48%;
    padding-left: 1.2em;
  }
  .bullet-columns li {
    font-size: 0.525rem;
    margin-bottom: 0.35em;
    word-break: break-word;
  }
}

/* --------- cert carousel и остальные блоки не менялись --------- */
:root {
  --carousel-blocks: 5;
  --block-width: 18vw;
  --block-height: 30vw;
  --block-gap: 2vw;
}



.cert-title {
  padding-top: 22rem;
}
.cert-carousel-container {
  background-color: #fcfcfc;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100vw;
  height: 20vw;
  overflow: hidden;
  margin: 0vw 0;
}
.cert-carousel-track {
  display: flex;
  gap: 2vw;
  width: calc((18vw + 2vw) * 10);
  animation: slide-second-carousel 25s linear infinite;
  transform: translate3d(0, 0, 0);
}
.cert-carousel-block {
  flex: 0 0 18vw;
  height: 20vw;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cert-carousel-block img {
  max-width: 50%;
  max-height: 50%;
  object-fit: contain;
  display: block;
}
@keyframes slide-second-carousel {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(
      calc(
        -1 * (var(--block-width) + var(--block-gap)) * var(--carousel-blocks)
      )
    );
  }
}
/* cert carousel mobile (не тронуто) */
@media (max-width: 600px) {
  :root {
    --block-width: 20vw;
    --block-height: 22vw;
    --block-gap: 4rem;
    --carousel-blocks: 5;
  }


  .cert-title {
    padding: 0;
  }
  .cert-carousel-container {
    height: 32vw;
    min-height: 85px;
    max-height: 120px;
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    overflow-x: hidden !important;
    padding: 0;
    padding-top: 4.125rem;
  }
  .cert-carousel-track {
    gap: var(--block-gap);
    width: calc((var(--block-width) + var(--block-gap)) * 10);
    animation: slide-second-carousel 18s linear infinite;
    align-items: center;
    height: 100%;
  }
  .cert-carousel-block {
    flex: 0 0 var(--block-width);
    height: var(--block-height);
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .cert-carousel-block img {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    display: block;
  }
  .cert-title-container {
    margin-top: 8.373125rem;
  }
  .cert-title {
    font-size: 1rem;
  }
  .cert-subtitle-container {
    margin-top: 0.85rem;
  }
  .cert-subtitle {
    width: 80%;
    font-family: "Manrope Medium";
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
  .cert-subtitle br {
    display: none;
  }
}

.cert-title {
  font-family: "Manrope Medium";
  font-size: clamp(1rem, 1.4vw, 1.6875rem);
  color: #381809;
  line-height: normal;
  text-transform: uppercase;
  font-weight: 500;
  font-style: normal;
  text-align: center;
}
.cert-subtitle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2.0625rem;
}
.cert-subtitle {
  font-family: "Manrope Medium";
  font-size: clamp(0.875rem, 1vw, 1.125rem);
  color: #381809;
  line-height: normal;
  font-weight: 500;
  font-style: normal;
  text-align: center;
}
