/* ========== ОБНУЛЕНИЕ ========== */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
background: #f2f2f7;
padding: 16px;
min-height: 100vh;
}

.container {
max-width: 600px;
margin: 0 auto;
}

/* ========== ШАПКА ========== */
.header {
background: #ffffff;
padding: 14px 18px;
border-radius: 14px;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
margin-bottom: 16px;
}

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

.logo {
font-size: 20px;
font-weight: 700;
color: #1c1c1e;
}

.premium-badge {
font-size: 11px;
padding: 2px 10px;
border-radius: 12px;
background: #e9ecef;
color: #8e8e93;
transition: all 0.3s;
}

.premium-badge.active {
background: #ffd700;
color: #1c1c1e;
font-weight: 600;
}

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

.user-name {
font-size: 14px;
color: #8e8e93;
}

/* ========== КНОПКИ ========== */
.btn {
border: none;
border-radius: 20px;
padding: 8px 18px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}

.btn-auth {
background: #007aff;
color: white;
}

.btn-auth:hover {
background: #0055b3;
}

.btn-primary {
background: #007aff;
color: white;
padding: 12px;
border-radius: 12px;
font-size: 16px;
font-weight: 600;
width: 100%;
}

.btn-primary:hover {
background: #0055b3;
}

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

.btn-danger {
background: #ff3b30;
color: white;
border: none;
padding: 6px 14px;
border-radius: 8px;
font-size: 13px;
cursor: pointer;
margin-top: 8px;
}

.btn-danger:hover {
background: #d63031;
}

.btn-close {
background: #e9ecef;
color: #1c1c1e;
border: none;
width: 28px;
height: 28px;
border-radius: 50%;
font-size: 16px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}

.btn-close:hover {
background: #dee2e6;
}

/* ========== КАРТОЧКИ ========== */
.card {
background: #ffffff;
padding: 18px;
border-radius: 14px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
margin-bottom: 16px;
}

.card-title {
font-size: 18px;
font-weight: 600;
color: #1c1c1e;
margin-bottom: 16px;
}

/* ========== ПРИВЕТСТВИЕ ========== */
.welcome-card {
text-align: center;
background: linear-gradient(135deg, #007aff 0%, #0055b3 100%);
color: white;
padding: 24px 20px;
}

.welcome-card h1 {
font-size: 24px;
margin-bottom: 12px;
}

.welcome-text {
font-size: 15px;
line-height: 1.5;
opacity: 0.9;
margin-bottom: 16px;
}

.features-grid {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 8px;
}

.feature-tag {
background: rgba(255, 255, 255, 0.2);
padding: 4px 14px;
border-radius: 20px;
font-size: 13px;
}

/* ========== МЕНЮ ========== */
.menu-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 12px;
margin-bottom: 16px;
}

.menu-btn {
background: #ffffff;
border: none;
border-radius: 14px;
padding: 18px 12px;
text-align: center;
cursor: pointer;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
transition: all 0.2s;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
position: relative;
}

.menu-btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.menu-btn:active {
transform: scale(0.96);
}

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

.menu-btn.disabled:hover {
transform: none;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.menu-icon {
font-size: 28px;
}

.menu-label {
font-size: 13px;
font-weight: 500;
color: #1c1c1e;
}

.premium-btn {
background: linear-gradient(135deg, #ffd700 0%, #f5a623 100%);
}

.premium-btn .menu-label {
color: #1c1c1e;
}

/* ========== СЕКЦИИ ========== */
.section {
animation: fadeIn 0.3s ease;
}

.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
}

@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}

/* ========== ИНПУТЫ ========== */
.input {
width: 100%;
padding: 12px 14px;
border: 1.5px solid #e5e5ea;
border-radius: 12px;
font-size: 15px;
font-family: inherit;
background: #fafafa;
transition: border-color 0.2s;
margin-bottom: 12px;
}

.input:focus {
outline: none;
border-color: #007aff;
background: white;
}

.input::placeholder {
color: #aeaeb2;
}

.textarea {
resize: vertical;
min-height: 80px;
line-height: 1.4;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type="number"] {
-moz-appearance: textfield;
}

/* ========== ЗАГРУЗКА ИЗОБРАЖЕНИЙ ========== */
.upload-area {
background: #f8f9fa;
border: 2px dashed #dee2e6;
border-radius: 12px;
padding: 16px;
text-align: center;
margin-bottom: 16px;
transition: all 0.3s;
position: relative;
}

.upload-area.has-image {
border-color: #34c759;
background: #f0faf0;
}

.btn-upload {
background: #e9ecef;
color: #1c1c1e;
padding: 10px 20px;
border-radius: 12px;
font-size: 14px;
border: none;
cursor: pointer;
}

.btn-upload:hover {
background: #dee2e6;
}

