/* =====================================================
   НА ПАМЯТЬ — общие стили
   ===================================================== */

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  touch-action: manipulation;
}

:root {
  --bg: #f8f5f4;
  --bg-deeper: #efe7e1;
  --rose: #b17972;
  --rose-dark: #9a655e;
  --sage: #93a28a;
  --sage-dark: #7a8872;
  --ink: #3a2e29;
  --ink-soft: #5e4f48;
  --line: #ddd0c8;
  --placeholder: #d9d9d9;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* === Preloader === */
html.np-loading, html.np-loading body { overflow: hidden; }
.np-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .55s ease, visibility .55s ease;
}
.np-preloader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  animation: npPreFade .5s ease both;
}
@keyframes npPreFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.np-preloader__logo {
  width: min(320px, 60vw);
  height: auto;
  display: block;
}
.np-preloader__logo svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.np-preloader__logo svg path {
  fill: var(--rose);
  fill-opacity: 0;
  stroke: var(--rose);
  stroke-width: 0.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: npDrawStroke 1.8s cubic-bezier(.55,.1,.3,1) forwards,
             npDrawFill   1s ease-out 0.8s forwards;
}
@keyframes npDrawStroke { to { stroke-dashoffset: 0; } }
@keyframes npDrawFill   { to { fill-opacity: 1; } }
.np-preloader__spinner { display: none; }
.np-preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  margin: 0;
  color: var(--ink);
  letter-spacing: 0.01em;
}

/* === LAYOUT === */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 600px) { .container { padding: 0 20px; } }

section { padding: 110px 0; }
@media (max-width: 600px) { section { padding: 70px 0; } }

/* === TYPOGRAPHY === */
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: #000;
  margin: 0 0 22px;
}
@media (max-width: 600px) { .section-title { font-size: 26px; } }

.handwritten {
  font-family: 'Bad Script', cursive;
  color: var(--rose);
}

/* === SECTION DIVIDER (сердечко с линиями) === */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 308px;
  max-width: 90%;
  margin: 0 auto 70px;
}
.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rose);
  opacity: 0.45;
}
.section-divider__heart {
  width: 14px; height: 14px;
  flex-shrink: 0;
  color: var(--rose);
  opacity: 0.9;
}
.section-divider__heart svg { display: block; width: 100%; height: 100%; }
@media (max-width: 600px) { .section-divider { margin-bottom: 50px; } }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 2px;
  white-space: nowrap;
  transition: background-color .25s ease, color .25s ease, transform .15s ease, border-color .25s ease;
  border: 1.5px solid transparent;
}
.btn--primary { background: var(--rose); color: #fff; }
.btn--primary:hover { background: var(--rose-dark); }
.btn--ghost { background: transparent; color: var(--rose); border-color: var(--rose); }
.btn--ghost:hover { background: var(--rose); color: #fff; }
.btn--ghost-light { background: transparent; color: #fff; border-color: #fff; }
.btn--ghost-light:hover { background: #fff; color: var(--rose); }
.btn:active { transform: translateY(1px); }

/* === HEADER === */
.header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 124px;
  display: flex;
  align-items: center;
  background: transparent;
  transition: background-color .3s ease, height .3s ease, box-shadow .3s ease;
}
.header.scrolled {
  position: fixed;
  height: 88px;
  background: rgba(177, 121, 114, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(70,45,40,0.15);
}
.header--fixed {
  position: sticky;
  top: 0;
  height: 88px;
  background: rgba(177, 121, 114, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(70,45,40,0.15);
}

/* Внутренние страницы (каталог, товар, корзина): хедер sticky —
   остаётся видимым при скролле. */
body[data-layout="internal"] .header,
body[data-layout="internal"] .header.scrolled {
  position: sticky;
  top: 0;
  left: auto; right: auto;
  height: 88px;
  background: var(--rose);
  backdrop-filter: none;
  box-shadow: 0 2px 12px rgba(70,45,40,0.15);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 32px;
}

.logo { display: block; height: 29px; }
.logo img { height: 100%; width: auto; display: block; }

.nav { display: flex; align-items: center; gap: 36px; }
.nav a {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--bg);
  letter-spacing: 0.02em;
  transition: opacity .2s ease;
  position: relative;
  white-space: nowrap;
}
.nav a:hover { opacity: 0.7; }
.nav a::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0;
  width: 0; height: 1px;
  background: var(--bg);
  transition: width .25s ease;
}
.nav a:hover::after { width: 100%; }

.header__cta {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--bg);
  letter-spacing: 0.02em;
  border: 1px solid var(--bg);
  padding: 10px 22px;
  background: transparent;
  border-radius: 0;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.header__cta:hover { background: var(--bg); color: var(--rose); }

.header__cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  padding: 6px;
  margin-left: 4px;
  transition: opacity .2s ease;
}
.header__cart:hover { opacity: 0.8; }
.header__cart svg { display: block; }
.header__cart-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--bg);
  color: var(--rose);
  border-radius: 9px;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  letter-spacing: 0;
  box-shadow: 0 1px 3px rgba(70,45,40,0.22);
}
.header__cart-badge[hidden] { display: none; }
body[data-layout="internal"] .header__cart-badge {
  background: var(--bg);
  color: var(--rose);
}

