/* ==========================================================================
   Violetta Shoes · дизайн-концепт · спільна основа (обидві сторінки)
   ========================================================================== */

:root {
  /* палітра з брифу */
  --bg: #FFFAFD;
  --milk: #FCFBF9;
  --powder: #F6CEE2;
  --rose: #ECD7E1;
  --berry: #91425F;   /* основні кнопки */
  --wine: #6B2E46;    /* темний винний */
  --ink: #412D37;     /* основний текст */
  --sage: #B8C7B1;    /* листочки й дрібні деталі */
  --sage-deep: #8FA589;
  --plum: #3A2230;    /* нижнє меню */

  --ink-2: #6C5862;
  --line: rgba(107, 46, 70, .16);
  --line-strong: rgba(107, 46, 70, .32);
  --shadow-soft: 0 24px 60px -32px rgba(107, 46, 70, .45);
  --shadow-card: 0 16px 40px -26px rgba(65, 45, 55, .5);

  --f-display: "Cormorant", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --f-body: "Jost", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1320px;
  --pad: clamp(18px, 4.2vw, 56px);
  --radius: 22px;
  --ease: cubic-bezier(.2, .75, .2, 1);
  --header-h: 64px;
  --tabbar-h: 0px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 3px;
  border-radius: 6px;
}
.on-dark :focus-visible,
.tabbar :focus-visible { outline-color: var(--powder); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--wine); color: var(--bg);
  padding: 10px 16px; border-radius: 999px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- типографіка ---------- */

.display {
  font-family: var(--f-display);
  font-weight: 500;
  letter-spacing: -.012em;
  line-height: .95;
}
.display em,
.accent {
  font-style: italic;
  font-weight: 500;
  color: var(--wine);
}

.h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(2.35rem, 1.45rem + 3.4vw, 4.4rem);
  line-height: .98;
  letter-spacing: -.01em;
}
.h2 em { font-style: italic; color: var(--wine); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--wine);
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: currentColor;
  opacity: .55;
}
.eyebrow--plain::before { display: none; }

.lead {
  font-size: clamp(1.02rem, .95rem + .3vw, 1.18rem);
  line-height: 1.6;
  color: var(--ink-2);
  font-weight: 400;
}
.lead em {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 1.18em;
  color: var(--wine);
}

.note {
  font-size: .8rem;
  line-height: 1.5;
  color: var(--ink-2);
}

/* ---------- позначка демоверсії ---------- */

.demo-chip {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .42em .9em .42em .7em;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(252, 251, 249, .8);
  color: var(--wine);
  font-weight: 500;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.demo-chip svg { width: 13px; height: 13px; flex: none; }

/* ---------- верхня рухома стрічка ---------- */

.ribbon {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  height: 34px;
  background: var(--powder);
  color: var(--wine);
  overflow: hidden;
}
.ribbon__viewport {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.ribbon__track {
  display: flex;
  width: max-content;
  animation: ribbon 38s linear infinite;
}
.ribbon__group {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding-right: 1.6rem;
  font-weight: 500;
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ribbon__group svg { width: 14px; height: 14px; color: var(--berry); flex: none; }
.ribbon:hover .ribbon__track,
.ribbon.is-paused .ribbon__track { animation-play-state: paused; }
.ribbon__toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-left: 1px solid rgba(107, 46, 70, .18);
  color: var(--wine);
}
.ribbon__toggle svg { width: 12px; height: 12px; }
.ribbon__toggle .i-play { display: none; }
.ribbon.is-paused .ribbon__toggle .i-play { display: block; }
.ribbon.is-paused .ribbon__toggle .i-pause { display: none; }

@keyframes ribbon {
  to { transform: translateX(-50%); }
}

/* ---------- шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 250, 253, .82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.brand img {
  width: auto;
  height: 46px;
}
.main-nav {
  display: flex;
  gap: 2rem;
  margin-inline: auto;
  font-size: .9rem;
  letter-spacing: .02em;
}
.main-nav a {
  position: relative;
  padding: .3rem 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--wine);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}
.main-nav a:hover::after,
.main-nav a:focus-visible::after { transform: scaleX(1); }
.main-nav .ext { display: inline-flex; align-items: center; gap: .35em; }
.main-nav .ext svg { width: 11px; height: 11px; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 52px;
  padding: .9rem 1.65rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .02em;
  line-height: 1.2;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s, color .3s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform .3s var(--ease); }
.btn--primary {
  background: var(--berry);
  color: var(--bg);
  box-shadow: 0 14px 30px -16px rgba(145, 66, 95, .8);
}
.btn--primary:hover { background: var(--wine); transform: translateY(-2px); box-shadow: 0 18px 34px -16px rgba(107, 46, 70, .85); }
.btn--primary:hover svg { transform: translateX(3px); }
.btn--primary:active { transform: translateY(0) scale(.98); }
.btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--wine);
  background: rgba(252, 251, 249, .6);
}
.btn--ghost:hover { background: var(--milk); transform: translateY(-2px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 500;
  color: var(--wine);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color .3s, gap .3s var(--ease);
}
.link-arrow svg { width: 16px; height: 16px; }
.link-arrow:hover { gap: .75rem; border-color: var(--wine); }

/* ---------- поява блоків ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .95s var(--ease), transform .95s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- квіткова лінія між секціями ---------- */

.bloom-line {
  display: flex;
  justify-content: center;
  padding-block: clamp(28px, 5vw, 56px);
  color: var(--wine);
}
.bloom-line svg { width: min(560px, 86vw); height: auto; overflow: visible; }
.bloom-line .stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .7;
}
.bloom-line .leaf { fill: var(--sage); opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.4); transition: opacity .8s ease 1.6s, transform 1s var(--ease) 1.6s; }
.bloom-line .bud { fill: var(--powder); stroke: var(--berry); stroke-width: 1; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.3); transition: opacity .8s ease 2s, transform 1.1s var(--ease) 2s; }
.js .bloom-line .stroke { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.4s cubic-bezier(.55, .1, .3, 1); }
.js .bloom-line.is-in .stroke { stroke-dashoffset: 0; }
.bloom-line.is-in .leaf,
.bloom-line.is-in .bud { opacity: 1; transform: none; }
html:not(.js) .bloom-line .leaf,
html:not(.js) .bloom-line .bud { opacity: 1; transform: none; }