.preview-container {
position: relative;
display: inline-block;
margin-top: 12px;
}

.preview-img {
max-width: 100%;
max-height: 200px;
border-radius: 10px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-remove {
background: #ff3b30;
color: white;
border: none;
padding: 4px 10px;
border-radius: 50%;
font-size: 16px;
position: absolute;
top: -8px;
right: -8px;
width: 28px;
height: 28px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}

.btn-remove:hover {
background: #d63031;
}

.file-name {
margin-top: 6px;
font-size: 12px;
color: #8e8e93;
}

/* ========== КАРТОЧКИ ОБЪЯВЛЕНИЙ ========== */
.ad-card {
background: #ffffff;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
margin-bottom: 12px;
transition: transform 0.2s;
}

.ad-card:hover {
transform: translateY(-2px);
}

.ad-card.premium-card {
border: 2px solid #ffd700;
}

.ad-image {
width: 100%;
height: 180px;
object-fit: cover;
background: #f2f2f7;
}

.ad-info {
padding: 12px 14px;
}

.ad-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 6px;
}

.ad-category {
font-size: 12px;
color: #8e8e93;
background: #f2f2f7;
padding: 2px 10px;
border-radius: 12px;
}

.premium-tag {
font-size: 10px;
font-weight: 700;
color: #1c1c1e;
background: #ffd700;
padding: 2px 8px;
border-radius: 4px;
}

.ad-info h3 {
font-size: 16px;
font-weight: 600;
color: #1c1c1e;
margin-bottom: 4px;
}

.ad-price {
font-size: 18px;
font-weight: 700;
color: #007aff;
margin: 4px 0;
}

.ad-description {
font-size: 14px;
color: #8e8e93;
margin: 6px 0;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

.ad-author {
font-size: 13px;
color: #8e8e93;
margin: 4px 0;
}

.ad-info small {
font-size: 12px;
color: #aeaeb2;
}

/* ========== ПОИСК ========== */
.search-filters {
margin-bottom: 16px;
}

/* ========== ПРЕМИУМ ========== */
.premium-features {
display: grid;
gap: 10px;
margin-bottom: 20px;
}

.premium-feature {
background: #f8f9fa;
padding: 12px 16px;
border-radius: 10px;
font-size: 14px;
color: #1c1c1e;
}

.premium-price {
text-align: center;
font-size: 20px;
font-weight: 700;
color: #007aff;
margin-top: 12px;
}

/* ========== ПРОФИЛЬ ========== */
.profile-info {
display: grid;
gap: 8px;
}

.profile-info p {
font-size: 15px;
color: #1c1c1e;
padding: 8px 0;
border-bottom: 1px solid #f2f2f7;
}

.profile-info p:last-child {
border-bottom: none;
}

/* ========== ПУСТОЕ СОСТОЯНИЕ ========== */
.empty-message {
text-align: center;
color: #aeaeb2;
padding: 20px 0;
font-size: 14px;
}

/* ========== АДАПТИВ ========== */
@media (max-width: 480px) {
body {
    padding: 10px;
}

.header {
    padding: 12px 14px;
    flex-wrap: wrap;
}

.logo {
    font-size: 18px;
}

.menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.menu-btn {
    padding: 14px 10px;
}

.menu-icon {
    font-size: 24px;
}

.menu-label {
    font-size: 12px;
}

.ad-image {
    height: 140px;
}

.welcome-card h1 {
    font-size: 20px;
}
}

/* ========== ТЁМНАЯ ТЕМА ========== */
@media (prefers-color-scheme: dark) {
body {
    background: #0a0a0a;
}

.header, .card, .menu-btn {
    background: #1c1c1e;
}

.logo, .card-title, .menu-label, .profile-info p {
    color: #ffffff;
}

.user-name {
    color: #8e8e93;
}

.input {
    background: #2c2c2e;
    border-color: #3a3a3c;
    color: #ffffff;
}

.input:focus {
    background: #2c2c2e;
    border-color: #007aff;
}

.input::placeholder {
    color: #636366;
}

.upload-area {
    background: #1c1c1e;
    border-color: #3a3a3c;
}

.upload-area.has-image {
    border-color: #34c759;
    background: #1c2c1e;
}

.btn-upload {
    background: #2c2c2e;
    color: #ffffff;
}

.btn-upload:hover {
    background: #3a3a3c;
}

.empty-message {
    color: #636366;
}

.ad-card {
    background: #1c1c1e;
}

.ad-info h3 {
    color: #ffffff;
}

.ad-description {
    color: #8e8e93;
}

.ad-image {
    background: #2c2c2e;
}

.ad-category {
    background: #2c2c2e;
    color: #8e8e93;
}

.premium-feature {
    background: #2c2c2e;
    color: #ffffff;
}

.btn-close {
    background: #2c2c2e;
    color: #ffffff;
}

.btn-close:hover {
    background: #3a3a3c;
}

.profile-info p {
    border-bottom-color: #2c2c2e;
}
}

/* ========== КАРТОЧКА ТОВАРА ========== */
.ad-detail {
animation: fadeIn 0.3s ease;
}

.ad-detail-image {
width: 100%;
max-height: 400px;
object-fit: contain;
border-radius: 12px;
background: #f2f2f7;
margin-bottom: 16px;
}

.ad-detail-info {
padding: 4px 0;
}

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

.ad-detail-title {
font-size: 24px;
font-weight: 700;
color: #1c1c1e;
margin-bottom: 8px;
}

.ad-detail-price {
font-size: 28px;
font-weight: 700;
color: #007aff;
margin-bottom: 12px;
}

.ad-detail-meta {
display: flex;
gap: 20px;
font-size: 14px;
color: #8e8e93;
margin-bottom: 16px;
padding-bottom: 16px;
border-bottom: 1px solid #f2f2f7;
}

.ad-detail-description {
font-size: 16px;
line-height: 1.6;
color: #1c1c1e;
margin-bottom: 20px;
white-space: pre-wrap;
}

.ad-detail-actions {
display: flex;
gap: 12px;
flex-wrap: wrap;
}

.btn-sm {
padding: 6px 16px;
font-size: 13px;
width: auto;
}

.btn-secondary {
background: #e9ecef;
color: #1c1c1e;
padding: 12px 20px;
border-radius: 12px;
border: none;
font-size: 16px;
font-weight: 600;
cursor: pointer;
flex: 1;
}

.btn-secondary:hover {
background: #dee2e6;
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
.ad-detail-title {
    color: #ffffff;
}

.ad-detail-description {
    color: #ffffff;
}

.ad-detail-meta {
    border-bottom-color: #2c2c2e;
}

.btn-secondary {
    background: #2c2c2e;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #3a3a3c;
}

.ad-detail-image {
    background: #2c2c2e;
}
}

/* ========== СЕТКА ПЛИТОК ========== */
.ads-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 12px;
}

