/* ============================================================
   Habita Tables — стили страницы продукта.
   Телефон-мокап и доска кухни нарисованы чистым CSS,
   анимация цикла заказа — CSS keyframes (12s), при
   prefers-reduced-motion остаётся статичный кадр.
   ============================================================ */

/* ---------- Херо страницы ---------- */

.tables-hero .trust-line {
  margin-top: 1.6rem;
  font-size: 0.88rem;
  color: var(--dimmed);
}

/* ---------- Телефон-мокап ---------- */

.phone-wrap {
  display: grid;
  place-items: center;
}

.phone {
  /* position: relative — «чёлка» позиционируется от корпуса.
     Без наклона: rotate размывал текст внутри мокапа (subpixel-рендеринг). */
  position: relative;
  width: min(290px, 78vw);
  aspect-ratio: 290 / 590;
  background: #1b1f21;
  border-radius: 44px;
  padding: 10px;
  box-shadow:
    0 24px 60px rgba(23, 51, 122, 0.18),
    0 6px 16px rgba(29, 29, 29, 0.12);
}

.phone-screen {
  position: relative;
  height: 100%;
  background: #f2f5f4;
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.35;
}

.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 86px;
  height: 22px;
  background: #1b1f21;
  border-radius: 999px;
  z-index: 3;
}

/* Шапка приложения */
.app-header {
  padding: 42px 16px 12px;
  background: #fff;
  border-bottom: 1px solid #e2e8e5;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.app-name {
  display: block;
  font-weight: 700;
  font-size: 14px;
}

.app-table {
  display: block;
  font-size: 11px;
  color: #64746d;
}

.app-lang {
  font-size: 11px;
  font-weight: 700;
  color: #44544d;
  background: #e9efed;
  border-radius: 999px;
  padding: 3px 9px;
}

/* Чипы категорий */
.app-chips {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  overflow: hidden;
}

.app-chips span {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 999px;
  background: #e9efed;
  color: #44544d;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.app-chips span.on {
  background: var(--teal-deep);
  color: #fff;
}

/* Карточки блюд */
.app-dishes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 16px;
  flex: 1;
}

.dish {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e2e8e5;
  border-radius: 14px;
  padding: 9px;
}

.dish-photo {
  width: 52px;
  height: 44px;
  border-radius: 9px;
  flex-shrink: 0;
}

