:root {
  --accent: #ffd400;
  --accent-dark: #f2c400;
  --ink: #111827;
  --muted: #6b7280;
  --bg: #000000;
  --card: #ffffff;
  --surface: #f3f4f6;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

.hidden {
  display: none !important;
}

/* Верхняя панель */
.top-bar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.lang-switch, .feed-counter, .circle-btn {
  pointer-events: auto;
}

.lang-switch {
  display: inline-flex;
  background: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.lang-btn.active {
  background: var(--accent);
  color: var(--ink);
}

.feed-counter {
  background: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}

.circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(10px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.circle-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Загрузка */
.state-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #000;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Вертикальная лента */
.feed {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.slide {
  position: relative;
  width: 100%;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  touch-action: pan-y;
  background: #000;
  overflow: hidden;
}

.slide-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.slide-gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0) 20%,
    rgba(0, 0, 0, 0) 60%,
    rgba(0, 0, 0, 0.65) 100%
  );
}

.pause-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pause-indicator.visible {
  opacity: 1;
}

/* Боковая панель с контурными белыми иконками без подложки */
.side-actions {
  position: absolute;
  right: 12px;
  bottom: calc(112px + env(safe-area-inset-bottom));
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.action-btn {
  background: none;
  border: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.78));
}

.action-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, color 0.15s ease;
}

.action-icon svg {
  width: 28px;
  height: 28px;
}

.action-btn:active .action-icon {
  transform: scale(0.88);
}

.action-btn.liked .action-icon {
  color: var(--accent);
}

.action-btn.liked .action-icon svg {
  fill: rgba(255, 212, 0, 0.25);
}

.action-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

/* Нижняя белая плашка товара */
.product-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 15;
  background: var(--card);
  color: var(--ink);
  border-radius: 18px;
  padding: 5px 10px 5px 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
}

.dock-thumb-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  cursor: pointer;
}

.dock-thumb {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface);
  display: block;
}

.dock-thumb-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 6px;
  line-height: 1.1;
}

.dock-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 2px 0;
}

.dock-title {
  width: 100%;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  cursor: pointer;
}

.dock-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.dock-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
}

.price-main {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.price-currency {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.price-old {
  font-size: 12px;
  color: var(--muted);
  text-decoration: line-through;
  white-space: nowrap;
}

.badge-discount {
  background: #fee2e2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}

.cta-btn {
  border: none;
  background: var(--accent);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 800;
  padding: 9px 13px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.12s ease;
}

.cta-btn:active {
  background: var(--accent-dark);
  transform: scale(0.98);
}

.cta-btn.full-width {
  width: 100%;
  padding: 15px;
  font-size: 15px;
  margin-top: 8px;
}

.cta-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Нижние шторки */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  z-index: 40;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--card);
  color: var(--ink);
  border-radius: 24px 24px 0 0;
  padding: 12px 18px max(22px, env(safe-area-inset-bottom));
  max-height: 88dvh;
  overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: #d1d5db;
  margin: 0 auto 14px;
}

.sheet-product-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.sheet-thumb {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}

.sheet-head-info h3 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 5px;
}

.sheet-prices {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.desc-body {
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
  white-space: pre-line;
  margin-bottom: 16px;
  background: var(--surface);
  padding: 12px 14px;
  border-radius: 14px;
}

/* Форма заказа */
.order-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
}

.field-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1.5px solid #e5e7eb;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  outline: none;
}

.field-input:focus {
  border-color: var(--accent-dark);
  background: #fff;
}

.phone-mode-pills {
  display: flex;
  gap: 8px;
}

.mode-pill {
  flex: 1;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid #e5e7eb;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.mode-pill.active {
  border-color: var(--ink);
  background: #fef9c3;
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.success-wrap {
  text-align: center;
  padding: 18px 6px 8px;
}

.success-icon {
  margin-bottom: 10px;
}

.success-wrap h3 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 6px;
}

.success-wrap p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
}

/* Фиксированная ширина правого блока иконок и кнопки заказа при смене UZ/RU */
.side-actions {
  right: 8px;
  width: 74px;
}

.action-btn {
  width: 100%;
}

.action-label {
  width: 100%;
  text-align: center;
  white-space: nowrap;
}

.dock-bottom-row .cta-btn {
  min-width: 114px;
}