.burger { display: none; width: 30px; height: 22px; position: relative; z-index: 110; }
.burger span {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--bg);
  border-radius: 1px;
  transition: transform .3s ease, opacity .2s ease, background .2s ease;
}
.burger span:nth-child(1) { top: 2px; }
.burger span:nth-child(2) { top: 10px; }
.burger span:nth-child(3) { top: 18px; }
.burger.open span { background: var(--ink); }
.burger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 1100px) { .nav { gap: 22px; } .nav a { font-size: 13px; } }
@media (max-width: 920px) {
  .header { height: 80px; }
  .header.scrolled { height: 64px; }
  .header--fixed { height: 64px; }
  .header__nav { display: none; }
  .header__cta { display: none; }
  .header__cart { margin-left: auto; margin-right: 4px; }
  .burger { display: block; }
  .logo { height: 24px; }
}

/* === MOBILE MENU === */
.mobile-menu {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  background: var(--bg);
  z-index: 105;
  padding: 90px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateX(100%);
  transition: transform .35s ease;
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu a {
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink);
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
}
.mobile-menu__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--ink);
  cursor: pointer;
  border-radius: 50%;
  transition: background-color .15s ease;
}
.mobile-menu__close:hover { background: rgba(0,0,0,0.05); }
.mobile-menu__close svg { display: block; }

.mobile-menu a.mobile-menu__btn {
  margin-top: 24px;
  background: var(--rose);
  color: #fff;
  text-align: center;
  border-bottom: none;
  border-radius: 2px;
  align-self: flex-start;
  padding: 14px 28px;
}

/* === PRODUCT CARDS === */
.tabs {
  display: flex;
  gap: 0;
  justify-content: center;
  margin-bottom: 50px;
}
.tab {
  height: 42px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--sage);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tab.active { background: var(--sage); color: var(--bg); }
.tab:hover:not(.active) { color: var(--sage-dark); }
.tab.tab--outline { border: 1.5px solid var(--rose); color: var(--rose); }
.tab.tab--outline.active { background: var(--rose); color: #fff; }
.tab.tab--outline:hover:not(.active) { color: var(--rose-dark); }

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 57px;
  row-gap: 25px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(70,45,40,0.06);
  transition: transform .35s ease, box-shadow .35s ease;
  position: relative;
}
.card-info {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  color: var(--ink, #2c2520);
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(70,45,40,0.18);
  transition: background .2s ease, transform .2s ease;
}
.card-info:hover,
.card-info:focus-visible {
  background: #fff;
  transform: scale(1.06);
}
.card-info::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: max-content;
  max-width: 280px;
  padding: 12px 14px;
  background: #2c2520;
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  pointer-events: none;
  z-index: 4;
  white-space: normal;
}
.card-info:hover::after,
.card-info:focus-visible::after,
.card-info.is-open::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@media (max-width: 600px) {
  .card-info::after { max-width: 220px; font-size: 12px; }
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(70,45,40,0.18);
}
.product-card__img {
  aspect-ratio: 370 / 282;
  background: var(--placeholder);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.product-card__body {
  padding: 26px 16px 28px;
  background: #fff;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 182px;
}
.product-card__title {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 400;
  color: #000;
  line-height: 1.4;
  margin: 0;
  text-align: center;
}
.card-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 120px;
  margin: auto 0 4px;
}
.card-divider::before,
.card-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rose);
  opacity: 0.45;
}
.card-divider__heart {
  width: 10px; height: 10px;
  flex-shrink: 0;
  color: var(--rose);
  opacity: 0.9;
}
.card-divider__heart svg { display: block; width: 100%; height: 100%; }
.product-card__price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 400;
  color: var(--rose);
  letter-spacing: 0.02em;
  line-height: 1;
}

.badge {
  position: absolute;
  top: 0;
  height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bg);
  z-index: 2;
}
.badge--hit { right: 0; background: var(--sage); }
.badge--new { left: 0; background: var(--rose); }

