/* ==========================================================================
   СОВРЕМЕННЫЙ GOOGLE ДИЗАЙН: MATERIAL YOU / PIXEL / GOOGLE STORE (2024–2026)
   ========================================================================== */

:root {
  /* Палитра Material You (Tonal Palette) */
  --my-primary: #0b57d0;
  --my-primary-hover: #0842a0;
  --my-primary-container: #d3e3fd;
  --my-on-primary-container: #041e49;

  /* Тональные фоны поверхностей */
  --my-bg-base: #f8fafd;
  --my-surface: #ffffff;
  --my-surface-container: #f0f4f9;

  /* Текстовые цвета */
  --my-text-headline: #1f1f1f;
  --my-text-body: #444746;
  --my-text-subtle: #747775;

  /* Границы */
  --my-border: rgba(0, 0, 0, 0.08);
  --my-border-hover: rgba(0, 0, 0, 0.16);

  /* Тональные сегменты цен */
  --tonal-teal-bg: #ccfbf1;
  --tonal-teal-text: #0f766e;

  --tonal-green-bg: #c4eed0;
  --tonal-green-text: #072711;

  --tonal-blue-bg: #d3e3fd;
  --tonal-blue-text: #041e49;

  --tonal-purple-bg: #e8def8;
  --tonal-purple-text: #21005d;

  --tonal-amber-bg: #ffdcbe;
  --tonal-amber-text: #2c1600;

  /* Скругления Material You */
  --corner-pill: 9999px;
  --corner-card: 28px;
  --corner-md: 20px;
  --corner-sm: 14px;

  /* Мягкие Google-тени */
  --shadow-float: 0 4px 16px -2px rgba(31, 31, 31, 0.05), 0 2px 6px -1px rgba(31, 31, 31, 0.03);
  --shadow-hover: 0 12px 28px -4px rgba(31, 31, 31, 0.09), 0 4px 10px -2px rgba(31, 31, 31, 0.05);

  /* Анимации Google */
  --anim-standard: 0.2s cubic-bezier(0.2, 0, 0, 1);
}

/* ==========================================================================
   ТЕМНАЯ ТЕМА: GOOGLE MATERIAL YOU / MATERIAL DESIGN 3 DARK
   ========================================================================== */
[data-theme="dark"] {
  /* Палитра Material You Dark */
  --my-primary: #8ab4f8;
  --my-primary-hover: #adc8ff;
  --my-primary-container: #0842a0;
  --my-on-primary-container: #d3e3fd;

  /* Тональные фоны поверхностей */
  --my-bg-base: #0f1217;
  --my-surface: #191d24;
  --my-surface-container: #222731;
  --my-surface-container-high: #2c3340;

  /* Текстовые цвета */
  --my-text-headline: #edf0f7;
  --my-text-body: #c4c7c5;
  --my-text-subtle: #8e918f;

  /* Границы */
  --my-border: rgba(255, 255, 255, 0.1);
  --my-border-hover: rgba(255, 255, 255, 0.2);

  /* Тональные сегменты цен в темном режиме */
  --tonal-teal-bg: rgba(20, 184, 166, 0.22);
  --tonal-teal-text: #5eead4;

  --tonal-green-bg: rgba(34, 197, 94, 0.22);
  --tonal-green-text: #86efac;

  --tonal-blue-bg: rgba(59, 130, 246, 0.22);
  --tonal-blue-text: #93c5fd;

  --tonal-purple-bg: rgba(168, 85, 247, 0.22);
  --tonal-purple-text: #d8b4fe;

  --tonal-amber-bg: rgba(245, 158, 11, 0.22);
  --tonal-amber-text: #fcd34d;

  /* Тени */
  --shadow-float: 0 4px 20px -2px rgba(0, 0, 0, 0.4), 0 2px 6px -1px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 12px 30px -4px rgba(0, 0, 0, 0.5), 0 4px 12px -2px rgba(0, 0, 0, 0.35);
}

