/* ===== ОБЩИЕ ===== */
:root {
    --sand: #F4E8D1;
    --orange: #E88A3A;
    --deep-blue: #1A365D;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Arial, sans-serif; background: #f9f9f9; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* ===== ШАПКА ===== */
.header {
    background: #000080 !important;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header .container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 15px;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.logo-img {
    height: 90px;
    width: auto;
    max-width: 100%;
    display: block;
}
.nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
}
.nav a {
    font-family: 'Ruslan Display', cursive;
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 18px;
    letter-spacing: 1px;
    white-space: nowrap;
}
.nav a:hover { color: var(--orange); }
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}
.header-contacts {
    display: flex;
    align-items: center;
    gap: 15px;
}
.phone-link {
    color: var(--orange);
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.contact-icon {
    color: white;
    font-size: 18px;
    transition: color 0.3s;
}
.contact-icon:hover {
    color: var(--orange);
}
.cart-link {
    color: white;
    font-size: 22px;
    text-decoration: none;
    position: relative;
}
.cart-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--orange);
    color: white;
    font-size: 12px;
    border-radius: 50%;
    padding: 2px 8px;
    font-weight: bold;
}
.user-link {
    color: white;
    font-size: 24px;
    transition: color 0.3s;
}
.user-link:hover {
    color: var(--orange);
}
.burger-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: none;
    padding: 5px;
}
.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 15px;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 10px;
}
.mobile-nav a {
    color: white;
    font-size: 18px;
    text-decoration: none;
    transition: color 0.3s;
}
.mobile-nav a:hover {
    color: var(--orange);
}
.mobile-contacts {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}
.mobile-contacts a {
    color: white;
    font-size: 22px;
}

/* ===== СЛАЙДЕР (внутри контейнера, как герой) ===== */
.slider-wrapper {
    width: 100%;
    margin: 20px 0;
    box-sizing: border-box;
}

.slider-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    border-radius: 12px;
    background: var(--sand);
    box-sizing: border-box;
    min-height: 280px;
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.slide {
    min-width: 100%;
    flex-shrink: 0;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 40px 50px;
}

.slide img {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}

.slide h2 {
    color: var(--deep-blue);
    margin-bottom: 8px;
    font-size: 26px;
    width: 100%;
    max-width: 700px;
}

.slide p {
    color: #333;
    font-size: 16px;
    max-width: 700px;
}

.slide .btn {
    margin-top: 15px;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 128, 0.7);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 10;
    transition: background 0.3s;
}

.slider-btn:hover {
    background: #000080;
}

.slider-btn.prev {
    left: 15px;
}
.slider-btn.next {
    right: 15px;
}

.dots {
    text-align: center;
    margin-top: 12px;
    padding-bottom: 5px;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #ccc;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active {
    background: var(--orange);
}

/* ===== ФУТЕР ===== */
.footer {
    background: #000080;
    color: white;
    padding: 30px 0 15px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 25px;
    text-align: left;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-grid h4 {
    color: var(--orange);
    margin-bottom: 12px;
    font-size: 16px;
}
.footer-grid a {
    color: #ccc;
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
    transition: color 0.3s;
    font-size: 14px;
}
.footer-grid a:hover { color: var(--orange); }
.footer-bottom {
    text-align: center;
    padding-top: 15px;
    font-size: 13px;
    color: #aaa;
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 15px;
}
.btn-primary {
    background: var(--orange);
    color: var(--deep-blue);
}
.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(232, 138, 58, 0.4);
}
.btn-secondary {
    background: var(--deep-blue);
    color: white;
}
.btn-secondary:hover {
    background: var(--orange);
    color: var(--deep-blue);
}
.btn-small {
    background: var(--orange);
    color: var(--deep-blue);
    padding: 7px 16px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
}
.btn-small:hover { opacity: 0.9; }

/* ===== ГЕРОЙ ===== */
.hero {
    background: linear-gradient(135deg, #000080, #1A365D);
    padding: 60px 50px;
    text-align: center;
    color: white;
    border-radius: 12px;
    margin: 15px 0;
}
.hero h1 { font-size: 36px; margin-bottom: 15px; }
.hero p { font-size: 18px; margin-bottom: 25px; opacity: 0.9; }

/* ===== ПРЕИМУЩЕСТВА ===== */
.features { padding: 40px 0; }
.features h2 { text-align: center; color: var(--deep-blue); margin-bottom: 30px; font-size: 28px; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.feature-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}
.feature-card:hover { transform: translateY(-8px); border-bottom: 3px solid var(--orange); }
.feature-card i {
    font-size: 40px;
    color: var(--orange);
    margin-bottom: 15px;
}
.feature-card h3 { color: var(--deep-blue); margin-bottom: 8px; font-size: 18px; }

/* ===== КАРТОЧКИ КВЕСТОВ ===== */
.popular-quests { padding: 40px 0; }
.popular-quests h2 { text-align: center; color: var(--deep-blue); margin-bottom: 30px; font-size: 28px; }
.quest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}
.quest-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.quest-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

