/* Кольори й шрифти */
:root {
  color-scheme: light;
  --paper: #faf7ef;
  --card: #fffcf6;
  --ink: #283a2e;
  --muted: #596258;
  --rose: #93415c;
  --line: #ddd9ca;
  --sage: #e8ecdf;
  --serif: Lora, Georgia, serif;
  --sans: Manrope, system-ui, sans-serif;
  --header-height: 76px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 22px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
}

body:has(dialog[open]) { overflow: hidden; }

img {
  display: block;
  width: 100%;
  height: auto;
}

p, h1, h2, h3, figure, dl, dd, blockquote { margin: 0; }
h1, h2, h3 { font: 400 1em/1.16 var(--serif); }

h2 {
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  letter-spacing: -.047em;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea { font: inherit; }

button {
  color: inherit;
  cursor: pointer;
}

[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 5px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wrap {
  width: min(100% - 112px, 1240px);
  margin-inline: auto;
}

.section { padding-block: clamp(60px, 7.2vw, 108px); }

.skip-link {
  position: fixed;
  z-index: 5;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  background: var(--card);
  padding: 8px 16px;
}

.skip-link:focus { transform: translateY(0); }

/* Шапка сайту */
.site-header {
  position: sticky;
  z-index: 4;
  top: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 400 30px/1 var(--serif);
  letter-spacing: -.068em;
  white-space: nowrap;
}

.flower {
  width: 31px;
  height: 31px;
  color: var(--rose);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3.4vw, 48px);
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
}

.main-nav a:hover, .text-link:hover { color: var(--rose); }

/* Кнопки */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 49px;
  padding: 10px 19px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  transition: background-color .18s, border-color .18s, color .18s;
}

.button .icon {
  width: 19px;
  height: 19px;
}

.button-primary {
  background: var(--ink);
  color: #fffdf6;
}

.button-primary:hover { background: #405343; }

.button-outline {
  border-color: #a5ac9c;
  background: transparent;
}

.button-outline:hover {
  background: var(--sage);
  border-color: var(--ink);
}

.header-order {
  min-height: 42px;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.icon-button:hover { background: var(--sage); }

/* Перший екран і переваги */
.hero {
  display: grid;
  grid-template-columns: .88fr 1.12fr;
  gap: clamp(22px, 4vw, 62px);
  align-items: center;
  padding-block: 33px 29px;
}

.hero-copy { padding-block: 12px 35px; }

.eyebrow {
  margin-bottom: 23px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(38px, 4.3vw, 65px);
  line-height: 1.085;
  letter-spacing: -.06em;
}

.hero em {
  color: var(--rose);
  font-weight: 400;
}

.hero-description {
  max-width: 365px;
  margin-block: 23px 28px;
  color: var(--muted);
  line-height: 1.72;
}

.hero .button {
  min-height: 54px;
  padding-inline: 22px;
}

.hero-image {
  aspect-ratio: 1.24;
  object-fit: cover;
  object-position: 50% 47%;
  border-radius: 7px;
  background: #4e4739;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-block: 20px;
  border-block: 1px solid var(--line);
}

.benefit {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 5px clamp(14px, 3vw, 44px);
}

.benefit:first-child { padding-left: 0; }
.benefit + .benefit { border-left: 1px solid var(--line); }

.benefit .icon {
  color: var(--rose);
  width: 29px;
  height: 29px;
}

.benefit h2 {
  font: 800 14px/1.4 var(--sans);
  letter-spacing: 0;
}

.benefit p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

/* Каталог */
.catalog { padding-top: clamp(56px, 5.2vw, 78px); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 24px;
}

.section-header p {
  margin-top: 9px;
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.filters button {
  min-height: 42px;
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 800;
}

.filters button:hover { border-color: var(--ink); }

.filters button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.bouquet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(13px, 2vw, 24px);
}

.bouquet {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
}

.bouquet-image {
  aspect-ratio: 1.1;
  object-fit: cover;
  background: #eee5d7;
}

.bouquet-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  padding: clamp(15px, 2vw, 25px);
}

.bouquet-tone {
  margin-bottom: 5px;
  color: var(--rose);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .095em;
  text-transform: uppercase;
}

.bouquet h3 {
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  letter-spacing: -.038em;
}

.composition {
  margin-block: 7px 18px;
  color: var(--muted);
  font-size: 13px;
}

.bouquet-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.price {
  font-size: 17px;
  white-space: nowrap;
}

.button-small {
  min-height: 43px;
  gap: 6px;
  padding: 7px 11px;
  font-size: 13px;
}

/* Доставка */
.delivery-band { background: var(--sage); }

.delivery-layout {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  align-items: start;
  gap: clamp(26px, 7vw, 116px);
  padding-block: clamp(49px, 6vw, 87px);
}

.delivery-intro p {
  max-width: 385px;
  margin-top: 15px;
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.delivery-rates { border-top: 1px solid #bfc7b7; }

.delivery-rates > div {
  display: grid;
  grid-template-columns: 1fr 1.53fr;
  gap: 16px;
  padding-block: 15px;
  border-bottom: 1px solid #bfc7b7;
}

.delivery-rates dt { font: 400 19px/1.35 var(--serif); }
.delivery-rates strong, .delivery-rates span { display: block; }
.delivery-rates strong { font-size: 15px; }

.delivery-rates span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

/* Відгуки */
.reviews { padding-bottom: clamp(45px, 5vw, 77px); }

.review-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.review {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(18px, 2.1vw, 28px);
  border-left: 2px solid #b88090;
  background: #f3e9e5;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-avatar {
  flex: 0 0 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--line);
}

.review-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.8);
  transform-origin: var(--portrait-focus, 65% top);
}

