:root {
  --primary: #ad2449;
  --primary-hover: #8f1b3b;
  --primary-soft: #fcf1f4;
  --bg: #f6f5f9;
  --card: #ffffff;
  --text: #1c1926;
  --muted: #6e6a7c;
  --border: #ebe8f2;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --tg: #24A1DE;
  --radius: 18px;
}

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

body {
  margin: 0;
  padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.show-on-mobile {
  display: none !important;
}

/* Верхний переключатель режимов */
.mode-switcher {
  background: #171421;
  color: #fff;
  padding: 8px 14px;
  position: sticky;
  top: 0;
  z-index: 120;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.mode-switcher-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.brand-mini-logo {
  background: #fff;
  border-radius: 6px;
  padding: 2px;
}

.badge-pill {
  background: rgba(173, 36, 73, 0.14);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.mode-switcher .badge-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #f9a8d4;
}

.mode-tabs {
  display: flex;
  gap: 6px;
}

.mode-tab {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #e5e7eb;
  padding: 7px 11px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: all 0.15s;
}

.mode-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Всплывающее SMS-уведомление */
.sms-toast {
  position: fixed;
  top: 60px;
  right: 16px;
  left: 16px;
  max-width: 370px;
  margin-left: auto;
  background: #1e1b2e;
  color: #fff;
  border-radius: 18px;
  padding: 16px;
  z-index: 300;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.16);
  animation: slideIn 0.25s ease-out;
}

@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sms-toast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #a5b4fc;
  margin-bottom: 6px;
}

.sms-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 16px;
}

.sms-toast-body {
  font-size: 14px;
  line-height: 1.45;
}

.sms-code-highlight {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 18px;
  letter-spacing: 2px;
  margin: 4px 0;
}

/* Модальные окна и шторка камеры */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 24, 0.62);
  backdrop-filter: blur(4px);
  z-index: 250;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-sheet {
  background: #fff;
  width: 100%;
  max-width: 540px;
  border-radius: 24px 24px 0 0;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  animation: sheetUp 0.22s ease-out;
}

.modal-sheet-large {
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.privacy-scroll-box {
  overflow-y: auto;
  max-height: 58vh;
  padding-right: 6px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #2f2b3a;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.privacy-consent-box {
  background: #faf8fc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 14px;
}

.privacy-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

.camera-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}

.camera-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 12px;
  border-radius: 16px;
  border: 2px dashed #d1cde0;
  background: #faf9fc;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  transition: all 0.15s;
}

.camera-action-btn.primary-cam {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.cam-icon {
  font-size: 26px;
}

.photo-preview-wrap {
  margin: 12px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--primary);
  background: #f3f4f6;
}

.photo-preview-wrap img {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  display: block;
}

/* Контейнер порталов */
.portal-container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 16px;
  flex: 1;
}

/* Шапка магазина и Логотип с «Санкт-Петербург» строго по ширине логотипа */
.shop-header {
  background: var(--card);
  padding: 12px 18px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(20, 10, 40, 0.04);
  margin-bottom: 14px;
}

.logo-block {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  cursor: pointer;
  width: fit-content;
}

.logo-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo-img {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: block;
}

.logo-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.6px;
  line-height: 1;
}

.logo-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
}

/* Надпись Санкт-Петербург под логотипом, никогда не выходит за длину логотипа */
.logo-city-under {
  width: 100%;
  max-width: 100%;
  margin-top: 4px;
  padding-top: 3px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2.2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.header-contacts-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 800;
  border: 1px solid rgba(173, 36, 73, 0.2);
  transition: transform 0.12s, background 0.15s;
}

.phone-call-btn:active {
  transform: scale(0.97);
}

/* Круглая иконка Telegram без текста в шапке */
.tg-circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--tg);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(36, 161, 222, 0.28);
  transition: transform 0.15s, background 0.15s;
}

.tg-circle-btn:hover {
  transform: translateY(-1px);
  background: #1b8ec7;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.count-badge {
  background: var(--primary);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  margin-left: 4px;
}

/* Слайдер баннеров */
.hero-slider-wrap {
  position: relative;
  margin-bottom: 18px;
}