/* ===== КАРТИНКИ В КАРТОЧКАХ — БЕЗ ОБРЕЗКИ ===== */
.quest-card .quest-image-wrapper {
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quest-card .quest-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}
.quest-card:hover .quest-image-wrapper img {
    transform: scale(1.02);
}
/* Fallback для старых карточек без обёртки */
.quest-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: contain;
    background: #f0f0f0;
}

.quest-info { padding: 18px; display: flex; flex-direction: column; flex-grow: 1; }
.quest-info h3 { color: var(--deep-blue); margin: 0 0 8px; font-size: 20px; }
.quest-description { color: #555; font-size: 14px; line-height: 1.5; flex-grow: 1; }
.quest-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
    font-size: 12px;
    color: #666;
}
.quest-meta span { background: #f5f5f5; padding: 3px 10px; border-radius: 20px; }
.quest-meta .stars { color: #f5b342; }
.quest-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--orange);
    margin: 8px 0;
}

/* ===== СТРАНИЦА КВЕСТА ===== */
.quest-header {
    background: linear-gradient(135deg, #000080, #1A365D);
    color: white;
    padding: 30px 0;
}
.quest-header h1 { font-size: 30px; }
.quest-meta-full {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 15px;
    margin-top: 12px;
}
.quest-meta-full span {
    background: rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 20px;
}
.price-large {
    font-size: 28px;
    font-weight: bold;
    color: var(--orange);
    margin-top: 8px;
}
.quest-description-full {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
    line-height: 1.7;
    font-size: 15px;
    color: #333;
}
.welcome-box {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
}
.step-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}
.step-card img { max-width: 100%; border-radius: 8px; margin: 10px 0; }
.score-display {
    background: #000080;
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    display: inline-block;
    margin: 15px 0;
    font-size: 16px;
}
.hint-btn {
    background: transparent;
    border: 2px solid var(--orange);
    color: var(--deep-blue);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    margin-right: 8px;
    font-size: 13px;
}
.hint-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.hint-text {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid var(--orange);
}
.fact-box {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 3px solid var(--orange);
    margin: 20px 0;
}
.fact-box img { max-width: 100%; border-radius: 8px; margin: 10px 0; }
.stars { color: #f5b342; font-size: 20px; letter-spacing: 2px; }

/* ===== КАТАЛОГ ===== */
.page-header {
    background: linear-gradient(135deg, #000080, #1A365D);
    color: white;
    padding: 40px 0;
    text-align: center;
}
.page-header h1 { font-size: 32px; }
.catalog { padding: 30px 0; }

/* Фильтры */
.filters {
    background: white;
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}
.filters form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.filter-group {
    flex: 1;
    min-width: 120px;
}
.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}
.filter-group select,
.filter-group input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
}
.filter-group a {
    color: #666;
    text-decoration: none;
    padding: 6px 10px;
    display: inline-block;
    font-size: 13px;
}
.range-inputs {
    display: flex;
    gap: 6px;
    align-items: center;
}
.range-inputs input { width: 44%; padding: 7px 10px; }
.range-inputs span { color: #666; font-size: 13px; }

/* ===== СТРАНИЦЫ (page.php) ===== */
.page-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin: 30px 0;
}
.page-content h1 {
    color: #1A365D;
    margin-bottom: 20px;
    font-size: 32px;
}
.page-content .content-text {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}
.page-content .content-text p {
    margin-bottom: 15px;
}
.page-content .content-text ul,
.page-content .content-text ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