/* ========== КАРТОЧКИ В СЕТКЕ ========== */
.ads-grid .ad-card {
margin-bottom: 0;
display: flex;
flex-direction: column;
height: 100%;
}

.ads-grid .ad-image,
.ads-grid .ad-image-placeholder {
height: 150px;
width: 100%;
object-fit: cover;
background: #f2f2f7;
}

.ads-grid .ad-image-placeholder {
display: flex;
align-items: center;
justify-content: center;
font-size: 40px;
color: #aeaeb2;
}

.ads-grid .ad-info {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px 12px;
}

.ads-grid .ad-info h3 {
font-size: 14px;
margin-bottom: 2px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

.ads-grid .ad-price {
font-size: 16px;
margin: 2px 0;
}

.ads-grid .ad-description {
display: none;
}

.ads-grid .ad-author {
font-size: 12px;
margin: 2px 0;
}

.ads-grid .btn-open {
margin-top: auto;
width: 100%;
padding: 6px;
font-size: 13px;
}

/* ========== ПОИСКОВАЯ СТРОКА ========== */
.search-row {
margin-bottom: 10px;
}

.search-controls {
display: flex;
gap: 10px;
}

.search-controls .input {
flex: 1;
margin-bottom: 0;
}

/* ========== ПАГИНАЦИЯ ========== */
.pagination {
display: flex;
justify-content: center;
align-items: center;
gap: 16px;
margin-top: 16px;
padding-top: 16px;
border-top: 1px solid #f2f2f7;
}

.pagination .btn-sm {
width: auto;
padding: 6px 16px;
}

.pagination #page-info {
font-size: 14px;
color: #8e8e93;
}

.pagination .btn-sm:disabled {
opacity: 0.4;
cursor: not-allowed;
}

/* ========== АДАПТИВ ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ ========== */
@media (max-width: 480px) {
.ads-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.ads-grid .ad-image,
.ads-grid .ad-image-placeholder {
    height: 110px;
}

.ads-grid .ad-info {
    padding: 8px 10px;
}

.ads-grid .ad-info h3 {
    font-size: 12px;
}

.ads-grid .ad-price {
    font-size: 14px;
}

.search-controls {
    flex-direction: column;
    gap: 8px;
}

.search-controls .input {
    margin-bottom: 0;
}
}

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

/* ========== ТЁМНАЯ ТЕМА ========== */
@media (prefers-color-scheme: dark) {
.ads-grid .ad-image-placeholder {
    background: #2c2c2e;
    color: #636366;
}

.pagination {
    border-top-color: #2c2c2e;
}

.pagination #page-info {
    color: #8e8e93;
}
}