.dish-photo.p1 {
  background: linear-gradient(135deg, #f7d9b8, #e8a45f);
}

.dish-photo.p2 {
  background: linear-gradient(135deg, #d7e8cf, #8fbb7e);
}

/* Пометка наличия в строке блюда мокапа (в потоке — не зависит от размера фото) */
.dish-flag {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff4e6;
  color: #9a3412;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.dish-photo.p3 {
  background: linear-gradient(135deg, #f4cfc4, #d98873);
}

.dish-lines {
  flex: 1;
  min-width: 0;
}

.dish-lines i {
  display: block;
  height: 7px;
  border-radius: 4px;
  background: #dfe7e4;
}

.dish-lines i:first-child {
  width: 72%;
  background: #c6d2cc;
  margin-bottom: 5px;
}

.dish-lines i + i {
  width: 48%;
}

.dish-price {
  font-size: 11px;
  font-weight: 700;
  color: #16241f;
  white-space: nowrap;
}

.dish-add {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e6fcf5;
  color: var(--teal-deep);
  font-weight: 800;
  font-size: 15px;
}

/* Нижний бар «Заказ стола» */
.app-cartbar {
  margin: 8px 16px 14px;
  background: linear-gradient(135deg, #0ca678, #087f5b);
  color: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  box-shadow: 0 8px 20px rgba(12, 166, 120, 0.35);
}

.avatars {
  display: flex;
}

.avatars i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #0b9068;
}

.avatars i + i {
  margin-left: -6px;
}

.avatars i:nth-child(1) {
  background: #ffd43b;
}

.avatars i:nth-child(2) {
  background: #74c0fc;
}

.avatars i:nth-child(3) {
  background: #ffa8a8;
}

.cart-count {
  margin-left: auto;
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 11px;
  font-weight: 800;
}

.cart-count span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

/* Статусные чипы поверх экрана (появляются в анимации) */
.app-status {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 74px;
  display: grid;
  z-index: 2;
  pointer-events: none;
}

.app-status .st {
  grid-area: 1 / 1;
  justify-self: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(29, 29, 29, 0.16);
  opacity: 0;
}

.st-wait {
  background: #fff4e6;
  color: #9a3412;
}

.st-ok {
  background: #e6fcf5;
  color: #087f5b;
}

/* --- Анимация цикла заказа (12s) --- */

@media (prefers-reduced-motion: no-preference) {
  /* 1) пульс кнопки «+» у второго блюда */
  .dish:nth-child(2) .dish-add {
    animation: mock-add 12s infinite;
  }

  /* 2) счётчик 2 → 3 */
  .cart-count .c2 {
    animation: mock-c2 12s infinite;
  }
  .cart-count .c3 {
    animation: mock-c3 12s infinite;
  }

  /* 3) статус «Ожидает подтверждения» → «Принят» */
  .st-wait {
    animation: mock-wait 12s infinite;
  }
  .st-ok {
    animation: mock-ok 12s infinite;
  }
}

/* Статичный кадр при reduced-motion: счётчик «2», статусов не видно */
.cart-count .c2 {
  opacity: 1;
}

.cart-count .c3 {
  opacity: 0;
}

@keyframes mock-add {
  0%,
  12%,
  22%,
  100% {
    transform: scale(1);
    background: #e6fcf5;
    color: var(--teal-deep);
  }
  15%,
  19% {
    transform: scale(1.35);
    background: var(--teal-deep);
    color: #fff;
  }
}

@keyframes mock-c2 {
  0%,
  16% {
    opacity: 1;
  }
  19%,
  96% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes mock-c3 {
  0%,
  16% {
    opacity: 0;
  }
  19%,
  96% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes mock-wait {
  0%,
  30% {
    opacity: 0;
    transform: translateY(8px);
  }
  35%,
  60% {
    opacity: 1;
    transform: translateY(0);
  }
  65%,
  100% {
    opacity: 0;
    transform: translateY(0);
  }
}

@keyframes mock-ok {
  0%,
  63% {
    opacity: 0;
    transform: translateY(8px);
  }
  68%,
  90% {
    opacity: 1;
    transform: translateY(0);
  }
  95%,
  100% {
    opacity: 0;
  }
}

/* ---------- Секция «Знакомо?» ---------- */

.pain-answer {
  margin-top: 1.6rem;
  padding: 1.2rem 1.6rem;
  border-radius: var(--radius);
  background: var(--teal-soft);
  color: #0b6b59;
  font-weight: 600;
  max-width: 760px;
}

/* ---------- Шаги «Как это работает» ---------- */

.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step {
  counter-increment: step;
  position: relative;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--teal-deep);
  margin-bottom: 0.8rem;
}

.step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.step p {
  margin: 0;
  color: var(--dimmed);
  font-size: 0.92rem;
}

/* ---------- Секция персонала (тёмная лента) ---------- */

.staff-band {
  background: var(--surface-dark);
  color: var(--ink-inverse);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem);
}

.staff-band .section-head h2 {
  color: #fff;
}

.staff-band .section-head .sub {
  color: var(--dim-inverse);
}

.staff-band .card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.staff-band .card h3 {
  color: #fff;
}

.staff-band .card p {
  color: var(--dim-inverse);
}

.staff-band .card .icon {
  background: rgba(23, 179, 149, 0.2);
  color: #3ed6b5;
}

.staff-band .card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* Мини-доска кухни */
.kitchen-board {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.kb-col {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 0.9rem;
}

.kb-col h4 {
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim-inverse);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.kb-col h4::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.kb-col.queued h4::before {
  background: #868e96;
}

.kb-col.preparing h4::before {
  background: #fab005;
}

.kb-col.ready h4::before {
  background: var(--teal);
}

.kb-ticket {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.kb-ticket:last-child {
  margin-bottom: 0;
}

.kb-ticket b {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(23, 179, 149, 0.25);
  color: #3ed6b5;
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  white-space: nowrap;
}

.kb-ticket i {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  flex: 1;
}

.kb-ticket i.short {
  flex: 0 0 40%;
}

/* ---------- Секция владельца ---------- */

.owner-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.value-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.value-list li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  font-size: 1.02rem;
}

.value-list .tick {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 0.1em;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-deep);
  display: grid;
  place-items: center;
}

.cap-rows {
  display: grid;
  gap: 0.7rem;
}

.cap-row {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

.cap-row .icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--teal-soft);
  color: var(--teal-deep);
}

.cap-row h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
}

.cap-row p {
  margin: 0;
  color: var(--dimmed);
  font-size: 0.9rem;
}

/* ---------- Адаптив страницы ---------- */

@media (max-width: 960px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .owner-grid {
    grid-template-columns: 1fr;
  }
  /* Оффер (H1 + CTA) остаётся первым экраном, мокап — ниже текста */
}

@media (max-width: 640px) {
  .steps {
    grid-template-columns: 1fr;
  }
  .kitchen-board {
    grid-template-columns: 1fr;
  }
}
