/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ЕСТЕСТВЕННЫЙ СКРОЛЛ на всех устройствах - ИСПРАВЛЕНО */
html {
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #f2f5f7;
    color: #1a1a1a;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    touch-action: pan-y pan-x;
}

/* Контейнер приложения - ИСПРАВЛЕНО для естественного скролла */
.app-container {
    min-height: 100vh;
    position: relative;
    width: 100%;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
    overflow: visible;
}

/* Страницы - ИСПРАВЛЕНО */
.page {
    display: none;
    position: relative;
    width: 100%;
    min-height: 100vh;
}

.page.active {
    display: block;
    min-height: 100vh;
}

.content-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Заголовки */
/* Шапка в стиле Aviasales - яркий голубой с сильным скруглением */
.page-header {
    background: linear-gradient(135deg, #0c73fe 0%, #3d94fe 100%);
    padding: 48px 0 44px 0; /* ИЗМЕНЕНО: увеличен верхний padding */
    margin: -24px -24px 24px -24px;
    border-radius: 32px 32px 40px 40px;
    box-shadow: 0 4px 24px rgba(12, 115, 254, 0.3);
    position: relative;
    z-index: 1;
}

.page-header .content-wrapper {
    padding: 0 24px;
}

.page-header .page-title {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
}

/* БЕЛЫЙ ПРЯМОУГОЛЬНИК - главный контейнер поиска */
.search-box-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 10;
    /* ГАРАНТИЯ ВИДИМОСТИ на всех устройствах */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Панель поиска - внутри белого контейнера */
.search-panel {
    position: relative;
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

/* Wrapper для input с лупой - серый фон */
.search-input-wrapper {
    position: relative;
    background: #e8eef5;
    border-radius: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    transition: all 0.3s ease;
}

/* Иконка лупы внутри серого контейнера */
.search-icon {
    position: relative;
    color: #6b7c8e;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    transition: color 0.3s ease;
    margin-right: 12px;
}

/* Input БЕЗ рамки, прозрачный фон */
.search-input {
    flex: 1;
    padding: 16px 0;
    padding-right: 42px; /* Увеличенный отступ для кнопки очистки */
    font-size: 16px;
    border: none;
    background: transparent;
    transition: all 0.3s ease;
    color: #000000;
    caret-color: #000000;
    outline: none;
    /* Предотвращаем зум на iOS */
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

/* Кнопка очистки поля поиска - серый кружок с прозрачностью */
.clear-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: none; /* Скрыта по умолчанию */
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.15); /* Прозрачный фон */
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.5);
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    transition: all 0.2s ease;
    /* iOS улучшения */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.clear-btn:hover {
    background: rgba(0, 0, 0, 0.25);
    color: rgba(0, 0, 0, 0.7);
}

.clear-btn:active {
    transform: translateY(-50%) scale(0.9);
    background: rgba(0, 0, 0, 0.3);
}

/* === ИСТОРИЯ ПОИСКА === */
.search-history {
    padding: 12px 16px;
}

.search-history.hidden {
    display: none;
}

.search-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.search-history-title {
    font-size: 12px;
    font-weight: 600;
    color: #8b8b8b;
    letter-spacing: 0.5px;
}

.clear-history-link {
    background: none;
    border: none;
    color: #0066ff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.clear-history-link:hover {
    text-decoration: underline;
}

.search-history-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px 8px 12px;
    background: #f3f3f7;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.history-tag:hover {
    background: #e8e8ec;
}

.history-tag:active {
    background: #dddde2;
}

.history-tag-text {
    font-size: 14px;
    color: #1a1a1a;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-tag-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: none;
    border: none;
    color: #8b8b8b;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.history-tag-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #555;
}

/* Старые стили для совместимости */
.search-history-list {
    padding: 0;
}

.search-history-item {
    display: none;
}

.clear-history-btn {
    display: none;
}

/* === ПОДСКАЗКИ ПОИСКА === */
.search-suggestions {
    border-top: 1px solid #f0f0f0;
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
}

.search-suggestions.hidden {
    display: none;
}

.suggestions-header {
    display: none;
}

.suggestions-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Теги категорий */
.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px;
}

.suggestion-tag {
    display: inline-block;
    padding: 10px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 15px;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.15s ease;
}

.suggestion-tag:hover {
    background: #ebebeb;
}

