* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #007AFF;
    --bg: #FFFFFF;
    --secondary-bg: #F9F9F9;
    --card-bg: #FFFFFF;
    --text: #1D1D1F;
    --text-secondary: #86868B;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: rgba(0, 0, 0, 0.03);
    --shadow-hover: rgba(0, 0, 0, 0.1);
    --accent-gradient: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    background: #FFFFFF !important;
    color: #1D1D1F !important;
    padding-bottom: 90px;
    padding-top: 64px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

/* Верхняя панель */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 0.5px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 100;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--primary);
}

.icon-btn:active {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(0.95);
}

.search-input {
    flex: 1;
    height: 36px;
    border: none;
    background: rgba(142, 142, 147, 0.12);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.4px;
    transition: all 0.2s ease;
}

.search-input::placeholder {
    color: rgba(60, 60, 67, 0.6);
}

.search-input:focus {
    outline: none;
    background: rgba(142, 142, 147, 0.18);
    caret-color: #000000;
}

/* Фильтры */
.filters {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 16px;
}

.filter-item {
    margin-bottom: 12px;
}

.filter-item label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.filter-item select,
.filter-item input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    background: var(--secondary-bg);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 16px;
    font-weight: 500;
}

.filter-item input:focus {
    outline: none;
    border-color: var(--primary);
    caret-color: #000000;
}

/* Основной контент */
.main-content {
    padding: 16px;
    min-height: calc(100vh - 154px);
}

.view {
    display: block;
}

.view.hidden {
    display: none;
}

/* Сетка товаров */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.listing-card {
    background: var(--card-bg);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.listing-card:active {
    transform: scale(0.97);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 122, 255, 0.2);
}

.listing-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: linear-gradient(135deg, #F5F5F7 0%, #E8E8ED 100%);
}

.listing-info {
    padding: 12px 14px 14px;
}

.listing-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.listing-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.listing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.listing-price {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
}

.listing-likes {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Детали товара */
#detailContent {
    max-width: 600px;
    margin: 0 auto;
}

.detail-photos {
    position: relative;
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
    margin-top: -16px;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #F5F5F7 0%, #E8E8ED 100%);
    overflow: hidden;
    margin-bottom: 20px;
}

.detail-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.detail-photo.active {
    display: block;
}

.photo-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.photo-indicator {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-indicator.active {
    width: 24px;
    background: rgba(255, 255, 255, 0.95);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.detail-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.6px;
    line-height: 1.2;
    flex: 1;
}

.detail-price {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text);
    margin-bottom: 12px;
}

.detail-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    align-items: center;
}

.detail-stats svg {
    vertical-align: middle;
    margin-right: 4px;
}

.detail-description {
    font-size: 17px;
    line-height: 1.47;
    letter-spacing: -0.4px;
    margin-bottom: 24px;
    color: var(--text);
}

.detail-seller {
    background: var(--secondary-bg);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 100px;
    border: 1px solid var(--border);
}

.detail-seller h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.detail-seller p {
    font-size: 17px;
    color: var(--text);
    font-weight: 500;
    letter-spacing: -0.4px;
}

.detail-actions {
    position: fixed;
    bottom: 90px;
    left: 16px;
    right: 16px;
    display: flex;
    gap: 12px;
}

.favorite-btn {
    width: 56px;
    height: 56px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text);
}

.favorite-btn:active {
    transform: scale(0.92);
}

.favorite-btn.active {
    background: #FF3B30;
    color: white;
    border-color: #FF3B30;
}

.favorite-btn.active svg {
    fill: white;
    stroke: white;
}

/* Кнопки */
.btn-primary {
    width: 100%;
    height: 56px;
    border: none;
    background: var(--accent-gradient);
    color: white;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 8px;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.2);
}

.btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.15);
}

.btn-secondary {
    width: 100%;
    height: 50px;
    border: 1px solid var(--border);
    background: var(--secondary-bg);
    color: var(--primary);
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:active {
    transform: scale(0.98);
    background: rgba(0, 122, 255, 0.05);
    border-color: var(--primary);
}

/* Форма создания */
.create-form {
    max-width: 600px;
    margin: 0 auto;
}

.create-form h2 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 24px;
}

.create-form input,
.create-form textarea,
.create-form select {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--secondary-bg);
    border-radius: 12px;
    padding: 16px;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.4px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.create-form select {
    height: 44px;
    padding: 0 12px;
}

.create-form textarea {
    min-height: 140px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.47;
}

.create-form input:focus,
.create-form textarea:focus,
.create-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    caret-color: #000000;
}

/* Фикс для iOS клавиатуры */
.create-form input,
.create-form textarea {
    -webkit-user-select: text;
    user-select: text;
}

.create-form textarea {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.photo-preview {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-bottom: 12px;
    padding: 4px 0;
}

.photo-preview-item {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
}

.photo-remove:active {
    transform: scale(0.9);
}

/* Профиль */
.profile-header {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.profile-info h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-info p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* Уведомления */
#notificationsList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
}

.notification-item.unread {
    background: #EBF5FF;
    border-color: rgba(0, 122, 255, 0.2);
}

.notification-item p {
    font-size: 15px;
    line-height: 1.4;
}

.notification-time {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Скоро */
.coming-soon {
    text-align: center;
    padding: 60px 20px;
}

.coming-soon svg {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.coming-soon h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.coming-soon p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Админ панель */
.admin-header {
    padding: 20px 0 16px;
}

.admin-header h2 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text);
    margin: 0;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -1px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    padding: 12px 20px;
    border: 1px solid var(--border);
    background: var(--secondary-bg);
    color: var(--text);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    letter-spacing: -0.2px;
}

.tab-btn:active {
    transform: scale(0.98);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-item {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border);
}

.admin-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.admin-item-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.4px;
    line-height: 1.3;
    flex: 1;
    padding-right: 12px;
}

.admin-item-info {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.admin-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.admin-btn {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.2px;
}

.admin-btn:active {
    transform: scale(0.98);
}

.admin-btn-danger {
    background: #FF3B30;
    color: white;
}

.admin-btn-success {
    background: #34C759;
    color: white;
}

.admin-btn-primary {
    background: var(--primary);
    color: white;
}

.broadcast-form {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border);
}

.broadcast-form textarea {
    width: 100%;
    min-height: 140px;
    border: 1px solid var(--border);
    background: var(--secondary-bg);
    border-radius: 12px;
    padding: 16px;
    font-size: 17px;
    font-weight: 400;
    margin-bottom: 12px;
    font-family: inherit;
    resize: vertical;
    letter-spacing: -0.4px;
    line-height: 1.47;
}

.broadcast-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    caret-color: #000000;
}

/* Нижняя панель */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 83px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 0.5px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 20px 20px;
    z-index: 100;
}

.nav-btn {
    position: relative;
    width: 50px;
    height: 50px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
}

.nav-btn:active {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(0.95);
}

.nav-btn.active {
    color: var(--primary);
}

.nav-btn-create {
    width: 60px;
    height: 60px;
    border: none;
    background: var(--accent-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn-create:active {
    transform: scale(0.92);
    box-shadow: 0 3px 12px rgba(0, 122, 255, 0.25);
}

.badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 20px;
    height: 20px;
    background: #FF3B30;
    color: white;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4);
}

/* Утилиты */
.hidden {
    display: none !important;
}

.inactive {
    opacity: 0.5;
}

/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--secondary-bg);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s ease;
}

.modal-close:active {
    transform: scale(0.9);
    background: var(--border);
}

/* Светлая тема всегда активна */
html, body {
    background-color: #FFFFFF !important;
    color: #1D1D1F !important;
}