.hero-banner {
  position: relative;
  background: linear-gradient(135deg, #2b0f1e 0%, #6d1838 55%, #ad2449 100%);
  background-size: cover;
  background-position: center;
  color: #fff;
  border-radius: 22px;
  padding: 28px 26px 38px;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: center;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg, rgba(24, 10, 20, 0.86) 0%, rgba(109, 24, 56, 0.72) 60%, rgba(173, 36, 73, 0.45) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.hero-banner h1 {
  margin: 12px 0 8px;
  font-size: 25px;
  max-width: 700px;
  line-height: 1.25;
}

.hero-banner p {
  max-width: 650px;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 14px;
  font-size: 14px;
}

.hero-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-badges span {
  background: rgba(0, 0, 0, 0.32);
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.slider-dots {
  position: absolute;
  bottom: 12px;
  left: 26px;
  z-index: 3;
  display: flex;
  gap: 7px;
  align-items: center;
}

.slider-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.slider-dot.active {
  width: 24px;
  background: #fff;
}

.slider-arrows {
  position: absolute;
  bottom: 10px;
  right: 16px;
  z-index: 3;
  display: flex;
  gap: 6px;
}

.slider-arrow-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Категории: одна строка без переноса, прокрутка вправо */
.categories-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 12px 0 16px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: #cfc8dc transparent;
}

.categories-bar::-webkit-scrollbar {
  height: 6px;
}

.categories-bar::-webkit-scrollbar-thumb {
  background: #cfc8dc;
  border-radius: 999px;
}

.cat-chip {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

.cat-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.products-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.products-empty {
  grid-column: 1 / -1;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.product-img-wrap {
  position: relative;
  height: 210px;
  background: #f3f1f7;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-rating-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.product-time-pill {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(28, 25, 38, 0.82);
  color: #fff;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
}

.product-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 5px;
}

.product-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.price-now {
  font-size: 18px;
  font-weight: 800;
}

.price-old {
  font-size: 12px;
  color: var(--muted);
  text-decoration: line-through;
  margin-left: 4px;
}

/* Кнопки и карточки */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: 13px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 13px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: none;
  padding: 10px 14px;
  border-radius: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

.btn-large {
  padding: 14px 20px;
  font-size: 15px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.checkout-layout,
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 18px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d5d1e0;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 8px;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.highlight-box {
  background: var(--primary-soft);
  padding: 12px;
  border-radius: 12px;
  margin: 12px 0;
  border: 1px dashed rgba(173, 36, 73, 0.35);
}

.auth-card {
  max-width: 480px;
  margin: 14px auto;
}

.auth-badge {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.admin-badge {
  background: #ede9fe;
  color: #6d28d9;
}

.otp-input {
  font-size: 26px !important;
  letter-spacing: 12px;
  text-align: center;
  font-weight: 800;
}

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

.hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.error-msg {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 13px;
}

.bonus-banner {
  background: linear-gradient(135deg, #fdf2f5, #fce7ee);
  border: 1px solid #f7c6d4;
  padding: 16px;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.bonus-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary);
}

.order-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px;
  margin-bottom: 14px;
  background: #fcfbfd;
}

.order-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-photo_approval {
  background: #fef3c7;
  color: #b45309;
}

.status-paid,
.status-accepted,
.status-assembling {
  background: #e0e7ff;
  color: #3730a3;
}

.status-delivering,
.status-completed {
  background: #d1fae5;
  color: #065f46;
}

.before-photo-box {
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 14px;
  padding: 12px;
  margin-top: 12px;
}

.before-photo-box img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 10px;
  margin: 8px 0;
}

.admin-header {
  background: var(--card);
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.active-adm-tab {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.demo-credentials-box {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

.demo-btns {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.btn-chip {
  background: #fff;
  border: 1px solid #c4b5fd;
  padding: 7px 11px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.staff-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.audit-logs {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
}

.audit-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.checkout-summary {
  background: #f9fafb;
  padding: 14px;
  border-radius: 12px;
  margin: 14px 0;
  font-size: 14px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.summary-total {
  font-size: 18px;
  font-weight: 800;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 8px;
}

.card-header-row,
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* Подвал сайта (Footer) */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  margin-top: 36px;
  padding: 28px 16px 24px;
}

.site-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr;
  gap: 24px;
}

.footer-about {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  max-width: 340px;
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text);
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.footer-contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-contact-item span {
  font-size: 12px;
  color: var(--muted);
}

.footer-mail-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.footer-mail-link:hover {
  text-decoration: underline;
}

.footer-tg-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--tg);
  color: #fff;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  margin-top: 6px;
  box-shadow: 0 4px 12px rgba(36, 161, 222, 0.25);
}

.site-footer-bottom {
  max-width: 1240px;
  margin: 22px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer-bottom a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

/* Нижний мобильный таб-бар (App Bar) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: none;
  justify-content: space-around;
  align-items: center;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 150;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.mob-tab {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
}

.mob-tab.active {
  color: var(--primary);
  font-weight: 700;
}

.mob-tab-icon {
  font-size: 20px;
  line-height: 1.1;
}

.mob-tab-icon-wrap {
  position: relative;
  display: inline-flex;
}

.mob-badge {
  position: absolute;
  top: -4px;
  right: -10px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  min-width: 17px;
  text-align: center;
}

/* Карточка товара: открывается по нажатию на товар */
.product-backdrop {
  align-items: center;
  padding: 16px;
}

.product-sheet {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 1040px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 22px;
  padding: 22px 24px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: sheetUp 0.22s ease-out;
}

.pm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(28, 25, 38, 0.08);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}

.pm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 28px;
}

.pm-main {
  position: relative;
  height: 440px;
  border-radius: 18px;
  overflow: hidden;
  background: #f3f1f7;
}

.pm-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pm-size-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(28, 25, 38, 0.78);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.pm-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.pm-thumbs::-webkit-scrollbar {
  display: none;
}

.pm-thumb {
  flex: 0 0 74px;
  height: 74px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f1f7;
  cursor: pointer;
}

.pm-thumb.active {
  border-color: var(--primary);
}

.pm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pm-more-btn {
  margin-top: 14px;
}

.pm-eta {
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
}

.pm-title {
  margin: 6px 0 8px;
  font-size: 24px;
  line-height: 1.25;
}

.pm-rating {
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--muted);
}

.pm-price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.pm-price {
  font-size: 28px;
  font-weight: 800;
}

.pm-save {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.qty-stepper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.qty-stepper button {
  width: 40px;
  height: 42px;
  border: none;
  background: #fff;
  font-size: 20px;
  cursor: pointer;
}

.qty-stepper span {
  min-width: 38px;
  text-align: center;
  font-weight: 700;
}

.pm-line {
  margin-top: 12px;
  font-size: 14px;
}

.pm-seller {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.pm-block {
  margin-top: 18px;
  font-size: 14px;
}

.pm-block h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.pm-description {
  margin-top: 26px;
}

.pm-description h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.pm-desc-text {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pm-description.expanded .pm-desc-text {
  display: block;
}

.pm-toggle {
  padding: 0;
  border: none;
  background: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.pm-similar {
  margin-top: 26px;
  padding: 18px;
  border-radius: 18px;
  background: var(--primary-soft);
}

.pm-similar h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

/* Фото товара в кабинете продавца (до 5 штук) */
.product-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.pp-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #f3f1f7;
}

.pp-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pp-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(28, 25, 38, 0.75);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.pp-main-label {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.photos-count {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.product-admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* Адаптация под мобильное приложение */
@media (max-width: 820px) {
  .hide-on-mobile {
    display: none !important;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .mode-switcher {
    display: none !important;
  }

  .show-on-mobile {
    display: inline-flex !important;
  }

  #shopPortal .mob-tab-label {
    display: none;
  }

  #shopPortal .mob-tab {
    padding: 6px 16px;
  }

  #shopPortal .mob-tab-icon {
    font-size: 23px;
  }

  .checkout-layout,
  .profile-grid,
  .form-row,
  .site-footer-inner {
    grid-template-columns: 1fr;
  }

  .portal-container {
    padding: 10px 12px;
  }

  .hero-banner {
    padding: 18px 16px 36px;
    border-radius: 18px;
    min-height: 190px;
  }

  .hero-banner h1 {
    font-size: 19px;
  }

  /* Категории и товары: свайп вправо, без видимой полосы прокрутки; в экране две карточки */
  .products-grid,
  .products-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .products-grid::-webkit-scrollbar,
  .products-row::-webkit-scrollbar,
  .categories-bar::-webkit-scrollbar,
  .pm-thumbs::-webkit-scrollbar {
    display: none;
  }

  .categories-bar,
  .pm-thumbs {
    scrollbar-width: none;
  }

  .products-grid > .product-card,
  .products-row > .product-card {
    flex: 0 0 calc((100% - 10px) / 2);
    scroll-snap-align: start;
  }

  .products-grid > .products-empty {
    flex: 0 0 100%;
  }

  .product-img-wrap {
    height: 170px;
  }

  .product-body {
    padding: 12px;
  }

  .product-title {
    font-size: 16px;
    line-height: 1.3;
  }

  .product-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
  }

  .product-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .product-footer .btn-sm {
    width: 100%;
    padding: 9px 10px;
    font-size: 14px;
  }

  .price-now {
    font-size: 19px;
  }

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

  /* Крупнее шрифт в мобильной версии для чтения */
  body {
    font-size: 17px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  label,
  .checkbox-label,
  .muted,
  .hint,
  small,
  .pm-line,
  .pm-seller,
  .pm-block,
  .pm-save {
    font-size: 15px;
  }

  .cat-chip {
    padding: 10px 16px;
    font-size: 15px;
  }

  .btn-primary,
  .btn-outline,
  .btn-danger {
    font-size: 16px;
  }

  .btn-sm {
    font-size: 14px;
  }

  .btn-large {
    font-size: 17px;
  }

  .hero-banner p,
  .privacy-scroll-box,
  .camera-action-btn,
  .error-msg,
  .summary-line {
    font-size: 16px;
  }

  .hero-tag,
  .hero-badges span {
    font-size: 13px;
  }

  .card h2 {
    font-size: 22px;
  }

  .card h3 {
    font-size: 19px;
  }

  .staff-item strong {
    font-size: 16px;
  }

  .mob-tab-label {
    font-size: 13px;
  }

  .product-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  /* Окно товара: отступы слева и справа, без горизонтальной прокрутки */
  .product-sheet {
    max-width: none;
    max-height: 94vh;
    padding: 16px 16px 24px;
    border-radius: 22px 22px 0 0;
    overflow-x: hidden;
  }

  .pm-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .pm-gallery,
  .pm-info,
  .pm-description,
  .pm-similar {
    min-width: 0;
  }

  .pm-main {
    width: 100%;
    height: 300px;
  }

  .pm-thumbs {
    width: 100%;
  }

  .pm-title {
    font-size: 22px;
  }

  .pm-price {
    font-size: 26px;
  }

  .pm-similar {
    padding: 14px;
  }

  /* Шапка на телефоне: логотип по центру, телефон и Telegram скрыты (звонок — в нижнем меню, Telegram — в подвале) */
  .header-contacts-bar {
    display: none;
  }

  .shop-header {
    justify-content: center;
  }

  .logo-block {
    margin: 0 auto;
  }

  .logo-top-row {
    justify-content: center;
  }

  /* Подвал на телефоне по центру */
  .site-footer,
  .site-footer-inner,
  .footer-col,
  .site-footer-bottom {
    text-align: center;
  }

  .site-footer-inner {
    justify-items: center;
  }

  .footer-about {
    margin: 0 auto;
  }

  .footer-col .logo-block {
    margin: 0 auto;
  }

  .footer-col .logo-top-row {
    justify-content: center;
  }

  .footer-contact-list,
  .footer-contact-item {
    align-items: center;
    text-align: center;
  }

  .footer-tg-button {
    margin-left: auto;
    margin-right: auto;
  }

  .site-footer-bottom {
    flex-direction: column;
    justify-content: center;
  }

  /* На телефоне категории скрыты в корзине и кабинете, баннер — только в «Магазин рекомендует» */
  .categories-bar.mobile-hidden,
  .hero-slider-wrap.mobile-hidden {
    display: none;
  }
}

@media (max-width: 420px) {
  .hide-on-xs {
    display: none !important;
  }
}
