/* MERARY-style homepage */

/* Full-page soft pink gradient (same as category / hero cards) — no hard cream blocks */
body[data-page="home"] {
  --home-page-gradient: var(
    --category-hero-bg,
    linear-gradient(128deg, #fffdfb 0%, #fdf3f5 24%, #f8e4ea 52%, #faeef2 78%, #fff9fa 100%)
  );
  /* Единый вертикальный ритм как у поиска «Подобрать» (фото 1) */
  --home-block-gap: clamp(22px, 2.8vw, 36px);
  background: transparent !important;
}

body[data-page="home"]::before {
  background-color: #fdf3f5;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

body[data-page="home"] .section--cream,
body[data-page="home"] .section--pink,
body[data-page="home"] .section--gray,
body[data-page="home"] .section--reviews,
body[data-page="home"] .section--inspiration,
body[data-page="home"] .why-delivery,
body[data-page="home"] .merary-cinematic,
body[data-page="home"] .merary-seo-strip,
body[data-page="home"] .home-search,
body[data-page="home"] .home-categories,
body[data-page="home"] .category-section,
body[data-page="home"] .footer {
  background: transparent !important;
}

body[data-page="home"] .footer__bottom {
  background: transparent !important;
}

/* Категории → хиты: один gap */
body[data-page="home"] .home-categories {
  padding-top: 0 !important;
  padding-bottom: var(--home-block-gap) !important;
}

/* Хиты → дополнения: один gap снизу секции */
body[data-page="home"] .section--cream:not(.section--occasion-concierge) {
  padding-top: 0;
  padding-bottom: var(--home-block-gap);
}

body[data-page="home"] .section--cream .section__header {
  margin-bottom: clamp(18px, 2.2vw, 28px);
}

/* Дополнения → подбор: один gap снизу (сверху уже от хитов) */
body[data-page="home"] .merary-gift-upgrade {
  padding-top: 0 !important;
  padding-bottom: var(--home-block-gap) !important;
}

/* Подбор по поводу — тот же нижний gap */
body[data-page="home"] .section--occasion-concierge {
  padding-top: 0 !important;
  padding-bottom: var(--home-block-gap) !important;
  background: transparent !important;
}

/* Повод → О MERARY CINEMATIC → SEO */
body[data-page="home"] .merary-cinematic {
  padding-top: 0 !important;
  padding-bottom: var(--home-block-gap) !important;
  background: transparent !important;
}

body[data-page="home"] .merary-seo-strip {
  padding-top: 0 !important;
  padding-bottom: var(--home-block-gap) !important;
  background: transparent !important;
}

/* occasion .container — те же боковые отступы, что у хитов */

/* Bestsellers «Смотреть все» — pill button like search submit */
body[data-page="home"] .section--cream .section__link--btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px 22px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #e8a0ad, #d8899a);
  color: #fff !important;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(216, 137, 154, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

body[data-page="home"] .section--cream .section__link--btn:hover {
  color: #fff !important;
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 10px 24px rgba(216, 137, 154, 0.38);
}

body[data-page="home"] .section--cream .section__link--btn span {
  font-size: 15px;
  line-height: 1;
}

/* Search perfectly centered between features strip and category cards */
body[data-page="home"] .home-search {
  --home-search-gap: var(--home-block-gap);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--home-search-gap) 0 !important;
  box-sizing: border-box;
}

body[data-page="home"] .home-search .container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

body[data-page="home"] .home-search__bar {
  margin-left: auto;
  margin-right: auto;
  width: min(680px, 100%);
  max-width: min(680px, 100%);
  padding: 9px 8px 9px 22px;
  gap: 12px;
  box-shadow: 0 10px 36px rgba(229, 165, 176, 0.16);
}

body[data-page="home"] .home-search__icon {
  width: 20px;
  height: 20px;
}

body[data-page="home"] .home-search__input {
  font-size: 15px;
}

body[data-page="home"] .home-search__submit {
  padding: 12px 24px;
  font-size: 13px;
}

body[data-page="home"] .home-search__bar {
  position: relative;
}

body[data-page="home"] .home-search:has(#homeSearchSuggest:not([hidden])) {
  position: relative;
  z-index: 50;
}

body[data-page="home"] .home-search__bar:has(#homeSearchSuggest:not([hidden])) {
  overflow: visible;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroPanelIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes heroGlowPulse {
  0%, 100% { opacity: 0.45; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.75; transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes heroRingSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes heroShine {
  0%, 72%, 100% { transform: translateX(-120%); }
  40% { transform: translateX(120%); }
}

.hero-merary {
  position: relative;
  background: transparent;
  padding: clamp(12px, 1.5vw, 22px) 0 0;
  overflow: visible;
}

.hero-merary__card {
  position: relative;
  border-radius: clamp(28px, 3.2vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  overflow: hidden;
  box-shadow:
    0 10px 40px rgba(232, 165, 176, 0.14),
    0 2px 8px rgba(61, 69, 54, 0.04);
  background: var(--category-hero-bg, linear-gradient(128deg, #fffdfb 0%, #fdf3f5 24%, #f8e4ea 52%, #faeef2 78%, #fff9fa 100%));
}

.hero-merary__petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.hero-merary__petal {
  position: absolute;
  display: block;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(135deg, rgba(255, 182, 196, 0.55), rgba(232, 165, 176, 0.28));
  transform: rotate(45deg);
  filter: blur(0.2px);
}

.hero-merary__petal--1 { width: 28px; height: 28px; top: 12%; right: 38%; opacity: 0.55; }
.hero-merary__petal--2 { width: 18px; height: 18px; top: 28%; right: 22%; opacity: 0.4; transform: rotate(20deg); }
.hero-merary__petal--3 { width: 22px; height: 22px; top: 8%; right: 52%; opacity: 0.35; transform: rotate(-30deg); }
.hero-merary__petal--4 { width: 16px; height: 16px; bottom: 34%; right: 30%; opacity: 0.45; transform: rotate(60deg); }
.hero-merary__petal--5 { width: 20px; height: 20px; top: 42%; right: 14%; opacity: 0.3; transform: rotate(-15deg); }
.hero-merary__petal--6 { width: 14px; height: 14px; bottom: 22%; right: 48%; opacity: 0.38; transform: rotate(35deg); }

.hero-merary__body {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: clamp(420px, calc(120px + 39.0625vw), 520px);
  padding: 0;
}

.hero-merary__content {
  position: relative;
  z-index: 2;
}

.hero-merary__copy-col {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 0 1 clamp(280px, 36vw, 460px);
  max-width: clamp(280px, 38vw, 460px);
  padding-top: clamp(34px, 4vw, 54px);
  padding-bottom: clamp(20px, 2.5vw, 32px);
  padding-left: clamp(28px, 4vw, 76px);
  padding-right: clamp(16px, 3vw, 48px);
}

.hero-merary__signature-asset {
  position: absolute;
  left: 27.5%;
  top: 23%;
  width: clamp(170px, 12.8vw, 185px);
  height: auto;
  transform: rotate(-10deg);
  opacity: 0.78;
  z-index: 3;
  pointer-events: none;
  user-select: none;
  display: block;
}

.hero-merary__visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
  align-self: stretch;
  min-height: 0;
  background: transparent;
}

.hero-merary__visual::before {
  display: none;
}

.hero-merary__body > picture {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  pointer-events: none;
}

.hero-merary__body .hero-merary__image {
  position: absolute;
  inset: 0;
  max-width: none !important;
  max-height: none !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  padding: 0;
  border: 0;
  display: block;
  object-fit: cover;
  object-position: 92% 35%;
  background: transparent !important;
  filter: none;
  animation: none;
  z-index: 1;
  pointer-events: none;
}

.hero-merary__body .hero-merary__photo.is-cms-layout {
  inset: auto;
  width: 65%;
  max-width: none;
  max-height: none;
  transform: none;
  -webkit-mask-image: none;
  mask-image: none;
}

@media (min-width: 64rem) {
  .hero-merary__body {
    padding: 0 !important;
    gap: 0 !important;
    align-items: flex-start;
  }

  .hero-merary__copy-col {
    padding-left: 118px !important;
    padding-top: 2.375rem !important;
  }

  .hero-merary__body .hero-merary__image {
    max-width: none !important;
    max-height: none !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: 100% 35% !important;
  }
}

.delivery-panel__map img.is-cms-layout,
.inspiration-item img.is-cms-layout,
.product-card__image img.is-cms-layout {
  width: var(--cms-w, 100%);
  transform: translate(var(--cms-tx, 0%), var(--cms-ty, 0%)) scale(var(--cms-scale, 1));
  transform-origin: center center;
}

.hero-merary__carousel {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: visible;
}

.hero-merary__carousel-track {
  flex: 1;
  display: flex;
  align-items: flex-end;
  width: 100%;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-merary__slide {
  flex: 0 0 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  padding: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  box-sizing: border-box;
}

.hero-merary__slide.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* legacy carousel rules kept for future slides */

.hero-merary__carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 20px 18px;
  flex-shrink: 0;
}

.hero-merary__carousel--single .hero-merary__carousel-nav {
  display: none;
}

.hero-merary__carousel-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(232, 165, 176, 0.45);
  background: rgba(255, 255, 255, 0.75);
  color: var(--olive);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 2px 10px rgba(61, 69, 54, 0.06);
}

.hero-merary__carousel-btn svg {
  width: 18px;
  height: 18px;
}

.hero-merary__carousel-btn:hover {
  background: var(--white);
  border-color: var(--pink-accent);
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(255, 125, 177, 0.2);
}

.hero-merary__carousel-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-merary__carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(232, 165, 176, 0.35);
  cursor: pointer;
  transition: width 0.3s, background 0.3s, transform 0.3s;
}

.hero-merary__carousel-dot.is-active {
  width: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, #E8A5B0, var(--pink-accent));
  transform: scale(1.05);
}

.hero-merary__title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 500;
  line-height: 1.12;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-merary__title > span {
  animation: heroFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-merary__title > span:nth-child(1) { animation-delay: 0.08s; }
.hero-merary__title > span:nth-child(2) { animation-delay: 0.14s; }
.hero-merary__title > span:nth-child(3) { animation-delay: 0.2s; }
.hero-merary__title > span:nth-child(4) { animation-delay: 0.26s; }

.hero-merary__title-dark { color: var(--olive); display: block; }
.hero-merary__title-pink { color: #E8A5B0; display: block; }
.hero-merary__title .heart { color: var(--pink-accent); font-size: 0.72em; }

.hero-merary__subtitle {
  font-size: 14px;
  color: var(--gray-dark);
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 360px;
  animation: heroFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both;
}

.hero-merary__buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  animation: heroFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both;
  margin-bottom: 22px;
}

.hero-merary__btn--solo {
  min-width: 220px;
}

.hero-merary__btn {
  border-radius: 6px;
  min-width: 148px;
  justify-content: center;
}

.hero-merary__proof {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: heroFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.46s both;
}

.hero-merary__avatars {
  display: flex;
  flex-shrink: 0;
}

.hero-merary__avatars img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-left: -8px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(61, 69, 54, 0.1);
}

.hero-merary__avatars img:first-child {
  margin-left: 0;
}

.hero-merary__proof p {
  font-size: 11px;
  line-height: 1.45;
  color: var(--gray-dark);
  max-width: 240px;
}

.hero-merary__proof strong {
  color: var(--olive);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .hero-merary__title > span,
  .hero-merary__subtitle,
  .hero-merary__buttons,
  .hero-merary__proof,
  .hero-merary__photo {
    animation: none !important;
    transition: none !important;
  }

  .hero-merary__slide {
    opacity: 1;
    transform: none;
  }
}

/* Premium benefits strip — hero footer */
.merary-features {
  background: transparent;
  border-top: none;
  padding: 0;
}

.hero-merary__features {
  position: relative;
  z-index: 2;
  overflow: hidden;
  background:
    radial-gradient(ellipse 32% 140% at 0% 50%, rgba(248, 195, 205, 0.24) 0%, transparent 72%),
    radial-gradient(ellipse 32% 140% at 100% 50%, rgba(248, 195, 205, 0.24) 0%, transparent 72%),
    linear-gradient(180deg, #fffaf9 0%, #fdf5f3 52%, #faf0ee 100%);
  border-top: 1px solid rgba(235, 190, 198, 0.16);
}

.merary-features__deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  overflow: visible;
}

.merary-features__petal {
  position: absolute;
  display: block;
  pointer-events: none;
  user-select: none;
  filter: blur(0.45px);
}

.merary-features__petal--l1 {
  left: -6px;
  bottom: -8px;
  width: 58px;
  height: 66px;
  opacity: 0.24;
  transform: rotate(-22deg);
}

.merary-features__petal--l2 {
  left: 28px;
  bottom: 18px;
  width: 34px;
  height: 40px;
  opacity: 0.2;
  transform: rotate(14deg);
}

.merary-features__petal--r1 {
  right: 18px;
  bottom: -6px;
  width: 56px;
  height: 64px;
  opacity: 0.23;
  transform: rotate(18deg);
}

.merary-features__petal--r2 {
  right: -4px;
  bottom: 22px;
  width: 32px;
  height: 38px;
  opacity: 0.19;
  transform: rotate(-12deg);
}

.merary-features__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.merary-features__item {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.2vw, 16px);
  padding: clamp(18px, 2vw, 22px) clamp(14px, 1.8vw, 26px);
  border-right: 1px solid rgba(232, 180, 190, 0.2);
}

.merary-features__item:last-child {
  border-right: none;
}

.merary-features__text {
  min-width: 0;
}

.merary-features__icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(232, 165, 176, 0.34);
  box-shadow:
    0 2px 10px rgba(232, 165, 176, 0.14),
    0 0 0 4px rgba(255, 246, 248, 0.55);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.merary-features__icon-svg {
  width: 24px;
  height: 24px;
  display: block;
  flex: 0 0 auto;
}

.merary-features__icon-svg--delivery,
.merary-features__icon-svg--photo,
.merary-features__icon-svg--support {
  width: 26px;
  height: 26px;
}

.merary-features__icon-svg--freshness {
  width: 24px;
  height: 24px;
}

.merary-features__item strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #3a4243;
  margin-bottom: 3px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.merary-features__item span {
  display: block;
  font-size: 11px;
  color: #8a8583;
  line-height: 1.35;
}

@media (hover: hover) and (pointer: fine) {
  .merary-features__item:hover .merary-features__icon {
    transform: translateY(-2px);
    box-shadow:
      0 6px 18px rgba(232, 165, 176, 0.24),
      0 0 0 4px rgba(255, 246, 248, 0.72);
  }
}

@media (prefers-reduced-motion: reduce) {
  .merary-features__icon {
    transition: none !important;
  }
}

/* Category grid — same gutters as hero */
.home-categories {
  padding: clamp(20px, 2.2vw, 32px) 0 clamp(48px, 5vw, 72px);
  background: transparent;
}

:root {
  --home-card-bg: #f7f1ec;
  --home-cat-gap: 14px;
  --home-cat-radius: 26px;
}

.home-categories .container {
  max-width: var(--container-max);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  box-sizing: border-box;
}

.home-cat-grid {
  display: flex;
  flex-direction: column;
  gap: var(--home-cat-gap);
  width: 100%;
}

.home-cat-grid__row {
  display: grid;
  gap: var(--home-cat-gap);
  width: 100%;
}

.home-cat-grid__row--top {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  height: clamp(320px, 36vw, 400px);
}

.home-cat-grid__row--mid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.home-cat-grid__row--wide {
  grid-template-columns: 1fr;
}

.home-cat-card {
  position: relative;
  display: block;
  height: 100%;
  border-radius: var(--home-cat-radius);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(210, 198, 186, 0.9);
  background: var(--home-card-bg);
  box-shadow: none;
  transition: transform 0.25s, box-shadow 0.25s;
  text-decoration: none;
  min-width: 0;
  min-height: 0;
}

.home-cat-card__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
}

.home-cat-card__content h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: #2f342c;
  line-height: 1.2;
  margin: 0 0 6px;
}

.home-cat-card__desc {
  font-size: 12px;
  line-height: 1.4;
  color: #6b7268;
  margin: 0 0 12px;
}

.home-cat-card__link {
  font-size: 13px;
  font-weight: 500;
  color: #e08aa5;
}

.home-cat-card__eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a88445;
}