/* ========== КНОПКИ ДЕЙСТВИЙ ========== */
.ad-actions {
display: flex;
gap: 6px;
margin-top: 8px;
flex-wrap: wrap;
}

.ad-actions .btn-sm {
flex: 1;
min-width: 40px;
padding: 4px 8px;
font-size: 14px;
}

.btn-favorite {
background: #f2f2f7;
color: #8e8e93;
border: 1px solid #e5e5ea;
transition: all 0.3s;
}

.btn-favorite:hover {
background: #ffd700;
color: #1c1c1e;
border-color: #ffd700;
}

.btn-favorite.active {
background: #ffd700;
color: #1c1c1e;
border-color: #ffd700;
}

.btn-edit {
background: #e9ecef;
color: #1c1c1e;
border: 1px solid #dee2e6;
}

.btn-edit:hover {
background: #007aff;
color: white;
border-color: #007aff;
}

/* Кнопка в карточке */
.btn-favorite.active {
background: #ffd700;
color: #1c1c1e;
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
.btn-favorite {
    background: #2c2c2e;
    color: #8e8e93;
    border-color: #3a3a3c;
}

.btn-favorite:hover {
    background: #ffd700;
    color: #1c1c1e;
}

.btn-edit {
    background: #2c2c2e;
    color: #ffffff;
    border-color: #3a3a3c;
}

.btn-edit:hover {
    background: #007aff;
    color: white;
    border-color: #007aff;
}
}

/* ========== ГАЛЕРЕЯ ФОТО ========== */
.photo-gallery {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 16px;
}

.photo-upload-area {
width: 100px;
height: 100px;
border: 2px dashed #dee2e6;
border-radius: 12px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s;
background: #f8f9fa;
color: #8e8e93;
font-size: 12px;
text-align: center;
}

.photo-upload-area:hover {
border-color: #007aff;
background: #f0f8ff;
}

.photo-upload-area span {
font-size: 28px;
}

.photo-upload-area small {
font-size: 10px;
color: #aeaeb2;
}

.photo-list {
display: flex;
flex-wrap: wrap;
gap: 10px;
}

.photo-item {
position: relative;
width: 100px;
height: 100px;
border-radius: 12px;
overflow: hidden;
background: #f2f2f7;
border: 1px solid #e5e5ea;
}

.photo-item img {
width: 100%;
height: 100%;
object-fit: cover;
}

.photo-item.loading {
opacity: 0.6;
}

.photo-loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 24px;
}

.photo-remove {
position: absolute;
top: 4px;
right: 4px;
width: 24px;
height: 24px;
border-radius: 50%;
border: none;
background: rgba(255, 59, 48, 0.9);
color: white;
font-size: 14px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}

.photo-remove:hover {
background: #ff3b30;
}

/* Адаптив для фото */
@media (max-width: 480px) {
.photo-upload-area,
.photo-item {
    width: 70px;
    height: 70px;
}

.photo-upload-area span {
    font-size: 20px;
}

.photo-upload-area p {
    font-size: 10px;
    margin: 2px 0;
}

.photo-upload-area small {
    font-size: 8px;
}
}
/* ========== КАРУСЕЛЬ ФОТО ========== */
.carousel {
position: relative;
width: 100%;
background: #f2f2f7;
border-radius: 12px;
overflow: hidden;
margin-bottom: 16px;
aspect-ratio: 16 / 9;
}

.carousel-track {
display: flex;
width: 100%;
height: 100%;
transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
will-change: transform;
}

.carousel-slide {
flex: 0 0 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: #f2f2f7;
overflow: hidden;
}

.carousel-slide img {
width: 100%;
height: 100%;
object-fit: contain;
background: #f2f2f7;
user-select: none;
-webkit-user-drag: none;
}

.carousel-btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.5);
color: white;
border: none;
border-radius: 50%;
width: 36px;
height: 36px;
font-size: 18px;
cursor: pointer;
transition: background 0.3s;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
}

.carousel-btn:hover {
background: rgba(0, 0, 0, 0.7);
}

.carousel-btn.prev {
left: 8px;
}

.carousel-btn.next {
right: 8px;
}

.carousel-dots {
position: absolute;
bottom: 12px;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 8px;
z-index: 10;
}

.carousel-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.5);
border: none;
cursor: pointer;
padding: 0;
transition: background 0.3s;
}

.carousel-dot.active {
background: #ffffff;
}

.carousel-counter {
position: absolute;
top: 12px;
right: 12px;
background: rgba(0, 0, 0, 0.6);
color: white;
padding: 4px 12px;
border-radius: 20px;
font-size: 13px;
z-index: 10;
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
.carousel {
    background: #1c1c1e;
}

.carousel-slide {
    background: #1c1c1e;
}

.carousel-slide img {
    background: #1c1c1e;
}
}