/* Общий сброс и запрет выделения текста */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

[data-theme="dark"] {
  color-scheme: dark;
}

body {
  font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--my-bg-base);
  color: var(--my-text-headline);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

img {
  -webkit-user-drag: none;
  user-select: none;
}

/* Вспомогательные классы адаптивного текста */
.text-mobile {
  display: none !important;
}

.text-desktop {
  display: inline !important;
}

/* Скроллбар */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--corner-pill);
}

/* ==========================================================================
   НАВИГАЦИЯ
   ========================================================================== */

.my-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--my-border);
  height: 68px;
  display: flex;
  align-items: center;
  transition: background var(--anim-standard), border-color var(--anim-standard);
}

[data-theme="dark"] .my-navbar {
  background: rgba(25, 29, 36, 0.92);
}

.my-nav-container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.my-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Кнопка переключения темы */
.my-theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--corner-pill);
  background: var(--my-surface-container);
  border: 1px solid var(--my-border);
  color: var(--my-text-headline);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--anim-standard);
  flex-shrink: 0;
}

.my-theme-toggle:hover {
  background: var(--my-surface-container-high, #e5edfa);
  border-color: var(--my-border-hover);
  transform: scale(1.05);
}

.theme-icon-sun {
  display: none;
}

.theme-icon-moon {
  display: block;
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
  color: #fcd34d;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

.my-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.my-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.my-brand-logo-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.my-brand-text {
  display: flex;
  flex-direction: column;
}

.my-brand-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--my-text-headline);
  letter-spacing: -0.02em;
}

/* ==========================================================================
   ОСНОВНОЙ КОНТЕНТ
   ========================================================================== */

.my-content-wrapper {
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 24px 70px;
}

/* Hero заголовок */
.my-hero {
  margin-bottom: 28px;
}

.my-headline {
  font-size: clamp(1.85rem, 3.4vw, 2.45rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--my-text-headline);
  margin-bottom: 8px;
}

.my-headline-accent {
  color: var(--my-primary);
  font-weight: 700;
}

.my-subhead {
  font-size: 15.5px;
  font-weight: 400;
  color: var(--my-text-subtle);
  max-width: 640px;
  line-height: 1.5;
  letter-spacing: normal;
}

/* ==========================================================================
   ПАНЕЛЬ УПРАВЛЕНИЯ И ФИЛЬТРЫ
   ========================================================================== */