/* ---------- пелюстки ---------- */

.petal {
  position: absolute;
  z-index: 2;
  width: var(--s, 22px);
  height: auto;
  color: var(--powder);
  pointer-events: none;
  opacity: .9;
  animation: drift var(--dur, 16s) ease-in-out var(--delay, 0s) infinite alternate;
}
.petal--rose { color: var(--rose); }
.petal--sage { color: var(--sage); }
.petal--berry { color: #E7A9C6; }

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) rotate(var(--r0, 0deg)); }
  50%  { transform: translate3d(calc(var(--dx, 20px) * .6), calc(var(--dy, 30px) * .5), 0) rotate(calc(var(--r0, 0deg) + 40deg)); }
  100% { transform: translate3d(var(--dx, 20px), var(--dy, 30px), 0) rotate(calc(var(--r0, 0deg) + 80deg)); }
}

/* ---------- підвал ---------- */

.site-footer {
  background: var(--rose);
  padding: 48px 0 calc(40px + var(--tabbar-h));
  text-align: center;
}
.site-footer__notice {
  max-width: 34rem;
  margin: 0 auto;
  font-family: var(--f-display);
  font-size: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  line-height: 1.3;
  color: var(--wine);
}
.site-footer__meta {
  margin-top: 14px;
  font-size: .78rem;
  color: var(--ink-2);
}
.site-footer__meta a { border-bottom: 1px solid var(--line-strong); }

/* ---------- нижнє мобільне меню ---------- */

.tabbar { display: none; }

@media (max-width: 899px) {
  :root { --header-h: 56px; --tabbar-h: 84px; }
  .main-nav { display: none; }
  .site-header__inner { justify-content: space-between; gap: .75rem; }
  .brand img { height: 32px; }

  .tabbar {
    position: fixed;
    z-index: 70;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px;
    border-radius: 26px;
    background: var(--plum);
    color: #F4E6ED;
    box-shadow: 0 18px 40px -18px rgba(58, 34, 48, .75);
  }
  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 56px;
    border-radius: 20px;
    font-size: .68rem;
    letter-spacing: .06em;
    color: rgba(244, 230, 237, .78);
    -webkit-tap-highlight-color: transparent;
    transition: color .3s, background-color .3s;
  }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="true"],
  .tabbar a.is-active {
    color: var(--powder);
    background: rgba(246, 206, 226, .1);
  }
  .tabbar a.is-active svg { transform: translateY(-1px); }
  body { padding-bottom: 0; }
  .site-footer { padding-bottom: calc(40px + 84px + env(safe-area-inset-bottom)); }
}

/* ---------- демо-чат ---------- */