@media (max-width: 480px) {
.carousel {
    aspect-ratio: 4 / 3;
}

.carousel-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
}
}

/* ========== ПОЛНОЭКРАННЫЙ ПРОСМОТР ========== */
.fullscreen-viewer {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.95);
z-index: 9999;
display: none;
align-items: center;
justify-content: center;
touch-action: none;
user-select: none;
-webkit-user-select: none;
}

.fullscreen-viewer.active {
display: flex;
}

.fullscreen-container {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
position: relative;
}

.fullscreen-slide {
min-width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: transform 0.3s ease;
}

.fullscreen-slide img {
max-width: 100%;
max-height: 100%;
object-fit: contain;
pointer-events: none;
-webkit-user-drag: none;
}

.fullscreen-close {
position: fixed;
top: 16px;
right: 16px;
width: 40px;
height: 40px;
border-radius: 50%;
border: none;
background: rgba(255, 255, 255, 0.2);
color: white;
font-size: 22px;
cursor: pointer;
z-index: 10001;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.3s;
}

.fullscreen-close:hover {
background: rgba(255, 255, 255, 0.4);
}

.fullscreen-counter {
position: fixed;
top: 20px;
left: 50%;
transform: translateX(-50%);
color: rgba(255, 255, 255, 0.7);
font-size: 14px;
z-index: 10001;
background: rgba(0, 0, 0, 0.5);
padding: 4px 16px;
border-radius: 20px;
}

.fullscreen-nav {
position: fixed;
top: 50%;
transform: translateY(-50%);
width: 44px;
height: 44px;
border-radius: 50%;
border: none;
background: rgba(255, 255, 255, 0.15);
color: white;
font-size: 28px;
cursor: pointer;
z-index: 10001;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.3s;
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
}

.fullscreen-nav:hover {
background: rgba(255, 255, 255, 0.3);
}

.fullscreen-nav.prev {
left: 16px;
}

.fullscreen-nav.next {
right: 16px;
}

.fullscreen-dots {
position: fixed;
bottom: 30px;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 10px;
z-index: 10001;
}

.fullscreen-dot {
width: 10px;
height: 10px;
border-radius: 50%;
border: none;
background: rgba(255, 255, 255, 0.3);
cursor: pointer;
padding: 0;
transition: background 0.3s, transform 0.3s;
}

.fullscreen-dot.active {
background: #ffffff;
transform: scale(1.2);
}

.fullscreen-dot:hover {
background: rgba(255, 255, 255, 0.6);
}

/* Адаптив для маленьких экранов */
@media (max-width: 480px) {
.fullscreen-nav {
    width: 36px;
    height: 36px;
    font-size: 20px;
}

.fullscreen-nav.prev {
    left: 8px;
}

.fullscreen-nav.next {
    right: 8px;
}

.fullscreen-close {
    width: 34px;
    height: 34px;
    font-size: 18px;
    top: 12px;
    right: 12px;
}

.fullscreen-dots {
    bottom: 20px;
    gap: 8px;
}

.fullscreen-dot {
    width: 8px;
    height: 8px;
}
}

/* ========== КНОПКА СВЯЗАТЬСЯ ========== */
.btn-success {
background: #34c759;
color: white;
border: none;
padding: 6px 12px;
border-radius: 8px;
font-size: 14px;
cursor: pointer;
transition: background 0.3s;
}

.btn-success:hover {
background: #28a745;
}

.btn-success.btn-sm {
padding: 4px 10px;
font-size: 13px;
min-width: 36px;
}

/* ========== СООБЩЕНИЯ ========== */
.message-form {
margin-bottom: 16px;
}

.message-form-row {
display: flex;
gap: 8px;
align-items: center;
}

.message-form-row .input {
margin-bottom: 0;
flex: 1;
}

.message-form-row .input:first-child {
flex: 0 0 120px;
}

.btn-send {
flex: 0 0 44px;
height: 44px;
padding: 0;
border-radius: 12px;
font-size: 18px;
display: flex;
align-items: center;
justify-content: center;
}

/* ===== СООБЩЕНИЯ В СПИСКЕ ===== */
.message-item {
padding: 12px 14px;
border-radius: 12px;
margin-bottom: 10px;
background: #f8f9fa;
border-left: 4px solid #007aff;
}

.message-item.unread {
border-left-color: #ff3b30;
background: #fff5f5;
}

.message-item .message-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 4px;
}

.message-item .message-sender {
font-weight: 600;
font-size: 14px;
color: #1c1c1e;
}

.message-item .message-date {
font-size: 12px;
color: #8e8e93;
}

.message-item .message-text {
font-size: 15px;
color: #1c1c1e;
word-wrap: break-word;
}

