:root {
  --bg: #fff8f3;
  --surface: #ffffff;
  --accent: #d85a7f;
  --accent-pressed: #c0496c;
  --chocolate: #4a2e2a;
  --text: #2b2b2b;
  --muted: #6f6360;
  --stroke: #f0dfd8;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-soft: 0 10px 30px rgba(74, 46, 42, 0.08);
}

html {
  height: 100%;
}

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

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: radial-gradient(circle at top, #fffdfb 0%, var(--bg) 50%, #fdeee7 100%);
  color: var(--text);
  line-height: 1.45;
  min-height: 100svh;
  overflow: hidden;
}

.page {
  width: min(100%, 920px);
  margin: 0 auto;
  height: 100svh;
  padding: clamp(10px, 2.4vh, 16px) 12px;
  display: grid;
  gap: clamp(8px, 1.8vh, 12px);
  grid-template-rows: auto minmax(0, 1fr);
}

.page.products-hidden {
  min-height: 100vh;
  align-content: center;
}

.page.products-hidden .hero {
  width: min(100%, 640px);
  margin: 0 auto;
}

.page.products-hidden .quick-actions {
  justify-items: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: clamp(12px, 2vh, 16px);
}

.is-hidden {
  display: none !important;
}

.hero-mini-text {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--muted);
}

.hero-title {
  font-family: "Playfair Display", serif;
  margin: 0;
  color: var(--chocolate);
  font-size: clamp(32px, 7.5vw, 44px);
  line-height: 1.1;
}

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

.hero-title-wrap {
  display: grid;
  gap: 0;
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffe4ee 0%, #ffd4e4 52%, #f9f2eb 100%);
  border: 1px solid #f3cad8;
  box-shadow: 0 8px 22px rgba(216, 90, 127, 0.22);
  display: grid;
  place-items: center;
}

.logo-mark {
  font-family: "Playfair Display", serif;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
  color: var(--chocolate);
}

.logo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 17px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  border: 0;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(216, 90, 127, 0.3);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-pressed);
}

.btn-flowwow {
  background: #ff7663;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(255, 118, 99, 0.3);
}

.btn-flowwow:hover,
.btn-flowwow:focus-visible {
  background: #e86756;
}

.btn-secondary {
  color: var(--chocolate);
  background: #fff6f8;
  border: 1px solid #f1c7d4;
}

.quick-actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.messenger-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.social-btn {
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  padding: 0 8px;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.social-icon-svg {
  width: 18px;
  height: 18px;
  display: block;
}

.btn-phone {
  gap: 0;
  justify-content: center;
  white-space: nowrap;
  position: relative;
  background: #fff8f6;
  border-color: #ffb7ac;
  box-shadow:
    inset 0 0 0 1px rgba(255, 118, 99, 0.5),
    0 0 7px rgba(255, 118, 99, 0.34),
    0 0 15px rgba(255, 118, 99, 0.22);
  animation: phone-border-flicker 1.9s ease-in-out infinite;
}

.phone-text {
  font-size: 15px;
  display: inline-block;
  transform-origin: center;
  animation: phone-number-breathe 1.9s ease-in-out infinite;
}

@keyframes phone-number-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

@keyframes phone-border-flicker {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 118, 99, 0.65),
      0 0 8px rgba(255, 118, 99, 0.38),
      0 0 17px rgba(255, 118, 99, 0.24);
  }
  35% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 118, 99, 0.35),
      0 0 4.5px rgba(255, 118, 99, 0.24),
      0 0 9px rgba(255, 118, 99, 0.14);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 118, 99, 0.8),
      0 0 11px rgba(255, 118, 99, 0.56),
      0 0 23px rgba(255, 118, 99, 0.4);
  }
  68% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 118, 99, 0.4),
      0 0 5.5px rgba(255, 118, 99, 0.28),
      0 0 11px rgba(255, 118, 99, 0.16);
  }
}

.section-head {
  margin-bottom: 8px;
}

.section-head h2 {
  margin: 0 0 4px;
  font-family: "Playfair Display", serif;
  color: var(--chocolate);
  font-size: clamp(20px, 4.4vw, 28px);
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.carousel-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 84%;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: none;
  scrollbar-width: none;
  scroll-behavior: auto;
  padding-bottom: 2px;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.product-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background: #fffefc;
  overflow: hidden;
  display: grid;
}