.chat-fab {
  position: fixed;
  z-index: 72;
  right: 22px;
  bottom: 26px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--berry);
  color: var(--bg);
  box-shadow: 0 16px 34px -14px rgba(107, 46, 70, .8);
  transition: transform .35s var(--ease), background-color .3s;
}
.chat-fab:hover { transform: translateY(-3px) rotate(-4deg); background: var(--wine); }
.chat-fab > svg { width: 26px; height: 26px; }
.chat-fab__flower {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 24px;
  height: 24px;
  padding: 3px;
  border-radius: 50%;
  background: var(--powder);
  color: var(--berry);
  box-shadow: 0 0 0 2px var(--bg);
}
.chat-fab__flower svg { width: 100%; height: 100%; animation: spin-slow 14s linear infinite; }
.chat-fab[aria-expanded="true"] { transform: scale(.92); }

.chat-panel {
  position: fixed;
  z-index: 73;
  right: 22px;
  bottom: 100px;
  width: min(360px, calc(100vw - 24px));
  max-height: min(560px, calc(100dvh - 140px));
  display: flex;
  flex-direction: column;
  background: var(--milk);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 70px -30px rgba(65, 45, 55, .55);
  overflow: hidden;
  transform-origin: 100% 100%;
  animation: pop-in .38s var(--ease);
}
.chat-panel__head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(120deg, var(--powder), var(--rose));
}
.chat-panel__avatar {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg);
  color: var(--berry);
}
.chat-panel__avatar svg { width: 22px; height: 22px; }
.chat-panel__title { font-family: var(--f-display); font-size: 1.22rem; font-weight: 600; line-height: 1.1; color: var(--wine); }
.chat-panel__sub { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--wine); opacity: .75; }
.chat-panel__close {
  margin-left: auto;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--wine);
}
.chat-panel__close:hover { background: rgba(255, 250, 253, .6); }
.chat-panel__close svg { width: 18px; height: 18px; }
.chat-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}
.msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: .92rem;
  line-height: 1.45;
  animation: msg-in .35s var(--ease);
}
.msg--bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg--me { align-self: flex-end; background: var(--berry); color: var(--bg); border-bottom-right-radius: 6px; }
.msg .link-arrow { margin-top: 8px; font-size: .88rem; }
.msg.is-typing { display: inline-flex; gap: 4px; padding: 14px; }
.msg.is-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--berry); opacity: .4; animation: typing 1s infinite; }
.msg.is-typing i:nth-child(2) { animation-delay: .15s; }
.msg.is-typing i:nth-child(3) { animation-delay: .3s; }
.chat-panel__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.chat-panel__quick button {
  min-height: 40px;
  padding: .45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--wine);
  font-size: .86rem;
  font-weight: 500;
  transition: background-color .25s, color .25s, transform .25s var(--ease);
}
.chat-panel__quick button:hover { background: var(--powder); transform: translateY(-1px); }
.chat-panel__foot { padding: 0 16px 14px; font-size: .72rem; color: var(--ink-2); }

@media (max-width: 899px) {
  .chat-fab { right: 16px; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 84px); width: 56px; height: 56px; }
  .chat-panel { right: 12px; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 152px); max-height: calc(100dvh - 230px); }
}

@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.94); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes typing { 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* ---------- діалог-листівка ---------- */

.postcard {
  width: min(400px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--milk);
  color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(65, 45, 55, .6);
  overflow: visible;
}
.postcard[open] { animation: card-in .6s var(--ease); }
.postcard::backdrop { background: rgba(65, 45, 55, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.postcard__inner {
  position: relative;
  margin: 10px;
  padding: 34px 26px 26px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(246, 206, 226, .7), transparent 42%),
    radial-gradient(circle at 0 100%, rgba(184, 199, 177, .35), transparent 40%);
  text-align: center;
}
.postcard__stamp {
  position: absolute;
  top: -18px;
  right: 22px;
  width: 58px;
  height: 66px;
  padding: 6px;
  background: var(--bg);
  border: 2px dotted var(--rose);
  border-radius: 4px;
  color: var(--berry);
  transform: rotate(6deg);
  box-shadow: var(--shadow-card);
}
.postcard__stamp svg { width: 100%; height: 100%; }
.postcard__kicker { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--wine); }
.postcard__text {
  margin: 12px 0 22px;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.35rem);
  line-height: 1.05;
  color: var(--wine);
}
.postcard__sign { margin-top: 14px; font-size: .78rem; color: var(--ink-2); }
.postcard__close {
  position: absolute;
  top: 8px; left: 8px;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--wine);
}
.postcard__close svg { width: 18px; height: 18px; }
.postcard__close:hover { background: var(--rose); }

@keyframes card-in {
  from { opacity: 0; transform: translateY(26px) rotate(-3deg) scale(.96); }
  to { opacity: 1; transform: none; }
}

/* ---------- менше руху за бажанням системи ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .petal { display: none; }
  .ribbon__track { animation: none; }
}