.home-cat-card__media {
  position: relative;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
}

.home-cat-card__photo {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: transparent !important;
  filter: drop-shadow(0 12px 22px rgba(47, 52, 44, 0.11));
  transition: transform 0.35s ease;
}

.home-cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(61, 69, 54, 0.08);
}

.home-cat-card:hover .home-cat-card__link { color: #d45a8a; }
.home-cat-card:hover .home-cat-card__photo { transform: scale(1.04); }

.home-cat-card--featured {
  display: grid;
  grid-template-columns: minmax(0, 0.34fr) minmax(0, 0.66fr);
  align-items: stretch;
  border-color: rgba(201, 168, 108, 0.45);
  background: linear-gradient(120deg, #fff8f4 0%, #f8ebe6 48%, #f3e4df 100%);
}

.home-cat-card--featured .home-cat-card__content {
  justify-content: center;
  padding: clamp(20px, 2vw, 30px) 8px clamp(20px, 2vw, 30px) clamp(22px, 2.2vw, 34px);
}

.home-cat-card--featured .home-cat-card__content h3 {
  font-size: clamp(24px, 2.2vw, 34px);
  margin-bottom: 10px;
}

.home-cat-card--featured .home-cat-card__desc {
  font-size: 13px;
  line-height: 1.5;
  max-width: 220px;
  margin-bottom: 14px;
}

.home-cat-card--featured .home-cat-card__link {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: #e8a0b4;
  color: #fff;
  font-size: 13px;
}

.home-cat-card--featured:hover .home-cat-card__link {
  color: #fff;
  background: #d988a0;
}

.home-cat-card--featured .home-cat-card__media {
  padding: 8px 10px 8px 0;
  align-items: center;
  justify-content: center;
}

.home-cat-card--featured .home-cat-card__photo {
  width: 118%;
  height: 118%;
  object-fit: contain;
  object-position: center center;
}

.home-cat-card--top {
  display: flex;
  flex-direction: column;
}

.home-cat-card--top .home-cat-card__content {
  flex: 0 0 auto;
  padding: clamp(16px, 1.6vw, 22px) 16px 0 clamp(16px, 1.6vw, 22px);
  z-index: 3;
}

.home-cat-card--top .home-cat-card__content h3 {
  font-size: clamp(18px, 1.6vw, 24px);
}

.home-cat-card--top .home-cat-card__desc {
  font-size: 12px;
  max-width: 180px;
  margin-bottom: 8px;
}

.home-cat-card--top .home-cat-card__media {
  flex: 1 1 auto;
  width: 100%;
  margin-top: -8px;
  padding: 0 4px 8px;
  align-items: flex-end;
  justify-content: center;
}

.home-cat-card--top .home-cat-card__photo {
  width: 125%;
  height: 115%;
  object-fit: contain;
  object-position: center bottom;
}

.home-cat-card--compact {
  display: flex;
  flex-direction: column;
  height: auto;
  aspect-ratio: 1 / 1.08;
  min-height: 0;
}

.home-cat-card--compact .home-cat-card__content {
  flex: 0 0 auto;
  padding: 14px 32px 0 14px;
}

.home-cat-card--compact .home-cat-card__content h3 {
  font-size: clamp(12px, 1vw, 14px);
  margin-bottom: 4px;
}

.home-cat-card--compact .home-cat-card__desc {
  font-size: 11px;
  line-height: 1.3;
  margin: 0;
  max-width: 95%;
  color: #7a8178;
}

.home-cat-card--compact .home-cat-card__media {
  flex: 1 1 auto;
  width: 100%;
  padding: 2px 6px 8px;
  align-items: flex-end;
  justify-content: center;
}

.home-cat-card--compact .home-cat-card__photo {
  width: 120%;
  height: 118%;
  object-fit: contain;
  object-position: center bottom;
}

.home-cat-card--compact::after {
  content: '→';
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  font-size: 14px;
  color: #e08aa5;
  line-height: 1;
  pointer-events: none;
}

.home-cat-card--wide {
  display: grid;
  grid-template-columns: minmax(200px, 0.28fr) minmax(0, 0.72fr);
  align-items: stretch;
  height: clamp(200px, 20vw, 260px);
}

.home-cat-card--wide .home-cat-card__content {
  justify-content: center;
  padding: clamp(20px, 2vw, 30px) 8px clamp(20px, 2vw, 30px) clamp(24px, 2.4vw, 36px);
}

.home-cat-card--wide .home-cat-card__content h3 {
  font-size: clamp(20px, 1.9vw, 28px);
}

.home-cat-card--wide .home-cat-card__desc {
  font-size: 13px;
  max-width: 260px;
}

.home-cat-card--wide .home-cat-card__media {
  padding: 12px 28px 12px 4px;
  align-items: center;
  justify-content: stretch;
}

.home-cat-card--wide .home-cat-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 12px;
}

/* Premium intro video */
.premium-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #1a1814;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.premium-intro.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.premium-intro__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.premium-intro__overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
  padding: 24px;
  background: linear-gradient(180deg, rgba(26, 24, 20, 0.3) 0%, rgba(26, 24, 20, 0.6) 100%);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.premium-intro__logo {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 500;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
  animation: premiumFadeIn 1s ease;
}

.premium-intro__tagline {
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #C9A86C;
  margin-bottom: 40px;
  animation: premiumFadeIn 1.2s ease;
}

.premium-intro__bar {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 24px;
}

.premium-intro__bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #C9A86C, #E8D5A8);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.premium-intro__skip {
  margin-top: 16px;
  padding: 10px 24px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  background: transparent;
  transition: all 0.2s;
}

