/* ===== Базовые стили ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 15px; width: 100%; }
a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Шапка ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #8b00ff;
    text-align: center;
}
.header-center { flex: 1; text-align: center; }

/* ===== Кнопки ===== */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    text-decoration: none !important;
}
.btn-primary {
    background: linear-gradient(135deg, #8b00ff, #00BFFF);
    color: #fff;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-outline {
    background: #fff;
    border: 2px solid #8b00ff;
    color: #8b00ff;
}
.btn-outline:hover { background: #8b00ff; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-success { background: #28a745; color: #fff; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }

/* ===== Dropdown ===== */
.dropdown { position: relative; display: inline-block; }
.dropdown-toggle { cursor: pointer; }
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    min-width: 160px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    z-index: 200;
    overflow: hidden;
}
.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}
.dropdown-menu a:hover { background: #f5f0ff; }

/* ===== Главная ===== */
.page-title {
    text-align: center;
    font-size: 1.8rem;
    color: #8b00ff;
    margin: 25px 0 10px;
    font-weight: 700;
}
.subtitle {
    text-align: center;
    color: #00BFFF;
    font-size: 1.2rem;
    margin-bottom: 20px;
}
.city-select-wrap {
    text-align: center;
    margin-bottom: 30px;
}
.city-select-wrap select {
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid #8b00ff;
    font-size: 1rem;
    min-width: 260px;
    background: #fff;
    cursor: pointer;
}

/* Кнопки городов / услуг */
.buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0 40px;
}
.city-btn, .service-btn {
    display: block;
    background: linear-gradient(145deg, #ffffff, #f0f4ff);
    border: 2px solid #8b00ff;
    border-radius: 16px;
    padding: 18px 12px;
    text-align: center;
    color: #333;
    font-weight: 600;
    transition: all 0.25s;
    box-shadow: 0 4px 12px rgba(139,0,255,0.15);
}
.city-btn:hover, .service-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(139,0,255,0.25);
    background: linear-gradient(145deg, #f8f0ff, #e8f4ff);
}
.city-btn .clicks, .service-btn .meta {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 6px;
    font-weight: 400;
}

/* ===== Формы ===== */
.form-box {
    max-width: 480px;
    margin: 30px auto;
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.form-box h1 { text-align: center; margin-bottom: 20px; color: #8b00ff; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 1rem;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #8b00ff;
    box-shadow: 0 0 0 3px rgba(139,0,255,0.15);
}
.captcha-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f0f4ff;
    padding: 10px 14px;
    border-radius: 10px;
}
.captcha-num {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: #8b00ff;
    background: #fff;
    padding: 6px 12px;
    border-radius: 8px;
}
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
}
.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }
.alert-info { background: #d1ecf1; color: #0c5460; }

/* ===== Комментарии ===== */
.comments-section { margin-top: 30px; }
.comment {
    display: flex;
    gap: 12px;
    background: #fff;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.comment-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #ddd;
}
.comment-body { flex: 1; }
.comment-author { font-weight: 700; color: #8b00ff; }
.comment-date { font-size: 0.8rem; color: #999; }
.vote-btns { margin-top: 6px; }
.vote-btns button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    margin-right: 6px;
}
.vote-btns button:hover { background: #f0f0f0; }

/* ===== Подвал ===== */
.site-footer {
    background: #1a1a2e;
    color: #eee;
    padding: 30px 0 20px;
    margin-top: auto;
}
.footer-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}
.footer-contacts p { margin-bottom: 6px; font-size: 0.95rem; }
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.footer-links img {
    border-radius: 8px;
    transition: transform 0.2s;
}
.footer-links img:hover { transform: scale(1.1); }
.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 15px;
    text-align: center;
    font-size: 0.85rem;
    color: #aaa;
}

/* ===== Админка ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px;
    background: #1a1a2e;
    color: #fff;
    padding: 20px 0;
    flex-shrink: 0;
}
.admin-sidebar a {
    display: block;
    padding: 12px 20px;
    color: #ccc;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: #8b00ff;
    color: #fff;
}
.admin-content { flex: 1; padding: 25px; background: #f5f7fa; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.admin-table th, .admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.admin-table th { background: #f0f4ff; font-weight: 600; }
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}
.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.stat-card .num { font-size: 2rem; font-weight: 700; color: #8b00ff; }

/* ===== Адаптив ===== */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; gap: 8px; }
    .logo { font-size: 1.1rem; }
    .page-title { font-size: 1.4rem; }
    .buttons-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .city-btn, .service-btn { padding: 14px 8px; font-size: 0.9rem; }
    .form-box { padding: 20px 15px; margin: 15px; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .footer-top { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .buttons-grid { grid-template-columns: 1fr; }
}

/* ===== Иконки городов ===== */
.city-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.city-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
}
.city-name { font-weight: 600; }