.suggestion-tag:active {
    background: #e0e0e0;
    transform: scale(0.97);
}

/* Список подсказок */
.suggestions-list {
    border-top: 1px solid #f0f0f0;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-item:active {
    background: #f0f2f5;
}

.suggestion-item svg {
    display: none;
}

.suggestion-item-text {
    flex: 1;
    font-size: 16px;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-item-text b {
    font-weight: 600;
}

/* === ПОДСКАЗКИ ПОИСКА === */
.search-suggestions {
    padding: 12px 0;
}

.search-suggestions.hidden {
    display: none;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 12px 16px;
    border-bottom: 1px solid #f0f4f8;
    margin-bottom: 8px;
}

.suggestion-tags:empty {
    display: none;
}

.suggestion-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: #f5f7fa;
    border: 1px solid #e8eef3;
    border-radius: 20px;
    font-size: 14px;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.suggestion-tag:hover {
    background: #e8eef3;
    border-color: #d0d8e0;
}

.suggestion-tag:active {
    background: #dde5ed;
    transform: scale(0.97);
}

.suggestion-list {
    padding: 0;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: #f5f8fa;
}

.suggestion-item:active {
    background: #e8f0f5;
}

.suggestion-item svg {
    flex-shrink: 0;
    color: #99a5b0;
    width: 16px;
    height: 16px;
}

.suggestion-item span {
    flex: 1;
    font-size: 15px;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Более заметный placeholder */
.search-input::placeholder {
    color: rgba(26, 26, 26, 0.4);
    font-weight: 400;
}

/* При фокусе - выделение всего wrapper */
.search-input-wrapper:focus-within {
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(12, 115, 237, 0.3);
}

/* Иконка становится синей при фокусе */
.search-input-wrapper:focus-within .search-icon {
    color: #0c73ed;
}

/* Усиленный курсор для iOS */
@supports (-webkit-touch-callout: none) {
    .search-input {
        caret-color: #000000 !important;
        -webkit-text-fill-color: #000000;
    }
}

/* Кнопки - стиль Aviasales (чистый оранжевый, плоский) */
.btn-primary {
    width: 100%;
    padding: 18px;
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    background: #ff6d19;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    /* Улучшения для iOS */
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

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

.btn-primary:active {
    transform: scale(0.98);
    background: #ff5500;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Информационный блок-подсказка под кнопкой поиска */
.search-hint-card {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background: #f0f4f8;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
}

.search-hint-card .hint-icon {
    flex-shrink: 0;
    color: #6b7c8e;
    width: 14px;
    height: 14px;
}

.search-hint-card .hint-text {
    font-size: 11px;
    color: #6b7c8e;
    line-height: 1.4;
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    color: #0c73ed;
    background: #ffffff;
    border: 2px solid #e8eef3;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f8fafb;
    border-color: #0c73ed;
}

/* Загрузчик - мягкий дизайн */
/* === НОВЫЙ ЛОАДЕР С BOTTOM SHEET === */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 247, 250, 0.98);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.loader-overlay.hidden {
    display: none;
}

/* Скелетон карточки */
.skeleton-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 120px 16px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.skeleton-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(90deg, #f0f4f8 25%, #e8eef3 50%, #f0f4f8 75%);
    background-size: 200% 100%;
    border-radius: 12px;
    margin-bottom: 12px;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-text {
    height: 12px;
    background: linear-gradient(90deg, #f0f4f8 25%, #e8eef3 50%, #f0f4f8 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    margin-bottom: 8px;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-text.short {
    width: 50%;
    height: 16px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Bottom sheet */
.loader-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.12);
    padding: 12px 24px 60px;
    animation: sheet-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sheet-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.loader-sheet-handle {
    width: 36px;
    height: 4px;
    background: #e0e4e8;
    border-radius: 2px;
    margin: 0 auto 24px;
}

.loader-sheet-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.loader-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.loader-logo svg {
    width: 44px;
    height: 44px;
}

.loader-logo span {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.loader-funny-text {
    font-size: 16px;
    color: #6b7c8e;
    margin: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

.loader-funny-text.fade {
    animation: text-fade 0.3s ease-out;
}

@keyframes text-fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Секция маркетплейса */
.marketplace-section {
    margin-bottom: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8eef3;
}

.marketplace-section:last-child {
    border-bottom: none;
}

.marketplace-section.hidden {
    display: none;
}

.marketplace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 4px;
}

.marketplace-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.marketplace-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.marketplace-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Запасные стили если SVG не загрузится */
.wb-icon {
    background: #ffffff;
}

.ozon-icon {
    background: #ffffff;
}

.marketplace-title {
    font-size: 16px;
    font-weight: 400;
    color: #1a1a1a;
}

/* Минимальная цена справа */
.marketplace-min-price {
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #2563eb;
    font-size: 15px;
    font-weight: 500;
}

.marketplace-min-price:hover {
    color: #1d4ed8;
}

.marketplace-min-price svg {
    color: #2563eb;
}

.min-price-text {
    white-space: nowrap;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

/* Карточка товара */
.product-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: visible;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    background: #f8fafb;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.best-price-badge {
    position: absolute;
    top: 0;
    left: 12px;
    transform: translateY(-50%);
    padding: 4px 8px;
    background: linear-gradient(135deg, #00c853 0%, #00a843 100%);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 6px;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0, 200, 83, 0.4);
    z-index: 10;
}

.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-info-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-actions {
    display: none;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    margin-bottom: 4px;
}

.product-name {
    font-size: 12px;
    font-weight: 500;
    color: #3a4a5a;
    line-height: 1.4;
    margin-bottom: 8px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 34px;
}

.product-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Блок рейтинга и отзывов */
.product-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #828282;
    flex-wrap: nowrap;
    white-space: nowrap;
    min-height: 14px;
    line-height: 1;
    margin-top: 6px;
}

/* Иконки "нет данных" */
.no-data-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    opacity: 0.7;
}

/* Иконки рейтинга и отзывов */
.rating-icon,
.reviews-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.rating-icon {
    color: #ff9800;
}

.reviews-icon {
    color: #828282;
}

/* Когда нет ни рейтинга ни отзывов */
.product-rating.no-data {
    color: #a0a8b0;
}

.rating-icon-disabled {
    color: #a0a8b0;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.no-reviews-text {
    font-size: 11px;
    color: #a0a8b0;
}

/* Значение рейтинга */
.rating-value {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 11px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* Количество отзывов */
.reviews-value {
    color: #828282;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.load-more-container {
    padding: 0 4px;
}

.load-more-container.hidden {
    display: none;
}

/* Настройки - мягкий дизайн */
.settings-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
}

.settings-item {
    margin-bottom: 16px;
}

.settings-item:last-child {
    margin-bottom: 0;
}

.settings-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 8px;
}

.settings-description {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 16px;
}

.settings-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #e8eef3;
    border-radius: 20px;
    background: #f8fafb;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-select:focus {
    outline: none;
    border-color: #0c73ed;
    background: #ffffff;
}

/* Фильтры цен */
.price-filters {
    display: flex;
    gap: 10px;
    width: 100%;
}

.price-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 16px 16px;
    font-size: 15px;
    border: 1px solid #e0e6ed;
    border-radius: 20px;
    background: #f8fafb;
    transition: all 0.3s ease;
    color: #000000;
    caret-color: #000000;
    /* Предотвращаем зум на iOS */
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

.price-input:focus {
    outline: none;
    border-color: #0c73ed;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.1);
}

/* Усиленный курсор для iOS */
@supports (-webkit-touch-callout: none) {
    .price-input {
        caret-color: #000000 !important;
        -webkit-text-fill-color: #000000;
    }
}

.price-input:focus {
    outline: none;
    border-color: #0c73ed;
    background: #ffffff;
}

.price-input::placeholder {
    color: #99a5b0;
    font-size: 14px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
}

/* Интерактивная строка выбора города */
.city-selector-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: #f8fafb;
    border: 1px solid #e0e6ed;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    /* Улучшения для iOS */
    -webkit-tap-highlight-color: rgba(0, 148, 255, 0.1);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.city-selector-line:hover {
    background: #ffffff;
    border-color: #0c73ed;
    box-shadow: 0 2px 12px rgba(0, 86, 179, 0.1);
}

.city-selector-line:active {
    transform: scale(0.98);
}

.city-selector-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.city-icon-left {
    color: #0c73ed;
    flex-shrink: 0;
}

.city-selected-text {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
}

.city-arrow-icon {
    color: #99a5b0;
    flex-shrink: 0;
    transition: transform 0.2s;
}

/* Модальное окно выбора города */
.city-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000; /* Выше нижнего меню */
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

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

/* Блокировка скролла body когда модальное окно открыто */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

.city-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.city-modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 70vh;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.city-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e8eef3;
}

.city-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.city-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafb;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #5a6c7d;
}

.city-modal-close:hover {
    background: #e8eef3;
    transform: scale(1.05);
}

.city-modal-close:active {
    transform: scale(0.95);
}

.city-modal-close:active {
    transform: scale(0.95);
}

.city-modal-list {
    max-height: calc(70vh - 80px);
    overflow-y: auto;
    padding-bottom: 100px; /* Отступ для нижнего меню */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain; /* Блокируем скролл фона */
}

.city-list-item {
    padding: 16px 20px;
    font-size: 16px;
    color: #1a1a1a;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f8fafb;
}

.city-list-item:last-child {
    border-bottom: none;
}

.city-list-item:hover {
    background: #f8fafb;
}

.city-list-item:active {
    background: #e8eef3;
}

.city-list-item.selected {
    background: #f0f9ff;
    color: #0c73ed;
    font-weight: 600;
}

.city-list-item.selected::after {
    content: '✓';
    float: right;
    font-size: 18px;
}

/* Селектор маркетплейсов */
/* Компактный селектор маркетплейсов */
.market-selector {
    display: flex;
    gap: 6px;
    width: 100%;
}

.market-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 10px;
    background: #f8fafb;
    border: 2px solid #e0e6ed; /* Одинаковая толщина для всех */
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    min-height: 64px;
    /* Улучшения для iOS */
    -webkit-tap-highlight-color: rgba(0, 148, 255, 0.1);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.market-option:hover {
    background: #ffffff;
    border-color: #0c73ed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.1);
}

.market-option:active {
    transform: scale(0.97);
}

.market-option.active {
    background: #e8f4ff;
    border-color: #0c73ed;
    box-shadow: 0 4px 16px rgba(0, 86, 179, 0.15);
}

.market-option.active .market-name {
    color: #0c73ed;
    font-weight: 600;
}

/* Обертка для двух иконок в "Все" */
.market-icon-wrapper {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.market-icon-wrapper .market-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.market-icon-wrapper .market-icon-wb {
    width: 18px;
    height: 18px;
}

.market-icon-wrapper .market-icon-ozon {
    width: 15px;
    height: 15px;
}

/* Одиночная иконка (для WB и Ozon по отдельности) */
.market-icon-single {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.market-name {
    font-size: 12px;
    font-weight: 500;
    color: #1a1a1a;
    text-align: center;
    transition: all 0.2s;
    line-height: 1.2;
}

/* Кнопка поддержки */
.support-button-wrapper {
    display: flex;
    justify-content: center;
}

.support-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #0088cc 0%, #0077b3 100%);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    border-radius: 10px;
    transition: all 0.3s;
    box-shadow: 0 3px 12px rgba(0, 136, 204, 0.3);
    max-width: fit-content;
}

.support-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(0, 136, 204, 0.4);
}

.support-button:active {
    transform: translateY(0);
}

.app-version {
    text-align: center;
    font-size: 13px;
    color: #99a5b0;
    padding: 20px;
}

/* === СТРАНИЦА ИЗБРАННОГО === */
.favorites-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.favorites-empty svg {
    color: #d0d5dd;
    margin-bottom: 16px;
}

.favorites-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.favorites-empty-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* === КНОПКА ИЗБРАННОГО НА КАРТОЧКЕ === */
.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.favorite-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.favorite-btn:active {
    transform: scale(0.95);
}

.favorite-btn svg {
    width: 18px;
    height: 18px;
    color: #9ca3af;
    transition: all 0.2s ease;
}

.favorite-btn.active svg {
    color: #ef4444;
    fill: #ef4444;
}

.favorite-btn.active {
    background: #fff;
}

/* === КНОПКА ПОДЕЛИТЬСЯ НА КАРТОЧКЕ === */
.share-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.share-btn:active {
    transform: scale(0.95);
    background: #f0f0f0;
}

.share-btn svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

/* === КНОПКА ОТСЛЕЖИВАНИЯ ЦЕНЫ === */
.watch-btn {
    position: absolute;
    top: 8px;
    left: 44px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.watch-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.watch-btn:active {
    transform: scale(0.95);
}

.watch-btn svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
    transition: all 0.2s ease;
}

.watch-btn.active svg {
    color: #f59e0b;
    fill: #f59e0b;
}

.watch-btn.active {
    background: #fffbeb;
}

.watch-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.watch-btn.loading svg {
    animation: bell-ring 0.5s ease infinite;
}

@keyframes bell-ring {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
}

/* === TOAST УВЕДОМЛЕНИЕ === */
.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    text-align: center;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Нижняя навигация */
/* Нижняя навигация - ЖЕСТКАЯ ФИКСАЦИЯ для iPhone */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(232, 238, 243, 0.6);
    display: flex;
    justify-content: space-around;
    /* Современный padding с safe-area для iPhone */
    padding: 8px 0 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 9999 !important;
    /* Скругление верхних углов для эффекта парения */
    border-radius: 20px 20px 0 0;
    /* Более мягкая, распределенная тень */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    /* ЖЕСТКАЯ ФИКСАЦИЯ - убираем все transitions */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: auto;
    /* Улучшения для iOS */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Специально для iOS - МАКСИМАЛЬНАЯ фиксация */
@supports (-webkit-touch-callout: none) {
    .bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
}

/* Навигация ВСЕГДА видима - убрали скрытие */
.bottom-nav.nav-hidden {
    /* Ничего не делаем - навигация всегда видна */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: none;
    border: none;
    color: #99a5b0;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 0;
    /* Улучшения для iOS */
    -webkit-tap-highlight-color: rgba(0, 148, 255, 0.1);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Иконки навигации - компактнее */
.nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    flex-shrink: 0;
}

/* Текст кнопок навигации */
.nav-item span {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.nav-item.active {
    color: #0c73ed;
}

.nav-item:active {
    transform: scale(0.95);
}

/* Вспомогательные классы */
.hidden {
    display: none !important;
}

/* Адаптация */
@media (max-width: 360px) {
    .products-grid {
        gap: 8px;
    }

    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 12px;
        min-height: 33px;
    }

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

    .product-rating {
        font-size: 10px;
        margin-top: 5px;
    }

    .rating-value,
    .reviews-value {
        font-size: 10px;
    }

    .reviews-value {
        max-width: 90px;
    }

    .settings-card {
        padding: 14px;
    }

    .price-input {
        padding: 12px 10px;
        font-size: 14px;
    }

    .city-selector-line {
        padding: 12px 14px;
    }

    .city-list-item {
        padding: 14px 18px;
        font-size: 15px;
    }

    .market-selector {
        gap: 6px;
    }

    .market-option {
        padding: 14px 8px;
        min-height: 72px;
    }

    .market-icon {
        width: 20px;
        height: 20px;
    }

    .market-name {
        font-size: 12px;
    }
}

@media (min-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* МОБИЛЬНАЯ ВЕРСИЯ - гарантия видимости белого блока */
@media (max-width: 768px) {
    .page-header {
        padding: 44px 0 44px 0; /* ИЗМЕНЕНО: увеличен верхний padding */
        margin: -24px 0 24px 0;
        border-radius: 0 0 40px 40px;
    }

    .page-header .content-wrapper {
        padding: 0 16px;
    }

    .page-header .page-title {
        margin-bottom: 18px;
        font-size: 24px;
        white-space: nowrap;
    }

    .search-box-container {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative;
        z-index: 10;
    }

    .search-panel {
        display: block !important;
    }

    .search-input-wrapper {
        display: flex !important;
    }

    /* Более прозрачный placeholder на мобильных */
    .search-input::placeholder {
        color: rgba(26, 26, 26, 0.15);
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 40px 0 40px 0; /* ИЗМЕНЕНО: увеличен верхний padding */
        margin: -24px 0 24px 0;
        border-radius: 0 0 36px 36px;
    }

    .page-header .content-wrapper {
        padding: 0 12px;
    }

    .page-header .page-title {
        font-size: 20px;
        margin-bottom: 16px;
        white-space: nowrap;
    }

    .search-box-container {
        padding: 8px;
    }

    .search-input-wrapper {
        padding: 0 12px;
        margin-bottom: 6px;
    }

    .search-input {
        padding: 10px 0;
        padding-right: 42px; /* Отступ для кнопки очистки */
        font-size: 15px;
    }

    /* Супер-прозрачный placeholder на маленьких экранах */
    .search-input::placeholder {
        color: rgba(26, 26, 26, 0.12);
    }

    .btn-primary {
        padding: 12px;
        font-size: 15px;
    }
}

/* ОТКЛЮЧЕНИЕ ЗУМА - ИСПРАВЛЕНО */
* {
    -webkit-user-select: none;
    user-select: none;
}

input, textarea, button, select {
    touch-action: manipulation;
    -webkit-user-select: text;
    user-select: text;
}

/* ЕСТЕСТВЕННЫЙ СКРОЛЛ - УПРОЩЕНО */
.page {
    min-height: 100vh;
}

#search-page.active {
    min-height: 100vh;
}

/* Страница настроек - УПРОЩЕНО */
#settings-page {
    min-height: 100vh;
    padding-bottom: 100px;
    position: relative;
    width: 100%;
}

