@import url("https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@800&display=swap");

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #0ea5e9;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --border: #e2e8f0;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
    --sort-gold: #b8860b;
    --sort-gold-soft: rgba(184, 134, 11, 0.35);
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
}

body.app-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, #eef4ff 0%, var(--bg) 42%);
    color: var(--text);
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.app-body > main {
    flex: 1 0 auto;
}

.app-container {
    max-width: 1180px;
}

/* Верхнее меню: белый фон как в макете */
.app-navbar {
    --bs-navbar-color: var(--text);
    --bs-navbar-hover-color: var(--primary);
    --bs-navbar-active-color: var(--primary);
}

.app-navbar .navbar-brand,
.app-navbar .navbar-brand span {
    color: var(--text) !important;
    font-weight: 700;
}

.app-navbar .navbar-text {
    color: var(--muted) !important;
}

.app-navbar .nav-link {
    color: var(--text) !important;
    border-radius: 999px;
    padding: 0.4rem 0.85rem !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary) !important;
}

.app-navbar .app-nav-exit {
    color: var(--danger) !important;
}

.app-navbar .app-nav-exit:hover,
.app-navbar .app-nav-exit:focus {
    background: rgba(220, 38, 38, 0.08);
}

.app-navbar .navbar-toggler {
    border-color: rgba(15, 23, 42, 0.15);
}

/* Hero: фон-картинка только на больших экранах (не телефон / не планшет) */
.app-hero-bg-wrap {
    border-radius: var(--radius);
    overflow: visible;
}

@media (max-width: 991.98px) {
    .app-hero-bg-wrap {
        background: none !important;
        min-height: 0 !important;
        box-shadow: none !important;
    }

    .app-hero-bg-wrap .app-surface.app-hero {
        background: var(--surface) !important;
        margin: 0 !important;
        border: 1px solid var(--border) !important;
        box-shadow: var(--shadow) !important;
    }
}

@media (min-width: 992px) {
    .app-hero-bg-wrap {
        background-image: url("/static/images/main_back.png");
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        min-height: 400px;
        display: flex;
        align-items: flex-end;
        padding: var(--space-5) var(--space-5);
        padding-bottom: 0;
        margin-bottom: 88px !important;
        box-shadow: var(--shadow);
    }

    .app-hero-bg-wrap .app-surface.app-hero {
        width: 100%;
        margin: 0;
        transform: translateY(36px);
        background: rgba(255, 255, 255, 0.94) !important;
        backdrop-filter: blur(4px);
        border: 1px solid rgba(255, 255, 255, 0.65) !important;
        box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12) !important;
    }
}

.app-page-title {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.app-surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card {
    border-radius: var(--radius) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border) !important;
}

.btn {
    border-radius: 999px !important;
    font-weight: 600 !important;
}

.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: #bfdbfe !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: #fff !important;
    background-color: var(--primary) !important;
}

.app-muted {
    color: var(--muted);
}

.app-auth-wrap {
    min-height: calc(100vh - 180px);
}

.app-auth-card {
    max-width: 520px;
    margin: 0 auto;
}

.app-hero {
    padding: 1.5rem;
}