.my-controls-card {
  background: var(--my-surface);
  border: 1px solid var(--my-border);
  border-radius: var(--corner-card);
  padding: 22px 24px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.my-controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* Pill Segmented Switcher */
.my-segmented-pill {
  display: inline-flex;
  background: var(--my-surface-container);
  border-radius: var(--corner-pill);
  padding: 4px;
  gap: 4px;
}

.my-segment-btn {
  background: transparent;
  border: none;
  padding: 8px 18px;
  border-radius: var(--corner-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--my-text-body);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all var(--anim-standard);
  font-family: inherit;
  white-space: nowrap;
}

.my-segment-btn:hover {
  color: var(--my-text-headline);
}

.my-segment-btn.active {
  background: var(--my-surface);
  color: var(--my-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

[data-theme="dark"] .my-segment-btn.active {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Строка сегментов цен */
.my-filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.my-filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--my-text-body);
  min-width: 60px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.my-chips-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

/* Material You Filter Chips */
.md3-chip {
  background: var(--my-surface);
  border: 1px solid var(--my-border);
  border-radius: var(--corner-pill);
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--my-text-body);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--anim-standard);
  font-family: inherit;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.md3-chip:hover {
  background: var(--my-surface-container);
  border-color: var(--my-border-hover);
  color: var(--my-text-headline);
  transform: translateY(-1px);
}

.md3-chip.active {
  background: var(--my-primary);
  color: #ffffff;
  border-color: var(--my-primary);
  box-shadow: 0 3px 10px rgba(11, 87, 208, 0.25);
}

[data-theme="dark"] .md3-chip.active {
  color: #041e49;
  box-shadow: 0 3px 10px rgba(138, 180, 248, 0.3);
}

/* ==========================================================================
   ТАБЛИЦА MATERIAL YOU БЕЗ ОБРЕЗАНИЯ ТЕКСТА
   ========================================================================== */

.my-table-card {
  width: 100%;
  background: var(--my-surface);
  border: 1px solid var(--my-border);
  border-radius: var(--corner-card);
  box-shadow: var(--shadow-float);
  margin-bottom: 40px;
  position: relative;
}

.my-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 14.5px;
}

/* Фиксированная шапка */
.my-table thead th {
  position: sticky;
  top: 68px; /* Ровно высота navbar */
  z-index: 10;
  background: var(--my-surface);
  border-bottom: 2px solid var(--my-border);
  padding: 16px 24px;
  font-weight: 700;
  color: var(--my-text-body);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.my-table thead tr th:first-child {
  border-top-left-radius: var(--corner-card);
}

.my-table thead tr th:last-child {
  border-top-right-radius: var(--corner-card);
}

.col-price {
  width: 22%;
  min-width: 180px;
}

.col-official {
  width: 39%;
  min-width: 300px;
}

.col-all {
  width: 39%;
  min-width: 300px;
}

/* Десктопные режимы отображения одного магазина */
.my-table-card[data-mode="official"] .col-official {
  width: 78%;
}

.my-table-card[data-mode="all"] .col-all {
  width: 78%;
}

.th-tonal-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--corner-pill);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  margin-left: 8px;
}

.th-tonal-badge.green {
  background: var(--tonal-green-bg);
  color: var(--tonal-green-text);
}

.th-tonal-badge.blue {
  background: var(--tonal-blue-bg);
  color: var(--tonal-blue-text);
}

/* Строки таблицы */
.my-table tbody tr {
  transition: background-color var(--anim-standard);
}

.my-table tbody tr:nth-child(even) {
  background-color: #fbfcfd;
}

.my-table tbody tr:hover {
  background-color: #f0f5fc;
}

.my-table tbody tr td {
  padding: 18px 24px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.my-table tbody tr:last-child td {
  border-bottom: none;
}

.my-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--corner-card);
}

.my-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--corner-card);
}

/* Подсветка строки при выборе модели */
.my-table tbody tr.has-active-model {
  background-color: #e8f0fe !important;
  box-shadow: inset 4px 0 0 var(--my-primary);
}

[data-theme="dark"] .my-table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .my-table tbody tr:hover {
  background-color: rgba(138, 180, 248, 0.08);
}

[data-theme="dark"] .my-table tbody tr.has-active-model {
  background-color: rgba(138, 180, 248, 0.16) !important;
}

[data-theme="dark"] .my-table tbody tr td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.my-table tbody tr.dimmed-row {
  opacity: 0.32;
}

/* Блок цены */
.price-badge-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.price-range-badge {
  font-weight: 800;
  font-size: 15.5px;
  color: var(--my-text-headline);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.segment-indicator {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--corner-pill);
  width: fit-content;
}

.segment-indicator.ultrabudget {
  background: var(--tonal-teal-bg);
  color: var(--tonal-teal-text);
}

.segment-indicator.budget {
  background: var(--tonal-green-bg);
  color: var(--tonal-green-text);
}

.segment-indicator.midrange {
  background: var(--tonal-blue-bg);
  color: var(--tonal-blue-text);
}

.segment-indicator.subflagship {
  background: var(--tonal-purple-bg);
  color: var(--tonal-purple-text);
}

.segment-indicator.flagship {
  background: var(--tonal-amber-bg);
  color: var(--tonal-amber-text);
}