/* Страница результатов - УПРОЩЕНО */
#results-page {
    min-height: 100vh;
    padding-bottom: 100px;
    position: relative;
    width: 100%;
}

/* УСИЛЕННАЯ ФИКСАЦИЯ НАВИГАЦИИ */
@media (max-width: 768px) {
    .bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        transform: none !important;
        transition: none !important;
        -webkit-transform: none !important;
        -webkit-transition: none !important;
    }
}

/* ГАРАНТИЯ ВИДИМОСТИ при скролле (но разрешаем JS скрывать при клавиатуре) */
.bottom-nav {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Для iOS Safari - усиленная фиксация */
@supports (-webkit-touch-callout: none) {
    .bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
    }
}

/* Контейнер заголовка настроек */
.settings-header {
    margin-bottom: 20px;
}

/* МАКСИМАЛЬНАЯ ЗАЩИТА НАВИГАЦИИ от исчезновения */
body:not(.keyboard-open) .bottom-nav {
    display: flex !important;
}

/* Когда на странице настроек - навигация ВСЕГДА видна кроме клавиатуры */
#settings-page.active ~ * .bottom-nav {
    display: flex;
}

/* === FAQ СТРАНИЦА === */

.faq-intro {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.faq-intro-text {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.faq-intro-text strong {
    color: #0066ff;
}

/* Секция FAQ */
.faq-section {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.faq-section-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.2s;
}

.faq-section-toggle:hover {
    background: #f8f9fa;
}

.faq-section-toggle.active {
    border-bottom: 1px solid #f0f0f0;
}

.faq-toggle-icon {
    transition: transform 0.3s ease;
    color: #666;
}

.faq-section-toggle.active .faq-toggle-icon {
    transform: rotate(180deg);
}

/* Список вопросов */
.faq-questions {
    padding: 0;
}

.faq-questions.hidden {
    display: none;
}

/* Отдельный вопрос */
.faq-item {
    border-bottom: 1px solid #f0f0f0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}

.faq-question:hover {
    background: #f8f9fa;
}

.faq-question span {
    flex: 1;
    padding-right: 12px;
}

.faq-icon {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: #999;
}

.faq-question.active .faq-icon {
    transform: rotate(180deg);
}

/* Ответ */
.faq-answer {
    padding: 0 20px 16px 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.faq-answer.hidden {
    display: none;
}

.faq-answer p {
    margin-bottom: 8px;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
    margin: 8px 0;
    padding-left: 20px;
}

.faq-answer li {
    margin-bottom: 4px;
}

.faq-answer em {
    color: #0066ff;
    font-style: normal;
}

/* Кнопка "Ещё вопросы" */
.faq-more-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: #f8f9fa;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #0066ff;
    cursor: pointer;
    transition: background 0.2s;
}

.faq-more-btn:hover {
    background: #f0f4f8;
}

.faq-more-btn.hidden {
    display: none;
}

.faq-more-btn svg {
    transition: transform 0.3s ease;
}

.faq-more-btn.active svg {
    transform: rotate(180deg);
}

/* Дополнительные вопросы */
.faq-extra {
    border-top: 1px solid #f0f0f0;
}

.faq-extra.hidden {
    display: none;
}

/* Блок поддержки в FAQ */
.faq-support {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.faq-support-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.faq-support-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.faq-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0088cc 0%, #0066ff 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.faq-support-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

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

/* === СТРАНИЦА ОТСЛЕЖИВАНИЯ ЦЕН === */

.tracking-intro {
    background: #fff;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tracking-intro-text {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.tracking-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.tracking-empty svg {
    color: #d1d5db;
    margin-bottom: 16px;
}

.tracking-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.tracking-empty-text {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.5;
}

.tracking-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.tracking-loader.hidden {
    display: none;
}

.loader-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #0066ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

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

.tracking-loader p {
    font-size: 14px;
    color: #6b7280;
}

/* Карточка отслеживаемого товара */
.tracking-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    position: relative;
}

.tracking-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.tracking-card .product-image {
    position: relative;
    aspect-ratio: 1;
    background: #f8f9fa;
    overflow: hidden;
}

.tracking-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tracking-card .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.tracking-card .remove-btn:hover {
    background: #fee2e2;
}

.tracking-card .remove-btn svg {
    width: 14px;
    height: 14px;
    color: #ef4444;
}

.tracking-card .product-info {
    padding: 12px;
}

.tracking-card .product-price {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.tracking-card .price-change {
    font-size: 12px;
    margin-bottom: 6px;
}

.tracking-card .price-change.down {
    color: #10b981;
}

.tracking-card .price-change.up {
    color: #ef4444;
}

.tracking-card .price-change.same {
    color: #9ca3af;
}

.tracking-card .product-name {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tracking-card .marketplace-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
}

.tracking-card .marketplace-badge.wb {
    background: #a73afd;
}

.tracking-card .marketplace-badge.ozon {
    background: #005bff;
}

.tracking-card .marketplace-badge.ali {
    background: #e62e04;
    color: #fff;
}

.tracking-card .marketplace-badge.mm {
    background: #e30613;
    color: #fff;
}

/* Иконка AliExpress в заголовке */
.ali-icon {
    background: transparent;
    overflow: hidden;
}

.ali-icon img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

/* ===== TOGGLE SWITCHES ДЛЯ МАРКЕТПЛЕЙСОВ ===== */
.marketplace-toggles {
    background: #f0f4ff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.marketplace-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 8px;
}

.toggle-header-text {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.marketplace-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.marketplace-toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.marketplace-toggle-item:last-child {
    border-bottom: none;
}

.marketplace-toggle-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.marketplace-toggle-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.marketplace-toggle-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.marketplace-toggle-icon.wb-bg {
    background: linear-gradient(135deg, #cb11ab 0%, #a73afd 100%);
}

.marketplace-toggle-icon.ozon-bg {
    background: linear-gradient(135deg, #005bff 0%, #0041b8 100%);
}

.marketplace-toggle-icon.ali-bg {
    background: transparent;
}

.marketplace-toggle-icon.ali-bg img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.marketplace-toggle-icon.mm-bg {
    background: #e30613;
}

.marketplace-toggle-icon.mm-bg img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

/* Иконка Магнит Маркет в заголовке */
.mm-icon {
    background: transparent;
    overflow: hidden;
}

.mm-icon img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

/* === МАРКЕТПЛЕЙС ЛОАДЕР === */
/* === SKELETON LOADER === */

/* Спиннер в заголовке */
.header-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: #999;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-left: 8px;
}

/* Skeleton карточка = product-card */
.skeleton-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 3/4;
    background: #e8edf2;
}

.skeleton-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.skeleton-price {
    height: 18px;
    width: 50%;
    background: #e8edf2;
    border-radius: 6px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 12px;
    width: 100%;
    background: #e8edf2;
    border-radius: 4px;
    margin-bottom: 6px;
}

.skeleton-title-2 {
    height: 12px;
    width: 70%;
    background: #e8edf2;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-rating {
    height: 11px;
    width: 60%;
    background: #e8edf2;
    border-radius: 4px;
    margin-top: auto;
}

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

/* === КНОПКА ПОВТОРИТЬ === */
.retry-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
}

.retry-text {
    color: #999;
    font-size: 14px;
    margin: 0;
}

.retry-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #6C5CE7;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.retry-btn:hover {
    background: #5a4bd1;
}

.retry-btn:active {
    transform: scale(0.98);
}

.retry-btn svg {
    width: 16px;
    height: 16px;
}

.marketplace-toggle-name {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a2e;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e0e0e0;
    transition: 0.3s;
    border-radius: 31px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3b82f6;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Disabled state */
.marketplace-toggle-item.disabled {
    opacity: 0.5;
}

.marketplace-toggle-item.disabled .marketplace-toggle-name {
    color: #999;
}