.message-item .message-status {
font-size: 12px;
color: #8e8e93;
margin-top: 4px;
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
.message-item {
    background: #2c2c2e;
}

.message-item .message-sender {
    color: #ffffff;
}

.message-item .message-text {
    color: #ffffff;
}

.message-item.unread {
    background: #3c1c1e;
    border-left-color: #ff3b30;
}
}

@media (max-width: 480px) {
.message-form-row {
    flex-wrap: wrap;
}

.message-form-row .input:first-child {
    flex: 0 0 100%;
}

.btn-send {
    flex: 0 0 40px;
    height: 40px;
    font-size: 16px;
}
}

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
z-index: 10000;
display: none;
align-items: center;
justify-content: center;
animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
display: flex;
}

.modal-content {
background: #ffffff;
border-radius: 16px;
width: 90%;
max-width: 480px;
max-height: 80vh;
overflow: hidden;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: slideUp 0.3s ease;
}

@keyframes slideUp {
from {
    transform: translateY(30px);
    opacity: 0;
}
to {
    transform: translateY(0);
    opacity: 1;
}
}

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

.modal-header h3 {
font-size: 18px;
font-weight: 600;
color: #1c1c1e;
margin: 0;
}

.modal-body {
padding: 20px;
}

.modal-seller-info {
font-size: 14px;
color: #8e8e93;
margin-bottom: 12px;
}

.modal-seller-info strong {
color: #1c1c1e;
}

.modal-body .textarea {
min-height: 100px;
resize: vertical;
font-size: 15px;
}

.modal-footer {
display: flex;
gap: 10px;
padding: 16px 20px;
border-top: 1px solid #f2f2f7;
justify-content: flex-end;
}

.modal-footer .btn {
min-width: 100px;
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
.modal-content {
    background: #1c1c1e;
}

.modal-header {
    border-bottom-color: #2c2c2e;
}

.modal-header h3 {
    color: #ffffff;
}

.modal-seller-info {
    color: #8e8e93;
}

.modal-seller-info strong {
    color: #ffffff;
}

.modal-footer {
    border-top-color: #2c2c2e;
}
}

@media (max-width: 480px) {
.modal-content {
    width: 95%;
    max-height: 90vh;
}

.modal-footer {
    flex-direction: column;
}

.modal-footer .btn {
    width: 100%;
    min-width: unset;
}
}

/* ========== ЧАТ ========== */
.chat-messages {
max-height: 50vh;
overflow-y: auto;
padding: 12px 0;
display: flex;
flex-direction: column;
gap: 8px;
}

.chat-message {
max-width: 80%;
padding: 10px 14px;
border-radius: 16px;
word-wrap: break-word;
animation: fadeIn 0.2s ease;
}

.chat-message.mine {
align-self: flex-end;
background: #007aff;
color: white;
border-bottom-right-radius: 4px;
}

.chat-message.theirs {
align-self: flex-start;
background: #f2f2f7;
color: #1c1c1e;
border-bottom-left-radius: 4px;
}

.chat-message .msg-sender {
font-size: 12px;
font-weight: 600;
margin-bottom: 2px;
}

.chat-message .msg-text {
font-size: 15px;
line-height: 1.4;
}

.chat-message .msg-time {
font-size: 11px;
opacity: 0.6;
margin-top: 4px;
text-align: right;
}

.chat-message.mine .msg-sender {
color: rgba(255, 255, 255, 0.8);
}

.chat-message.theirs .msg-sender {
color: #007aff;
}

.chat-input {
display: flex;
gap: 8px;
margin-top: 12px;
padding-top: 12px;
border-top: 1px solid #f2f2f7;
}

.chat-input .input {
margin-bottom: 0;
flex: 1;
}

.chat-input .btn {
flex: 0 0 44px;
height: 44px;
padding: 0;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
.chat-message.theirs {
    background: #2c2c2e;
    color: #ffffff;
}

.chat-input {
    border-top-color: #2c2c2e;
}
}

/* Диалоги */
.dialog-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 14px;
border-radius: 12px;
background: #f8f9fa;
margin-bottom: 8px;
cursor: pointer;
transition: background 0.2s;
}

.dialog-item:hover {
background: #e9ecef;
}

.dialog-item .dialog-info {
flex: 1;
}

.dialog-item .dialog-title {
font-weight: 600;
font-size: 15px;
color: #1c1c1e;
}

.dialog-item .dialog-last {
font-size: 13px;
color: #8e8e93;
margin-top: 2px;
}

.dialog-item .dialog-meta {
text-align: right;
flex-shrink: 0;
margin-left: 12px;
}

.dialog-item .dialog-date {
font-size: 12px;
color: #8e8e93;
}

.dialog-item .dialog-unread {
background: #ff3b30;
color: white;
border-radius: 50%;
padding: 2px 8px;
font-size: 12px;
font-weight: 600;
margin-top: 4px;
}