/* Список смартфонов */
.phones-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Чип смартфона */
.phone-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--my-surface-container);
  border: 1px solid transparent;
  padding: 6px 14px;
  border-radius: var(--corner-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--my-text-headline);
  cursor: pointer;
  user-select: none;
  transition: all var(--anim-standard);
}

.phone-pill:hover {
  background: #e2ecfc;
  color: var(--my-primary);
  transform: translateY(-1px);
}

/* Активное состояние выбранной модели */
.phone-pill.is-active-target {
  background: var(--my-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(11, 87, 208, 0.4) !important;
}

[data-theme="dark"] .phone-pill.is-active-target {
  color: #041e49 !important;
  box-shadow: 0 3px 12px rgba(138, 180, 248, 0.4) !important;
}

.phone-pill.is-active-target .brand-circle {
  background-color: #ffffff !important;
}

[data-theme="dark"] .phone-pill.is-active-target .brand-circle {
  background-color: #041e49 !important;
}

.phone-pill.is-active-target .exclusive-tag {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

[data-theme="dark"] .phone-pill.is-active-target .exclusive-tag {
  background: rgba(4, 30, 73, 0.35);
  color: #041e49;
}

/* Цветная точка бренда */
.brand-circle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Бейдж серого импорта */
.exclusive-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--corner-pill);
  background: #e1e3e1;
  color: #444746;
}

[data-theme="dark"] .exclusive-tag {
  background: rgba(255, 255, 255, 0.12);
  color: #c4c7c5;
}