.products-cta { text-align: center; margin-top: 60px; }
.products-cta__link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: 'Manrope', sans-serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--sage);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: color .2s ease;
}
.products-cta__link:hover { color: var(--sage-dark); }
.products-cta__arrow { width: 186px; height: 12px; display: block; color: var(--sage); }

@media (max-width: 1100px) { .products-grid { gap: 0 32px; row-gap: 24px; } }
@media (max-width: 900px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 0 24px; row-gap: 24px; }
}
@media (max-width: 560px) {
  .products-grid { grid-template-columns: 1fr; gap: 24px; }
  .product-card__title { font-size: 18px; }
  .product-card__price { font-size: 28px; }
  .products-cta__link { font-size: 20px; }
  .products-cta__arrow { width: 140px; }
  .tabs { flex-wrap: wrap; gap: 4px; }
}

/* === FOOTER === */
.footer {
  background: var(--rose);
  color: rgba(255,255,255,0.92);
  padding: 56px 0 48px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 48px;
  align-items: start;
}
.footer__brand { display: flex; flex-direction: column; align-items: flex-start; }
.footer__logo-img { width: 100%; max-width: 280px; height: auto; margin-bottom: 24px; filter: brightness(0) invert(1); }
.socials { display: flex; gap: 12px; margin-bottom: 24px; }
.socials a {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  display: grid;
  place-items: center;
  color: #fff;
  transition: background .2s ease, color .2s ease;
}
.socials a svg { width: 24px; height: 24px; }
.socials a[aria-label="Telegram"] svg { transform: translateX(-1.5px); }
.socials a:hover { background: #fff; color: var(--rose); }
.footer__copy { font-size: 0.8rem; color: rgba(255,255,255,0.65); margin-top: 28px; }

.footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.footer__col a {
  font-family: 'Manrope', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  transition: color .15s ease;
  display: block;
}
.footer__col a:hover { color: #fff; }
.footer__col--right { text-align: right; display: flex; flex-direction: column; gap: 28px; }
.footer__col ul.footer__legal { gap: 6px; }
.footer__legal a {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.5;
}
.footer__contacts { }
.footer__contacts-label {
  font-family: 'Manrope', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 10px;
}
.footer__contact-link {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(255,255,255,0.85);
  line-height: 2;
  transition: color .15s ease;
}
.footer__contact-link:hover { color: #fff; }

@media (max-width: 960px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 36px 32px; }
  .footer__col--right { text-align: left; }
}
@media (max-width: 520px) {
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .footer__brand { order: 99; align-items: flex-start; margin-top: 8px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.18); width: 100%; }
  .footer__logo-img { max-width: 200px; margin-bottom: 18px; }
  .footer__copy { margin-top: 18px; }
}

/* === CONTACTS MODAL === */
.contacts-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.contacts-modal.open { display: flex; }
.contacts-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(58, 46, 41, 0.55);
  backdrop-filter: blur(2px);
}
.contacts-modal__dialog {
  position: relative;
  background: var(--bg);
  border-radius: 8px;
  max-width: 440px;
  width: 100%;
  padding: 44px 40px 36px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  text-align: center;
  animation: cm-pop .25s ease;
}
@keyframes cm-pop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.contacts-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}
.contacts-modal__close:hover { background: var(--bg-deeper); color: var(--ink); }
.contacts-modal__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 10px;
}
.contacts-modal__sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 26px;
  line-height: 1.55;
}
.contacts-modal__socials {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}
.contacts-modal__socials a {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--rose);
  color: var(--rose);
  display: grid;
  place-items: center;
  transition: background .2s ease, color .2s ease;
}
.contacts-modal__socials a:hover { background: var(--rose); color: #fff; }
.contacts-modal__socials a[aria-label="Telegram"] svg { transform: translateX(-1.5px); }
.contacts-modal__call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--rose);
  color: #fff;
  padding: 14px 20px;
  border-radius: 4px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background .2s ease;
  margin-bottom: 16px;
}
.contacts-modal__call:hover { background: var(--rose-dark); }
.contacts-modal__email {
  display: block;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.contacts-modal__email:hover { color: var(--rose); }
@media (max-width: 480px) {
  .contacts-modal__dialog { padding: 36px 24px 28px; }
  .contacts-modal__title { font-size: 24px; }
}

/* === SCROLL REVEAL === */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-slide { transform: translateY(30px); transition: transform .8s ease; }
.reveal-slide.visible { transform: translateY(0); }
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }
.reveal-delay-4 { transition-delay: .32s; }