.product-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.product-content {
  padding: 10px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #7f3f53;
  background: #ffe5ed;
  border-radius: 999px;
  padding: 5px 10px;
}

.product-title {
  margin: 8px 0 6px;
  font-size: 16px;
  color: var(--chocolate);
  line-height: 1.2;
}

.product-description {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.product-price {
  font-weight: 700;
  font-size: 15px;
}

.product-link {
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
}

.carousel-wrap::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 56px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to left, var(--surface), rgba(255, 255, 255, 0));
}

.btn-bottom {
  margin-top: 8px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.products {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

@media (max-width: 719px) {
  .page {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .products {
    padding: 10px;
    gap: 6px;
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .section-head {
    margin-bottom: 4px;
  }

  .section-head h2 {
    font-size: 19px;
  }

  .section-head p {
    font-size: 12px;
  }

  .carousel {
    grid-auto-columns: 78%;
    gap: 8px;
    padding-bottom: 0;
    height: 100%;
    align-items: stretch;
  }

  .carousel-wrap {
    height: 100%;
    min-height: 0;
  }

  .product-card {
    border-radius: 14px;
    height: 100%;
    grid-template-rows: auto 1fr;
  }

  .product-image {
    aspect-ratio: 2.1 / 1;
  }

  .product-content {
    padding: 8px;
  }

  .badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  .product-title {
    margin: 6px 0 4px;
    font-size: 15px;
  }

  .product-description {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.25;
    -webkit-line-clamp: 1;
  }

  .product-price {
    font-size: 14px;
  }

  .product-link {
    font-size: 13px;
  }

  .btn-bottom {
    min-height: 42px;
    margin-top: 0;
    align-self: end;
  }
}

.btn-vk {
  background: #0077ff;
  border-color: #0067db;
  color: #ffffff;
}

.btn-vk:hover,
.btn-vk:focus-visible {
  background: #0067db;
}

.btn-whatsapp {
  background: #25d366;
  border-color: #1fb75a;
  color: #ffffff;
}

.btn-whatsapp:hover,
.btn-whatsapp:focus-visible {
  background: #1fb75a;
}

.btn-telegram {
  background: #2aabee;
  border-color: #1996d8;
  color: #ffffff;
}

.btn-telegram:hover,
.btn-telegram:focus-visible {
  background: #1996d8;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.modal.is-hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 19, 17, 0.45);
}

.modal-content {
  position: relative;
  margin: 10vh auto 0;
  width: min(92vw, 420px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
  padding: 18px;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  font-size: 26px;
  color: var(--muted);
  cursor: pointer;
}

.modal-content h3 {
  margin: 0 0 6px;
  font-size: 24px;
  color: var(--chocolate);
  font-family: "Playfair Display", serif;
}

.modal-text {
  margin: 0 0 12px;
  color: var(--muted);
}

.modal-form {
  display: grid;
  gap: 10px;
}

.modal-input {
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid #dfd0ca;
  padding: 0 12px;
  font-size: 16px;
}

.modal-input:focus {
  outline: 2px solid #f0b8ca;
  border-color: #e0a5b8;
}

.modal-feedback {
  min-height: 20px;
  margin: 0;
  font-size: 14px;
  color: var(--chocolate);
}

.modal-feedback.is-error {
  color: #9a2f2f;
}

.modal-feedback.is-success {
  color: #1f7a38;
}

.order-success {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: success-fade-in 0.28s ease-out;
}

.order-success-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(145deg, #35bf5b 0%, #1e9f45 100%);
  box-shadow: 0 0 0 3px rgba(53, 191, 91, 0.2);
}

@keyframes success-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 720px) {
  .page {
    padding: clamp(12px, 2vh, 18px) clamp(14px, 2.2vw, 20px);
    gap: clamp(10px, 1.6vh, 14px);
  }

  .hero {
    padding: clamp(14px, 2vh, 18px);
  }

  .carousel {
    grid-auto-columns: 44%;
  }

}

@media (min-width: 1080px) {
  .carousel {
    grid-auto-columns: 30%;
  }
}