/* Цвета брендов */
.brand-motorola { --brand-color: #00838f; }
.brand-samsung  { --brand-color: #1a73e8; }
.brand-xiaomi   { --brand-color: #e65100; }
.brand-redmi    { --brand-color: #f57c00; }
.brand-poco     { --brand-color: #f9a825; }
.brand-oneplus  { --brand-color: #d93025; }
.brand-pixel    { --brand-color: #188038; }
.brand-realme   { --brand-color: #f29900; }
.brand-vivo     { --brand-color: #6200ea; }
.brand-nubia    { --brand-color: #c2185b; }
.brand-honor    { --brand-color: #0277bd; }
.brand-infinix  { --brand-color: #00897b; }
.brand-other    { --brand-color: #747775; }

.phone-pill .brand-circle {
  background-color: var(--brand-color, #747775);
}

/* ==========================================================================
   СЕТКА КАРТОЧЕК
   ========================================================================== */

.my-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  margin-bottom: 40px;
}

.category-card {
  background: var(--my-surface);
  border: 1px solid var(--my-border);
  border-radius: var(--corner-card);
  padding: 22px;
  box-shadow: var(--shadow-float);
  transition: all var(--anim-standard);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

[data-theme="dark"] .category-card:hover {
  background: #20252e;
  border-color: var(--my-border-hover);
}

.category-card.has-active-model {
  background: #f0f6ff;
  border-color: var(--my-primary);
}

[data-theme="dark"] .category-card.has-active-model {
  background: #192336;
  border-color: var(--my-primary);
}

.category-card.dimmed-card {
  opacity: 0.3;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--my-border);
}

.card-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--my-text-headline);
}

.card-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--my-text-body);
}

/* ==========================================================================
   ПУСТОЕ СОСТОЯНИЕ
   ========================================================================== */

.my-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--my-surface);
  border: 1px dashed var(--my-border);
  border-radius: var(--corner-card);
  margin-bottom: 40px;
}

.empty-bubble {
  font-size: 40px;
  margin-bottom: 16px;
}

.empty-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-text {
  font-size: 14px;
  color: var(--my-text-body);
  margin-bottom: 20px;
}

.my-primary-btn {
  background: var(--my-primary);
  color: #ffffff;
  border: none;
  padding: 11px 26px;
  border-radius: var(--corner-pill);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(11, 87, 208, 0.25);
  transition: all var(--anim-standard);
}

.my-primary-btn:hover {
  background: var(--my-primary-hover);
  transform: translateY(-1px);
}

[data-theme="dark"] .my-primary-btn {
  color: #041e49;
  box-shadow: 0 4px 14px rgba(138, 180, 248, 0.3);
}

/* Кнопка FAB */
.my-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 50px;
  height: 50px;
  border-radius: var(--corner-sm);
  background: var(--my-primary-container);
  border: none;
  color: var(--my-on-primary-container);
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--anim-standard);
}

.my-fab.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.my-fab:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: #bfdbfe;
}

[data-theme="dark"] .my-fab {
  border: 1px solid var(--my-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .my-fab:hover {
  background: #005a91;
}

/* ==========================================================================
   АДАПТИВНОСТЬ (SMARTPHONES & MOBILE OPTIMIZATIONS)
   Строго изолировано внутри @media, десктоп (>900px) остается 100% нетронутым.
   ========================================================================== */

/* Планшеты и компактные экраны (<= 900px) */
@media (max-width: 900px) {
  html, body {
    overflow-x: clip;
  }

  .my-nav-container {
    padding: 0 16px;
  }

  .my-content-wrapper {
    padding: 24px 16px 50px;
  }

  .my-controls-header {
    flex-direction: column;
    align-items: stretch;
  }

  .my-controls-header .my-segmented-pill {
    width: 100%;
    justify-content: space-between;
  }

  .my-controls-header .my-segment-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 13px;
  }

  .col-price {
    min-width: 140px;
  }

  .my-table thead th, .my-table tbody tr td {
    padding: 12px 16px;
  }

  .my-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
  }
}

/* Стандартные смартфоны и фаблеты (<= 640px) */
@media (max-width: 640px) {
  /* Шапка сайта */
  .my-navbar {
    height: 58px;
    background: rgba(255, 255, 255, 0.96);
  }

  [data-theme="dark"] .my-navbar {
    background: rgba(25, 29, 36, 0.96);
  }

  .my-theme-toggle {
    width: 36px;
    height: 36px;
  }

  .my-nav-container {
    padding: 0 14px;
    gap: 10px;
  }

  .my-brand {
    gap: 8px;
  }

  .my-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 7px;
  }

  .my-brand-title {
    font-size: 15px;
  }

  /* Полное отключение режима таблиц на смартфонах:
     Скрываем переключатель в шапке и саму таблицу */
  #viewModeControl {
    display: none !important;
  }

  .my-table-card {
    display: none !important;
  }

  /* Hero-секция */
  .my-hero {
    margin-bottom: 18px;
  }

  .my-headline {
    font-size: 1.7rem;
    line-height: 1.2;
    margin-bottom: 8px;
  }

  .my-subhead {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  /* Карточка управления и фильтры */
  .my-controls-card {
    padding: 14px;
    border-radius: 20px;
    gap: 14px;
    margin-bottom: 20px;
    overflow: visible;
  }

  #storeModeControl {
    display: flex;
    width: 100%;
    padding: 3px;
    align-items: stretch;
  }

  #storeModeControl .my-segment-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 4px;
    font-size: 12px;
    white-space: normal;
    line-height: 1.2;
    min-width: 0;
  }

  /* Адаптивные метки текста */
  .text-desktop {
    display: none !important;
  }

  .text-mobile {
    display: inline !important;
  }

  /* Бюджет: фильтры не прокручиваются, а видны друг под другом рядами */
  .my-filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-top: 0;
  }

  .my-filter-label {
    font-size: 11.5px;
    font-weight: 700;
    min-width: auto;
    color: var(--my-text-subtle);
  }

  .my-chips-wrap {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 7px;
  }

  .md3-chip {
    flex: initial;
    white-space: nowrap;
    font-size: 12px;
    padding: 6px 12px;
  }

  /* Исправление таблицы на мобильном устройстве:
     100% ширина, fixed layout, без горизонтального скролла, со sticky-шапкой */
  .my-table-card {
    width: 100%;
    overflow: visible;
    border-radius: 18px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-float);
  }

  .my-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 12px;
    border-collapse: separate;
    border-spacing: 0;
  }

  .my-table thead th {
    position: sticky;
    top: 58px; /* Ровно высота мобильного навбара */
    z-index: 10;
    background: #ffffff;
    padding: 10px 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: normal;
    line-height: 1.2;
    border-bottom: 2px solid var(--my-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  }

  .my-table thead th .th-tonal-badge {
    display: none;
  }

  .my-table tbody tr td {
    padding: 10px 5px;
    vertical-align: top;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  /* Пропорции колонок на смартфонах */
  .my-table-card[data-mode="both"] .col-price {
    width: 29%;
    min-width: 0;
  }

  .my-table-card[data-mode="both"] .col-official {
    width: 35.5%;
    min-width: 0;
  }

  .my-table-card[data-mode="both"] .col-all {
    width: 35.5%;
    min-width: 0;
  }

  .my-table-card[data-mode="official"] .col-price {
    width: 30%;
    min-width: 0;
  }

  .my-table-card[data-mode="official"] .col-official {
    width: 70%;
    min-width: 0;
  }

  .my-table-card[data-mode="all"] .col-price {
    width: 30%;
    min-width: 0;
  }

  .my-table-card[data-mode="all"] .col-all {
    width: 70%;
    min-width: 0;
  }

  /* Компактный блок цены и индикатора */
  .price-badge-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .price-range-badge {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    word-break: normal;
  }

  .segment-indicator {
    font-size: 8px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1.15;
    letter-spacing: 0.01em;
    white-space: normal;
    text-align: center;
    max-width: 100%;
    width: fit-content;
  }

  /* Список моделей в ячейке вертикальной стопкой */
  .phones-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
    width: 100%;
  }

  .phone-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1.2;
    width: 100%;
    box-sizing: border-box;
    background: var(--my-surface-container);
  }

  .phone-pill .brand-circle {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
  }

  .phone-pill .phone-name {
    flex: 1;
    min-width: 0;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .exclusive-tag {
    font-size: 8.5px;
    padding: 1px 4px;
    border-radius: 3px;
    flex-shrink: 0;
    margin-left: auto;
  }

  /* Карточки на смартфонах */
  .my-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 30px;
  }

  .category-card {
    padding: 16px;
    border-radius: 18px;
    gap: 14px;
  }

  .card-header {
    padding-bottom: 10px;
  }

  .card-price {
    font-size: 15.5px;
  }

  .card-section {
    gap: 7px;
  }

  .card-section-title {
    font-size: 11px;
  }

  .category-card .phones-list {
    gap: 6px;
  }

  .category-card .phone-pill {
    font-size: 12.5px;
    padding: 5px 12px;
  }

  /* Пустое состояние и FAB */
  .my-empty-state {
    padding: 40px 16px;
    border-radius: 18px;
  }

  .my-fab {
    width: 44px;
    height: 44px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    border-radius: 12px;
  }
}

/* Компактные смартфоны (<= 400px: iPhone SE, Galaxy Mini и др.) */
@media (max-width: 400px) {
  .my-nav-container {
    padding: 0 10px;
    gap: 6px;
  }

  .my-brand-title {
    font-size: 13.5px;
  }

  .my-brand-icon {
    width: 28px;
    height: 28px;
  }

  .my-content-wrapper {
    padding: 16px 10px 50px;
  }

  .my-headline {
    font-size: 1.45rem;
  }

  .my-controls-card {
    padding: 12px;
    border-radius: 16px;
  }

  #storeModeControl .my-segment-btn {
    padding: 6px 2px;
    font-size: 11px;
  }

  .md3-chip {
    font-size: 11.5px;
    padding: 5px 10px;
  }

  .phone-pill {
    font-size: 10px;
    padding: 3px 6px;
    gap: 4px;
  }

  .category-card {
    padding: 14px;
  }
}