@media (prefers-color-scheme: dark) {
.dialog-item {
    background: #1c1c1e;
}

.dialog-item:hover {
    background: #2c2c2e;
}

.dialog-item .dialog-title {
    color: #ffffff;
}
}

/* ========== БЕЙДЖ ДЛЯ НОВЫХ СООБЩЕНИЙ ========== */
.menu-btn {
position: relative;
}

.badge {
position: absolute;
top: -4px;
right: -4px;
background: #ff3b30;
color: white;
font-size: 11px;
font-weight: 700;
border-radius: 50%;
min-width: 20px;
height: 20px;
padding: 0 6px;
display: flex;
align-items: center;
justify-content: center;
border: 2px solid #ffffff;
box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
0%, 100% {
    transform: scale(1);
}
50% {
    transform: scale(1.1);
}
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
.badge {
    border-color: #1c1c1e;
}
}

/* Адаптив для маленьких экранов */
@media (max-width: 480px) {
.badge {
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    top: -2px;
    right: -2px;
}
}

/* ========== СОГЛАСИЕ (блокировка меню) ========== */
.consent-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
z-index: 9998;
align-items: center;
justify-content: center;
padding: 20px;
}

.consent-overlay.active {
display: flex;
}

.consent-overlay .consent-card {
background: #ffffff;
border-radius: 16px;
padding: 24px;
max-width: 400px;
width: 100%;
text-align: center;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: fadeIn 0.3s ease;
}

.consent-overlay .consent-card h2 {
font-size: 20px;
margin-bottom: 12px;
color: #1c1c1e;
}

.consent-overlay .consent-card p {
font-size: 14px;
color: #8e8e93;
line-height: 1.6;
margin-bottom: 20px;
}

.consent-overlay .consent-card .btn {
width: 100%;
margin-bottom: 10px;
}

.consent-overlay .consent-card .btn:last-child {
margin-bottom: 0;
}

/* Тёмная тема для оверлея */
@media (prefers-color-scheme: dark) {
.consent-overlay .consent-card {
    background: #1c1c1e;
}
.consent-overlay .consent-card h2 {
    color: #ffffff;
}
}

/* ===== ФИЛЬТРЫ ПОИСКА ===== */
.search-row {
margin-bottom: 10px;
}
.search-controls {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.search-controls .input {
flex: 1;
margin-bottom: 0;
}
.search-controls .input:first-child {
flex: 0 0 120px;
}
.ad-city, .ad-views {
font-size: 12px;
color: #8e8e93;
margin: 2px 0;
}

/* Адаптив */
@media (max-width: 480px) {
.search-controls {
    flex-direction: column;
}
.search-controls .input {
    flex: 1 1 100%;
}
.search-controls .input:first-child {
    flex: 1 1 100%;
}
}
/* ========== РЕЙТИНГ ========== */
.ad-rating {
font-size: 13px;
color: #8e8e93;
margin: 2px 0;
}

.ad-rating .stars {
letter-spacing: 1px;
}

.rating-stars {
font-size: 18px;
letter-spacing: 2px;
}

.rating-text {
font-size: 14px;
color: #6c6c70;
margin-left: 8px;
}

.seller-rating {
display: flex;
align-items: center;
gap: 12px;
margin: 8px 0;
}

.review-item {
background: #f8f9fa;
padding: 12px 16px;
border-radius: 12px;
margin-bottom: 10px;
}

.review-item .review-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 4px;
}

.review-item .review-author {
font-weight: 600;
font-size: 14px;
color: #1c1c1e;
}

.review-item .review-date {
font-size: 12px;
color: #8e8e93;
}

.review-item .review-text {
font-size: 14px;
color: #1c1c1e;
margin-top: 4px;
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
.review-item {
    background: #2c2c2e;
}
.review-item .review-author {
    color: #ffffff;
}
.review-item .review-text {
    color: #ffffff;
}
.rating-text {
    color: #8e8e93;
}
}

/* ========== СТАТИСТИКА ========== */
.stats-section {
margin-top: 20px;
padding-top: 16px;
border-top: 1px solid #f2f2f7;
}

.stats-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
margin-bottom: 16px;
}

.stat-item {
background: #f8f9fa;
padding: 12px;
border-radius: 10px;
text-align: center;
}

.stat-item .number {
font-size: 24px;
font-weight: 700;
color: #007aff;
}

.stat-item .label {
font-size: 12px;
color: #8e8e93;
}