/* На мобильных поля в колонку — горизонтальный скролл не нужен; на md+ одна строка */
@media (min-width: 768px) {
    .app-hero-search-row {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Одна линия подписей и полей: без align-items-end у row (иначе узкая колонка «Город» визуально уезжает вверх) */
.app-hero-search-row .app-hero-search-label {
    display: block;
    margin-bottom: 0.35rem;
    line-height: 1.25;
    min-height: 1.25rem;
}

.app-hero-search-row .app-hero-search-icon img {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
}

.app-hero-search-row .app-hero-search-control-row {
    min-height: calc(1.5em + 0.5rem + 2px);
}

.app-tour-title {
    font-weight: 700;
}

.app-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.app-form-control,
.form-control,
.form-select {
    border-radius: var(--radius-sm) !important;
    border-color: #cbd5e1 !important;
}

.app-rules {
    line-height: 1.72;
    color: #334155;
}

.app-rules-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.app-profile-shell section.card {
    overflow: hidden;
}

.app-max-logo {
    max-height: 48px;
    width: auto;
    display: block;
}

.form-label.small {
    font-family: "M PLUS Rounded 1c", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 800; /* ExtraBold */
    font-style: normal;
    letter-spacing: -0.01em; /* -1% */
    text-align: center;
    display: block;
    line-height: 1.2;
}

/* Сортировка карточек туров (luxury minimal) */
.app-sort-bar {
    padding: 0.65rem 0 0.35rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.app-sort-label {
    letter-spacing: 0.12em;
    font-size: 0.7rem !important;
}

.app-sort-tabs {
    gap: 0.25rem 0.5rem !important;
}

.app-sort-tab {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 0.875rem;
    padding: 0.35rem 0.5rem 0.5rem;
    margin: 0;
    position: relative;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.app-sort-tab:hover {
    color: var(--text);
}

.app-sort-tab--active {
    color: var(--sort-gold);
    font-weight: 600;
}

.app-sort-tab--active::after {
    content: "";
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.15rem;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--sort-gold-soft), var(--sort-gold), var(--sort-gold-soft), transparent);
    border-radius: 2px;
}

.app-tours-grid {
    transition: opacity 0.22s ease;
}

.app-tours-grid--dim {
    opacity: 0.42;
}

.app-tour-gallery {
    position: relative;
}

.app-tour-gallery-img {
    height: 200px;
    object-fit: cover;
}

.app-tour-card .card-body {
    padding: 0.7rem;
}

.app-tour-card .app-tour-title {
    font-size: 0.92rem;
    line-height: 1.25;
    margin-bottom: 0.45rem;
}

.app-tour-card p.small {
    font-size: 0.77rem;
    line-height: 1.25;
    margin-bottom: 0.35rem !important;
}

.app-tour-card .h6 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem !important;
}

.app-tour-card .btn.btn-sm {
    font-size: 0.74rem;
    padding: 0.28rem 0.5rem;
}

.app-tour-card .app-tour-gallery-img {
    height: 150px;
}

@media (max-width: 991.98px) {
    .app-tour-card .app-tour-gallery-img {
        height: 130px;
    }
}

.app-tour-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.62);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.app-tour-gallery-prev {
    left: 8px;
}

.app-tour-gallery-next {
    right: 8px;
}

/* Блог */
.app-blog-sidebar {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.85);
}

.app-blog-sidebar .form-select {
    width: 100%;
}

/* Колонки сетки блога: иначе flex (Bootstrap .row) не сжимает карточку ниже ширины картинки */
#blogGrid > [class*="col-"] {
    min-width: 0;
}

.app-blog-card {
    max-width: 100%;
    overflow: hidden;
}

.app-blog-card > a.text-decoration-none {
    display: block;
    max-width: 100%;
    overflow: hidden;
}

.app-blog-card-media-wrap {
    width: 100%;
    max-width: 100%;
    height: 180px;
    overflow: hidden;
    background: #e8ecf3;
    border-radius: 0.375rem 0.375rem 0 0;
}

.app-blog-card-media-wrap--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-blog-card-media {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #e8ecf3;
}

.app-blog-card-media--video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #000;
}

.app-blog-content {
    white-space: pre-wrap;
    word-break: break-word;
}

.app-blog-vote-btn.active-like {
    color: #0d6efd;
    font-weight: 600;
}

.app-blog-vote-btn.active-dislike {
    color: #dc3545;
    font-weight: 600;
}

.app-blog-comments-list {
    max-height: 220px;
    overflow-y: auto;
}

.app-blog-comment-input {
    min-width: 0;
}

/* Нижняя полоска: кредит и баннер каталога */
.app-footer {
    margin-top: auto;
    background: #e8eaed;
    border-top: 1px solid #d1d5db;
    padding: 0.45rem 0;
    font-size: 0.8125rem;
    color: #64748b;
}

.app-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
}

.app-footer-credit {
    color: #64748b;
}

.app-footer-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.app-footer-popcat,
.app-footer-vsego,
.app-footer-audi,
.app-footer-ilnk,
.app-footer-kneht,
.app-footer-seotitan {
    display: inline-block;
    line-height: 0;
    flex-shrink: 0;
}

.app-footer-buttons > a:hover {
    opacity: 0.92;
}

.app-footer-legal a {
    color: #64748b;
    text-decoration: underline;
}
.app-footer-legal a:hover {
    color: #475569;
}

/* Авиабилеты */
.avia-hero p a {
    color: #2563eb;
}
.avia-form .opacity-50 {
    opacity: 0.5;
    pointer-events: none;
}
.avia-filters {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.avia-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: box-shadow 0.2s;
}
.avia-card:hover {
    box-shadow: var(--shadow);
}
.avia-logo--ph {
    width: 32px;
    height: 32px;
    background: #e2e8f0;
    border-radius: 6px;
}