.review-identity {
  display: grid;
  gap: 4px;
  line-height: 1.25;
}

.review-rating {
  color: #895222;
  font: 16px/1 system-ui, sans-serif;
  letter-spacing: .07em;
  white-space: nowrap;
}

.review blockquote { font: 400 clamp(17px, 1.45vw, 21px)/1.5 var(--serif); }

.review-context {
  margin-top: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.review-controls { display: none; }

/* Питання та відповіді */
.faq {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: clamp(24px, 6vw, 85px);
  border-top: 1px solid var(--line);
  padding-top: clamp(47px, 6vw, 80px);
}

.questions { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }

summary {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding-block: 11px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.38;
  list-style: none;
}

summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--rose); }

summary .icon {
  color: var(--rose);
  transition: transform .16s;
}

details[open] summary .icon { transform: rotate(45deg); }

details > p {
  max-width: 620px;
  padding: 0 26px 15px 0;
  color: var(--muted);
  font-size: 14px;
}

/* Замовлення */
.order-band { background: #efe6e6; }

.order-layout {
  display: grid;
  grid-template-columns: .76fr 1.24fr;
  gap: clamp(26px, 6vw, 90px);
  align-items: center;
  padding-block: clamp(45px, 6.5vw, 92px);
}

.order-flower {
  display: block;
  width: 51px;
  height: 51px;
  margin-bottom: 13px;
  color: var(--rose);
  stroke-width: 1.05;
}

.order-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: clamp(16px, 3.2vw, 37px);
  border: 1px solid #e0d6cd;
  border-radius: 7px;
  background: var(--card);
}

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 800;
}

.field label span {
  color: var(--muted);
  font-weight: 400;
}

.field input, .field select, .field textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid #bcbeb0;
  border-radius: 4px;
  background: #fffefa;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
}

.field textarea { resize: vertical; }

.field select {
  padding-right: 20px;
  text-overflow: ellipsis;
}

.field input::placeholder, .field textarea::placeholder {
  color: #697067;
  opacity: 1;
}

.field-wide { grid-column: 1 / -1; }

.form-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 3px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.total span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.total output {
  font-size: 20px;
  font-weight: 800;
}

/* Підвал */
.site-footer { border-top: 1px solid var(--line); }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 23px;
  padding-block: 33px;
  font-size: 13px;
}

.footer-inner address {
  display: flex;
  align-items: start;
  gap: 8px;
  font-style: normal;
}

.footer-inner address .icon { color: var(--rose); }