.stat-item .number.green { color: #34c759; }
.stat-item .number.orange { color: #ff9500; }

.chart-bars {
display: flex;
align-items: flex-end;
gap: 4px;
height: 100px;
overflow-x: auto;
padding-bottom: 4px;
}

.chart-bar-wrapper {
display: flex;
flex-direction: column;
align-items: center;
min-width: 24px;
}

.chart-bar {
width: 20px;
border-radius: 4px 4px 0 0;
transition: height 0.3s;
background: #007aff;
}

.chart-label {
font-size: 8px;
color: #8e8e93;
margin-top: 2px;
transform: rotate(-45deg);
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
.stat-item {
    background: #2c2c2e;
}
.stats-section {
    border-top-color: #2c2c2e;
}
}

        /* ========== ПРЕМИУМ СТРАНИЦА ========== */

.premium-plan {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e5e5ea;
    transition: all 0.2s;
}

.premium-plan:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.premium-plan .plan-badge {
    display: inline-block;
    background: #007aff;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 8px;
}

.premium-plan .plan-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.premium-plan .plan-desc {
    font-size: 14px;
    color: #8e8e93;
    margin-bottom: 12px;
}

.premium-plan .plan-price {
    font-size: 28px;
    font-weight: 700;
    color: #007aff;
}

.premium-plan .plan-price small {
    font-size: 14px;
    font-weight: 400;
    color: #8e8e93;
}

.premium-plan .plan-price-3m {
    font-size: 14px;
    color: #34c759;
    margin-bottom: 12px;
}

.premium-plan .plan-features {
    list-style: none;
    padding: 0;
    margin: 12px 0;
    text-align: left;
}

.premium-plan .plan-features li {
    padding: 4px 0;
    border-bottom: 1px solid #f2f2f7;
    font-size: 14px;
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
    .premium-plan {
        background: #1c1c1e;
        border-color: #2c2c2e;
    }
    .premium-plan .plan-features li {
        border-bottom-color: #2c2c2e;
    }
    .premium-status {
        background: #1c2c1e !important;
    }
}

/* ========== ПРЕМИУМ ЗНАЧКИ ========== */

.turbo-tag {
    background: #ff4500;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 4px;
}

.top-tag {
    background: #ffd700;
    color: #1c1c1e;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 4px;
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
    .turbo-tag {
        background: #cc3700;
    }
    .top-tag {
        background: #ccb000;
        color: #1c1c1e;
    }
}

/* ========== ЗНАЧОК ЗАКРЕПА ========== */

.pinned-tag {
    background: #8e44ad;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 4px;
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
    .pinned-tag {
        background: #6c3483;
    }
}

/* ========== ЮРИДИЧЕСКИЕ ССЫЛКИ ========== */

.legal-links {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e5ea;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
}

.legal-links a {
    color: #8e8e93;
    text-decoration: none;
    transition: color 0.2s;
}

.legal-links a:hover {
    color: #007aff;
    text-decoration: underline;
}

.legal-links span {
    color: #e5e5ea;
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
    .legal-links {
        border-top-color: #2c2c2e;
    }
    .legal-links span {
        color: #2c2c2e;
    }
}

/* Адаптив */
@media (max-width: 480px) {
    .legal-links {
        gap: 8px;
        font-size: 10px;
    }
    .legal-links span {
        display: none;
    }
    .legal-links a {
        display: inline-block;
        padding: 4px 0;
    }
}

/* ========== КНОПКА КОПИРОВАНИЯ ========== */

.btn-copy {
    background: #f0f0f0;
    color: #1c1c1e;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

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

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
    .btn-copy {
        background: #2c2c2e;
        color: #f0f0f0;
        border-color: #3a3a3c;
    }
    .btn-copy:hover {
        background: #3a3a3c;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

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

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body .input {
    margin-bottom: 12px;
}

@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #1c1c1e;
    }
    .modal-header {
        border-bottom-color: #2c2c2e;
    }
    .modal-header h3 {
        color: #f0f0f0;
    }
}
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm:hover {
    transform: scale(1.05);
}

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

.btn-danger {
    background: #ff3b30;
    color: white;
}

.btn-danger:hover {
    background: #d63031;
}

.btn-success {
    background: #34c759;
    color: white;
}

.btn-success:hover {
    background: #28a745;
}

.btn-edit {
    background: #e9ecef;
    color: #1c1c1e;
    border: 1px solid #dee2e6;
}

.btn-edit:hover {
    background: #007aff;
    color: white;
    border-color: #007aff;
}

.btn-copy {
    background: #f0f0f0;
    color: #1c1c1e;
    border: 1px solid #e0e0e0;
}

.btn-copy:hover {
    background: #e0e0e0;
}

/* ===== СТАТУС ОБЪЯВЛЕНИЯ ===== */

.status-active {
    font-size: 11px;
    color: #34c759;
    background: #e8f5e9;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.status-inactive {
    font-size: 11px;
    color: #ff3b30;
    background: #fff5f5;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.btn-danger {
    background: #ff3b30;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #d63031;
}

.btn-success {
    background: #34c759;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-success:hover {
    background: #28a745;
}

.btn-danger {
    background: #ff3b30;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #d63031;
}

.btn-danger.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}