/* ===== СЕО-БЛОК ===== */
.seo-section { padding: 40px 0; background: #f9f9f9; }
.seo-content h2 { color: var(--deep-blue); font-size: 24px; margin-bottom: 15px; }
.seo-content p { font-size: 15px; line-height: 1.7; color: #444; margin-bottom: 12px; }

/* Стили для SEO-текста с HTML-тегами */
.seo-text ul,
.seo-text ol {
    padding-left: 20px;
    margin: 10px 0;
}
.seo-text li {
    margin-bottom: 5px;
}
.seo-text strong,
.seo-text b {
    color: #1A365D;
}
.seo-text p {
    margin-bottom: 12px;
}
.seo-text a {
    color: #E88A3A;
    text-decoration: underline;
}
.seo-text a:hover {
    color: #1A365D;
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    justify-content: center;
    align-items: center;
}
.modal.active {
    display: flex;
}
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.modal-content .close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}
.modal-content .close:hover {
    color: #333;
}
.modal-content h2 {
    color: #1A365D;
    margin-bottom: 20px;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 992px) {
    .header .container { flex-wrap: wrap; gap: 10px; }
    .nav a { font-size: 16px; }
    .phone-link { font-size: 16px; }
    .header-contacts .contact-icon { font-size: 16px; }
}

@media (max-width: 768px) {
    .container { padding: 0 12px; }
    
    .header .container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .header .container > div:first-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    .header-left { gap: 10px; }
    .nav { display: none !important; }
    .burger-btn { display: block !important; }
    .phone-text { display: none; }
    .phone-link { font-size: 16px; }
    .header-contacts .contact-icon { font-size: 16px; }
    .logo-img { height: 50px; }
    .header-right { gap: 12px; }
    .header-contacts { gap: 10px; }
    .mobile-nav { display: none; }
    
    /* Слайдер — мобильная версия */
    .slider-container {
        min-height: 200px;
    }
    
    .slide {
        padding: 25px 20px;
        min-height: 200px;
    }
    
    .slide img {
        max-height: 200px;
        object-fit: contain;
        border-radius: 8px;
    }
    
    .slide h2 {
        font-size: 20px;
    }
    
    .slide p {
        font-size: 14px;
    }
    
    .slider-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .slider-btn.prev {
        left: 8px;
    }
    .slider-btn.next {
        right: 8px;
    }
    
    .dot {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
    
    /* Герой — мобильная версия */
    .hero {
        padding: 40px 25px;
    }
    .hero h1 {
        font-size: 26px;
    }
    .hero p {
        font-size: 16px;
    }
    
    .quest-grid { grid-template-columns: 1fr; gap: 20px; }
    .quest-card .quest-image-wrapper { aspect-ratio: 16 / 9; }
    .quest-card img { aspect-ratio: 16 / 9; }
    .quest-info h3 { font-size: 18px; }
    .quest-price { font-size: 22px; }
    
    .filters form { flex-direction: column; gap: 10px; }
    .filter-group { min-width: 100%; }
    .range-inputs input { width: 46%; }
    .filter-group a { display: inline-block; margin-top: 5px; }
    
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 15px; }
    .footer-grid h4 { font-size: 14px; }
    .footer-grid a { font-size: 13px; }
    .footer-bottom { font-size: 12px; }
    
    .quest-header h1 { font-size: 24px; }
    .quest-meta-full { font-size: 13px; gap: 10px; }
    .price-large { font-size: 24px; }
    .quest-description-full { padding: 18px; font-size: 14px; }
    .step-card { padding: 18px; }
    .step-card p { font-size: 16px; }
    
    .btn { padding: 8px 20px; font-size: 14px; }
    .btn-small { padding: 6px 14px; font-size: 12px; }
    
    .page-header { padding: 30px 0; }
    .page-header h1 { font-size: 26px; }
    .features h2 { font-size: 24px; }
    .popular-quests h2 { font-size: 24px; }
    .seo-content h2 { font-size: 20px; }
    .page-content { padding: 20px; margin: 15px 0; }
    .page-content h1 { font-size: 26px; }
}

@media (max-width: 480px) {
    .logo-img { height: 40px; }
    .header-contacts .contact-icon { font-size: 14px; }
    .header-right { gap: 8px; }
    .header-contacts { gap: 8px; }
    .nav a { margin: 0 6px; font-size: 14px; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-grid a { text-align: center; }
    
    /* Слайдер — очень маленькие экраны */
    .slider-container {
        min-height: 160px;
    }
    
    .slide {
        padding: 15px 15px;
        min-height: 160px;
    }
    
    .slide img {
        max-height: 150px;
    }
    
    .slide h2 {
        font-size: 17px;
    }
    
    .slide p {
        font-size: 13px;
    }
    
    .slider-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .slider-btn.prev {
        left: 5px;
    }
    .slider-btn.next {
        right: 5px;
    }
    
    /* Герой — очень маленькие экраны */
    .hero {
        padding: 30px 15px;
    }
    .hero h1 {
        font-size: 22px;
    }
    .hero p {
        font-size: 14px;
    }
    
    .mobile-nav a { font-size: 16px; }
    .mobile-contacts { justify-content: center; }
}
/* Сохраняем переносы строк в описаниях квестов */
.quest-description {
    white-space: pre-wrap;
    word-wrap: break-word;
}