.footer-links {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.footer-links button {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.footer-links a, .footer-links button {
  display: inline-flex;
  align-items: center;
  min-height: 35px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-links a:hover, .footer-links button:hover { color: var(--rose); }

/* Діалогові вікна */
dialog {
  width: min(540px, 100% - 32px);
  max-height: 88vh;
  padding: clamp(18px, 3.6vw, 32px);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--card);
}

dialog::backdrop { background: rgb(30 40 32 / .54); }

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.dialog-header h2 { font-size: clamp(25px, 5vw, 34px); }

.dialog-description {
  margin-block: 12px 19px;
  color: var(--muted);
  font-size: 14px;
}

.order-summary { border-top: 1px solid var(--line); }

.order-summary div {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 12px;
  padding-block: 7px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.order-summary dt { font-weight: 800; }

.order-summary dd {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 17px;
}

.copy-status {
  font-size: 13px;
  color: var(--muted);
}

/* Адаптивні стилі */
@media (max-width: 1100px) {
  .wrap { width: calc(100% - 72px); }
  .hero { gap: 28px; }
}

@media (max-width: 820px) {
  :root { --header-height: 65px; }
  .wrap { width: calc(100% - 48px); }
  .header-inner { gap: 15px; }
  .wordmark { font-size: 27px; }
  .main-nav { gap: 14px; }

  .header-order {
    padding-inline: 12px;
    gap: 5px;
  }
  .hero h1 { font-size: clamp(32px, 5vw, 47px); }
  .hero-description { margin-block: 16px 20px; }

  .benefit {
    gap: 8px;
    padding-inline: 10px;
  }

  .benefit .icon {
    width: 25px;
    height: 25px;
  }
}

@media (max-width: 680px) {
  .wrap { width: calc(100% - 36px); }

  .header-inner {
    justify-content: flex-start;
    min-height: var(--header-height);
    gap: 10px;
  }

  .header-order {
    margin-left: auto;
    font-size: 12px;
  }
  .header-order .icon { display: none; }
  .menu-toggle { order: 1; }

  .main-nav {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 16px;
  }
  .main-nav a { padding-block: 6px; }
  .nav-enhanced .main-nav {
    position: absolute;
    inset: 100% 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 6px 18px 13px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }
  .nav-enhanced .menu-toggle[aria-expanded="true"] + .main-nav { display: flex; }
  .nav-enhanced .main-nav a + a { border-top: 1px solid var(--line); }

  .site-header:not(.nav-enhanced) .header-inner {
    flex-wrap: wrap;
    padding-block: 8px;
  }

  .site-header:not(.nav-enhanced) .main-nav {
    order: 2;
    width: 100%;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-block: 32px 19px;
  }
  .hero-copy { padding: 0; }
  .eyebrow { margin-bottom: 13px; }
  .hero h1 { font-size: clamp(38px, 9vw, 56px); }
  .hero-description { font-size: 15px; }
  .hero .button { min-height: 48px; }
  .hero-image { aspect-ratio: 1.27; }

  .benefits {
    grid-template-columns: 1fr;
    padding-block: 0;
  }

  .benefit, .benefit:first-child {
    padding: 12px 3px;
    gap: 12px;
  }

  .benefit + .benefit {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .section-header {
    flex-direction: column;
    align-items: start;
  }
  .bouquet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bouquet-image { aspect-ratio: 1.02; }
  .delivery-layout, .faq, .order-layout { grid-template-columns: minmax(0, 1fr); }
  .review-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
  }
  .review-grid.has-controls { scrollbar-width: none; }
  .review { scroll-snap-align: start; }

  .review-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 13px;
  }
  .review-prev .icon { transform: rotate(180deg); }

  .review-controls [aria-disabled="true"] {
    opacity: .5;
    cursor: default;
    background: transparent;
  }

  .review-position {
    min-width: 55px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
  }

  .order-flower {
    width: 43px;
    height: 43px;
  }

  .footer-inner {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .footer-inner > div:first-child { width: 100%; }
}

@media (max-width: 450px) {
  .bouquet-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .bouquet-image { aspect-ratio: 1.15; }
  .order-form { grid-template-columns: minmax(0, 1fr); }
  .form-bottom .button { flex-grow: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