.premium-intro__skip:hover {
  color: var(--white);
  border-color: #C9A86C;
  background: rgba(201, 168, 108, 0.15);
}

@keyframes premiumFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Premium catalog page — dark theme handled in premium-atelier.css */

.premium-hero {
  position: relative;
  padding: 48px 0;
  background: linear-gradient(135deg, #1a1814 0%, #2d2820 50%, #1a1814 100%);
  color: var(--white);
  overflow: hidden;
}

.premium-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(201, 168, 108, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.premium-hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.premium-hero__label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #C9A86C;
  margin-bottom: 12px;
}

.premium-hero__title {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 16px;
}

.premium-hero__text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.8;
  margin-bottom: 24px;
  max-width: 420px;
}

.premium-hero__image {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(201, 168, 108, 0.3);
}

.premium-hero__image img {
  width: 100%;
  height: 360px;
  object-fit: cover;
}

.premium-products .product-card {
  border-color: rgba(201, 168, 108, 0.25);
}

.premium-products .product-card:hover {
  box-shadow: 0 8px 32px rgba(201, 168, 108, 0.15);
}

.premium-products .product-card__badge {
  background: linear-gradient(135deg, #C9A86C, #A8873D);
}

@media (max-width: 1024px) {
  .home-cat-grid__row--top {
    grid-template-columns: 1fr 1fr;
    height: auto;
  }

  .home-cat-card--featured {
    grid-column: 1 / -1;
    height: 300px;
    grid-template-columns: minmax(0, 0.38fr) minmax(0, 0.62fr);
  }

  .home-cat-grid__row--mid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-cat-card--top {
    height: 300px;
  }

  .home-cat-card--compact {
    aspect-ratio: 1 / 1.05;
  }

  .home-cat-card--wide {
    height: 220px;
    grid-template-columns: minmax(180px, 0.32fr) minmax(0, 0.68fr);
  }
  .merary-features__grid { grid-template-columns: repeat(2, 1fr); }
  .merary-features__item:nth-child(2n) { border-right: none; }
  .merary-features__item:nth-child(-n + 2) { border-bottom: 1px solid rgba(232, 180, 190, 0.2); }
  .premium-hero .container { grid-template-columns: 1fr; }
}

/* Hero mobile — <=767px only (desktop >=768 unchanged) */
@media (max-width: 47.9375rem) {
  .hero-merary__signature-asset {
    display: none;
  }

  .hero-merary__body {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: clamp(420px, calc(500px - 10.2vw), 464px);
    padding: 0;
    gap: 0;
    overflow: hidden;
  }

  .hero-merary__body::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(
      118deg,
      rgba(255, 252, 250, 0.97) 0%,
      rgba(255, 248, 250, 0.92) 40%,
      rgba(253, 243, 247, 0.5) 54%,
      transparent 70%
    );
  }

  .hero-merary__copy-col {
    flex: none;
    width: 100%;
    max-width: min(22.5rem, 88vw);
    padding-top: clamp(1.25rem, 5vw, 1.75rem);
    padding-bottom: clamp(0.5rem, 2.5vw, 0.75rem);
    padding-left: clamp(1.25rem, 5vw, 1.75rem);
    padding-right: clamp(0.75rem, 3vw, 1rem);
    position: relative;
    z-index: 3;
  }

  .hero-merary__body .hero-merary__image {
    object-fit: cover;
    object-position: center 73%;
  }

  .hero-merary__title {
    font-size: clamp(1.75rem, 8.2vw, 2rem);
  }

  .hero-merary__title-pink {
    color: #e86f91;
  }

  .hero-merary__title .heart {
    color: #f04f77;
  }

  .hero-merary__subtitle {
    max-width: 64%;
  }

  .hero-merary__btn.btn--lg {
    width: fit-content;
    min-width: 0;
    padding: 11px 18px;
    letter-spacing: 0.35px;
  }

  .hero-merary__btn .btn-flower {
    margin-right: 0;
  }

  .hero-merary__proof {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .hero-merary__proof p {
    max-width: none;
  }
}

@media (min-width: 28rem) and (max-width: 47.9375rem) {
  .hero-merary__copy-col {
    max-width: min(24rem, 72vw);
  }
}

@media (max-width: 768px) {
  .home-cat-grid__row--top {
    grid-template-columns: 1fr;
  }

  .home-cat-grid__row--mid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-cat-card--featured {
    height: 280px;
    grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  }

  .home-cat-card--top {
    height: 280px;
  }

  .home-cat-card--wide {
    height: 200px;
    grid-template-columns: minmax(140px, 0.36fr) minmax(0, 0.64fr);
  }

  .home-cat-card--wide .home-cat-card__media {
    padding-right: 16px;
  }

  .home-cat-card--wide .home-cat-card__photo {
    object-fit: cover;
  }
  .merary-features__grid { grid-template-columns: 1fr; }
  .merary-features__item {
    border-right: none;
    border-bottom: 1px solid rgba(232, 180, 190, 0.2);
    padding: 16px clamp(18px, 5vw, 28px);
  }
  .merary-features__item:last-child { border-bottom: none; }
  .merary-features__petal--l1 { left: -4px; width: 46px; height: 52px; opacity: 0.22; }
  .merary-features__petal--l2 { left: 18px; width: 28px; height: 32px; opacity: 0.18; }
  .merary-features__petal--r1 { right: 8px; width: 44px; height: 50px; opacity: 0.21; }
  .merary-features__petal--r2 { right: -2px; width: 26px; height: 30px; opacity: 0.17; }
}

/* Mobile: existing homepage search sits under the header */
@media (max-width: 53.125rem) {
  body[data-page="home"] .home-search {
    padding: 4px 0 20px !important;
    position: sticky;
    top: 0;
    z-index: 300;
    background: transparent;
  }

  /* Keep sticky even while suggestions are open (desktop rule sets position: relative) */
  body[data-page="home"] .home-search:has(#homeSearchSuggest:not([hidden])) {
    position: sticky;
    top: 0;
    z-index: 300;
  }

  body[data-page="home"] .home-search__bar {
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    height: 45px;
    min-height: 45px;
    max-height: 45px;
    box-sizing: border-box;
    padding: 0 16px;
    gap: 10px;
    border-radius: 999px;
  }

  body[data-page="home"] .home-search__icon {
    width: 20px;
    height: 20px;
    color: #f05a86;
  }

  body[data-page="home"] .home-search__input {
    height: 100%;
    font-size: 14px;
    line-height: 1.2;
    -webkit-appearance: none;
    appearance: none;
  }

  body[data-page="home"] .home-search__submit {
    display: none;
  }
}

/* Mobile: compact single-row trust strip (overrides 1024px/768px rules above) */
@media (max-width: 53.125rem) {
  .hero-merary__features {
    margin-top: 8px;
    background: rgba(255, 250, 251, 0.96);
    border: 1px solid rgba(240, 79, 119, 0.16);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 3px 10px rgba(232, 165, 176, 0.12);
  }

  html:has(.merary-cookie.is-visible) body[data-page="home"] .hero-merary__features {
    padding-bottom: 0;
  }

  .merary-features__deco {
    display: none;
  }

  .merary-features__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .merary-features__item {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 14px 4px;
    border-right: 1px solid rgba(232, 180, 190, 0.22);
    border-bottom: none;
    text-align: center;
  }

  .merary-features__item:nth-child(2n) {
    border-right: 1px solid rgba(232, 180, 190, 0.22);
  }

  .merary-features__item:last-child {
    border-right: none;
  }

  .merary-features__icon {
    width: 34px;
    height: 34px;
  }

  .merary-features__icon-svg,
  .merary-features__icon-svg--delivery,
  .merary-features__icon-svg--photo,
  .merary-features__icon-svg--support,
  .merary-features__icon-svg--freshness {
    width: 18px;
    height: 18px;
  }

  .merary-features__text {
    width: 100%;
    min-width: 0;
  }

  .merary-features__item strong,
  .merary-features__item span {
    display: none;
  }

  .merary-features__item::after {
    content: attr(data-mobile-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    color: #3a4243;
    letter-spacing: -0.01em;
  }
}

/* Mobile compact category carousel — hidden on desktop by default */
.mcat-scroll {
  display: none;
}

@media (max-width: 53.125rem) {
  body[data-page="home"] .home-categories {
    display: none;
  }

  .mcat-scroll {
    display: block;
    padding: 4px 0 30px;
  }

  .mcat-scroll__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .mcat-scroll__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(26px, 7vw, 30px);
    font-weight: 500;
    color: var(--olive);
    letter-spacing: normal;
  }

  .mcat-scroll__all {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: #f04f77;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
  }

  .mcat-scroll__all:hover {
    text-decoration: underline;
  }

  .mcat-scroll__track {
    display: flex;
    gap: 10px;
    padding: 2px var(--gutter) 10px;
    scroll-padding-left: var(--gutter);
    scroll-padding-right: var(--gutter);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mcat-scroll__track::-webkit-scrollbar {
    display: none;
  }

  .mcat-scroll__card {
    position: relative;
    flex: 0 0 108px;
    width: 108px;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 253, 252, 0.92);
    border: 1px solid rgba(232, 180, 190, 0.28);
    text-decoration: none;
    scroll-snap-align: start;
  }

  .mcat-scroll__media {
    display: block;
    width: 100%;
    height: 104px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f8e4ea;
  }

  .mcat-scroll__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .mcat-scroll__label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 7px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    color: #4a4443;
  }

  .mcat-scroll__card--premium {
    border-color: rgba(196, 149, 58, 0.8);
  }

  .mcat-scroll__card--premium .mcat-scroll__label {
    color: #96702a;
  }

  .mcat-scroll__crown {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    color: #b8863a;
    z-index: 1;
  }

  .mcat-scroll__crown svg {
    width: 11px;
    height: 9px;
  }
}

/* Планшет 768–1023px: как на мобильной версии, мягкая подложка под текстом hero и более насыщенный розовый,
   чтобы заголовок и подпись не терялись на фоне букета. */
@media (min-width: 48rem) and (max-width: 63.9375rem) {
  .hero-merary__body::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(
      100deg,
      rgba(255, 252, 250, 0.9) 0%,
      rgba(255, 248, 250, 0.78) 34%,
      rgba(253, 243, 247, 0.3) 50%,
      transparent 62%
    );
  }

  .hero-merary__copy-col {
    z-index: 3;
  }

  .hero-merary__title-pink {
    color: #e86f91;
  }

  .hero-merary__title .heart {
    color: #f04f77;
  }
}