/* ===== Карточки услуг ===== */
.services-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0 40px;
}
.service-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #eee;
    transition: transform 0.2s, box-shadow 0.2s;
}
.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(139,0,255,0.15);
}
.service-card-photo {
    height: 160px;
    overflow: hidden;
    background: #f0f0f0;
}
.service-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.service-card-photo .no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 0.9rem;
}
.service-card-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.service-card-title {
    font-size: 1.05rem;
    margin-bottom: 4px;
    line-height: 1.3;
}
.service-card-title a { color: #333; }
.service-card-title a:hover { color: #8b00ff; }
.service-card-meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}
.service-card-desc {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 10px;
    flex: 1;
    line-height: 1.4;
}
.btn-expand {
    background: none;
    border: none;
    color: #8b00ff;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    margin-left: 4px;
}
.btn-expand:hover { text-decoration: underline; }
.service-card-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #8b00ff;
    margin-bottom: 6px;
}
.service-card-phone {
    font-size: 0.95rem;
    color: #28a745;
    margin-bottom: 10px;
    font-weight: 600;
}
.service-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}
.vote-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.85rem;
}
.vote-btn:hover { background: #eee; }
.comments-link {
    font-size: 0.85rem;
    color: #0066cc;
}
.clicks-mini {
    font-size: 0.8rem;
    color: #999;
    margin-left: auto;
}

@media (max-width: 600px) {
    .services-cards { grid-template-columns: 1fr; }
}

/* ===== Карточки услуг (стиль интернет-магазина) ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
    gap: 20px;
    margin: 20px 0 40px;
}
.product-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(139,0,255,0.18);
}
.product-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 220px;
    overflow: hidden;
    background: #f4f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-photo a {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}
.product-photo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
}
.product-photo .no-photo {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; color: #999; font-size: 0.9rem;
}
.product-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-title {
    font-size: 1.05rem;
    margin-bottom: 8px;
    line-height: 1.3;
}
.product-title a { color: #222; text-decoration: none; }
.product-title a:hover { color: #8b00ff; }
.product-seller {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.seller-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.seller-avatar-empty {
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #8b00ff, #00BFFF);
    color: #fff; font-weight: 700; font-size: 0.9rem;
}
.seller-login { display: block; font-weight: 600; font-size: 0.9rem; color: #333; }
.product-date { display: block; font-size: 0.75rem; color: #999; }
.product-city { font-size: 0.8rem; color: #888; margin-bottom: 8px; }
.product-desc {
    font-size: 0.9rem; color: #555; margin-bottom: 10px;
    flex: 1; line-height: 1.4;
}
.product-price {
    font-size: 1.2rem; font-weight: 700; color: #8b00ff; margin-bottom: 6px;
}
.product-phone {
    font-size: 0.95rem; color: #28a745; font-weight: 600; margin-bottom: 10px;
}
.product-actions {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-top: auto; padding-top: 10px; border-top: 1px solid #f0f0f0;
}
.review-link {
    font-size: 0.85rem; color: #0066cc; font-weight: 600;
}
.footer-link-item {
    display: inline-flex; flex-direction: column; align-items: center;
    gap: 4px; text-align: center; max-width: 100px;
}
.footer-link-item img { border-radius: 8px; }
.footer-link-desc { font-size: 0.7rem; color: #aaa; display: block; }

@media (max-width: 600px) {
    .product-grid { grid-template-columns: 1fr; gap: 14px; }
    .product-photo {
        aspect-ratio: 16 / 10;
        max-height: 200px;
    }
    .product-card {
        max-width: 100%;
        margin: 0 auto;
    }
}

/* Страница услуги — фото не вылезает */
.product-detail-photo {
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: #f4f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 420px;
}
.product-detail-photo img {
    max-width: 100%;
    max-height: 420px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 16px;
}
@media (max-width: 700px) {
    .product-detail-photo { max-height: 280px; }
    .product-detail-photo img { max-height: 280px; }
}

/* ===== Мини-плеер в подвале ===== */
.mini-player {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 22px;
    max-width: 640px;
}
.mp-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.mp-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s;
}
.mp-btn:hover { background: rgba(139,0,255,0.6); }
.mp-play { background: linear-gradient(135deg, #8b00ff, #00BFFF); width: 40px; height: 40px; }
.mp-info {
    flex: 1;
    min-width: 120px;
}
.mp-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.mp-time {
    font-size: 0.75rem;
    color: #aaa;
}
.mp-seek {
    flex: 1;
    min-width: 100px;
    max-width: 200px;
    accent-color: #8b00ff;
    cursor: pointer;
}
.mp-playlist {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    max-height: 140px;
    overflow-y: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 8px;
}
.mp-playlist li {
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #ccc;
}
.mp-playlist li:hover { background: rgba(255,255,255,0.08); color: #fff; }
.mp-playlist li.active {
    background: rgba(139,0,255,0.35);
    color: #fff;
    font-weight: 600;
}
@media (max-width: 600px) {
    .mp-title { max-width: 140px; }
    .mp-seek { max-width: 100%; width: 100%; order: 10; }
    .mp-main { gap: 6px; }
}

/* Обложки треков в мини-плеере */
.mp-cover {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
}
.mp-playlist li {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mp-cover-thumb {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
}
.mp-track-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Громкость и скачать в мини-плеере */
.mp-volume {
    width: 70px;
    min-width: 50px;
    max-width: 90px;
    accent-color: #8b00ff;
    cursor: pointer;
    flex-shrink: 0;
}
.mp-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.15s;
}
.mp-download:hover {
    background: rgba(139,0,255,0.7);
    color: #fff;
}
@media (max-width: 600px) {
    .mp-volume { width: 55px; }
}
