/* ============================================================
 * RealBorneo — Common (общий для всего сайта)
 * /wp-content/mu-plugins/common-styles.css
 * Палитра: #0d2b45 (тёмно-синий), #e8c46a (золотой)
 * ============================================================ */

:root {
    --rb-navy: #0d2b45;
    --rb-navy-dark: #1a3a6b;
    --rb-navy-light: #25498e;
    --rb-navy-hover: #2d5aae;
    --rb-gold: #e8c46a;
    --rb-gold-hover: #d4ad4d;
    --rb-gold-light: #f0d183;
    --rb-text: #1d1d1d;
    --rb-text-muted: #5a6b7d;
    --rb-border: #eef2f5;
}

/* ==========================================================================
   1. БАЗОВЫЕ НАСТРОЙКИ — скрываем мобильные элементы на десктопе
   ========================================================================== */
.mobile-logo-wrapper,
.mobile-menu-wrapper,
.mobile-mail-wrapper,
.rb-filter-toggle {
    display: none;
}

/* ==========================================================================
   2. КНОПКА «ФИЛЬТРЫ» — общая для туров и отелей
   ========================================================================== */
@media (max-width: 991px) {
    .rb-filter-toggle {
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        position: fixed;
        top: 280px;
        left: 1px;
        z-index: 4001;
        background: var(--rb-navy-light);
        color: #fff;
        border: none;
        padding: 8px 14px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.4px;
        text-transform: uppercase;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
        transition: top 0.3s ease, background 0.2s, transform 0.2s;
        font-family: inherit;
    }
    .rb-filter-toggle.is-scrolled { top: 1px; }
    .rb-filter-toggle:hover       { background: var(--rb-navy-dark); }
    .rb-filter-toggle:active      { transform: scale(0.96); }
    .rb-filter-toggle.is-active   { background: var(--rb-navy-dark); }
}

/* ==========================================================================
   3. OVERLAY (затемнение под выезжающие панели)
   ========================================================================== */
.rb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13, 43, 69, 0.5);
    z-index: 9997;
    opacity: 0;
    transition: opacity 0.3s;
}
.rb-overlay.is-visible {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   3.1. ВЫЕЗЖАЮЩАЯ ПАНЕЛЬ (база — туры и отели переопределяют)
   ========================================================================== */
@media (max-width: 991px) {
    .rb-filter-panel {
        position: fixed;
        top: 50px;
        left: 0;
        height: calc(100vh - 50px);
        width: 320px;
        max-width: 85vw;
        z-index: 9998;
        background: #fff;
        border-radius: 0;
        padding: 24px 20px;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(13, 43, 69, 0.2);
    }
    .rb-filter-panel.is-open {
        transform: translateX(0);
    }
    body.rb-filter-open {
        overflow: hidden;
    }
}

/* ==========================================================================
   4. БАННЕР (#page-header) — вуаль, тень, штамп на главной
   ========================================================================== */
#site-content #page-header { position: relative; }
#site-content #page-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(13, 43, 69, 0.4);
    z-index: 1;
    pointer-events: none;
}
#site-content #page-header .wrapper { position: relative; z-index: 2; }
#site-content #page-header .title,
#site-content #page-header .page-title,
#site-content #page-header h2.title {
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.5), 0 8px 16px rgba(0, 0, 0, 0.4) !important;
    font-weight: 700 !important;
}

/* Штамп на главной */
.home #page-header { position: relative; }
.home #page-header::after {
    content: "Борнео Без Посредников";
    position: absolute;
    top: 40px;
    right: 40px;
    padding: 14px 28px;
    border: 3px solid var(--rb-gold);
    border-radius: 6px;
    color: var(--rb-gold);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transform: rotate(-12deg);
    background: rgba(13, 43, 69, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 0 12px rgba(232, 196, 106, 0.25);
    pointer-events: none;
    z-index: 20;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    opacity: 0.92;
}

/* ==========================================================================
   5. ХЛЕБНЫЕ КРОШКИ (общие для single-hotel / single-tour)
   ========================================================================== */
   
 /* Прячем крошки на главной */
.home #page-breadcrumbs,
.home .breadcrumb-trail {
    display: none !important;
}

.rb-breadcrumbs {
    font-size: 13px;
    color: var(--rb-text-muted);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.rb-breadcrumbs a {
    color: var(--rb-navy);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.rb-breadcrumbs a:hover { border-color: var(--rb-gold); }
.rb-breadcrumbs__sep { color: #b0b8c1; }
.rb-breadcrumbs__current { color: var(--rb-navy); font-weight: 600; }

/* ==========================================================================
   6. ПАГИНАЦИЯ (общая)
   ========================================================================== */
.rb-blog-pagination-wrap { text-align: center; margin-bottom: 60px; }
.rb-blog-pagination-wrap .navigation .page-numbers {
    display: inline-block;
    padding: 10px 16px;
    margin: 0 4px;
    background: #fff;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid #eaeaea;
    transition: all 0.2s ease;
}
.rb-blog-pagination-wrap .navigation .page-numbers.current,
.rb-blog-pagination-wrap .navigation .page-numbers:hover {
    background: var(--rb-gold);
    color: var(--rb-text);
    border-color: var(--rb-gold);
}

/* ==========================================================================
   7. ОБЩИЕ КОМПОНЕНТЫ — CF7, БЛОГ, FAQ
   ========================================================================== */

/* --- 7.1. Contact Form 7 --- */
.rb-cf7 { display: flex; flex-direction: column; gap: 18px; }
.rb-cf7__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rb-cf7__row:has(.rb-cf7__col:only-child),
.rb-cf7__row:has(.rb-cf7__col:nth-child(1):last-child) { grid-template-columns: 1fr; }
.rb-cf7__label { display: block; font-size: 13px; font-weight: 700; color: #0d2b45; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.rb-cf7 input[type="text"],
.rb-cf7 input[type="tel"],
.rb-cf7 input[type="email"],
.rb-cf7 select,
.rb-cf7 textarea {
    width: 100%; padding: 14px 16px; border: 1px solid #d5dde8; border-radius: 10px;
    font-size: 15px; font-family: inherit; background: #fff; color: #333;
    box-sizing: border-box; transition: border-color .2s ease, box-shadow .2s ease;
}
.rb-cf7 input:focus,
.rb-cf7 select:focus,
.rb-cf7 textarea:focus { outline: none; border-color: #2d5aae; box-shadow: 0 0 0 3px rgba(45,90,174,.15); }
.rb-cf7 textarea { resize: vertical; }
.rb-cf7__submit { text-align: center; margin-top: 6px; }
.rb-cf7 input[type="submit"] {
    display: inline-block; padding: 16px 40px; border-radius: 10px; font-weight: 700; font-size: 16px; line-height: 1; text-align: center;
    background: #e8c46a; color: #0d2b45; border: none; cursor: pointer; box-shadow: 0 8px 20px rgba(232,196,106,.35); font-family: inherit;
    transition: all .2s ease; height: auto; min-height: unset; vertical-align: middle;
}
.rb-cf7 input[type="submit"]:hover { background: #f0d183; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(232,196,106,.45); }
.rb-cf7__note { font-size: 13px; color: #999; text-align: center; margin: 0; }
.wpcf7-response-output { border-radius: 10px !important; margin: 16px 0 0 !important; padding: 12px 16px !important; border-color: #2d5aae !important; }
.wpcf7-not-valid-tip { color: #c5221f !important; font-size: 13px !important; margin-top: 4px; }

/* --- 7.2. Блог --- */
.rb-blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 30px; margin-bottom: 50px; }
.rb-blog-card {
    background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 20px rgba(13, 43, 69, 0.06);
    display: flex; flex-direction: column; transition: transform 0.3s ease, box-shadow 0.3s ease; border: 1px solid #f0f0f0;
}
.rb-blog-card:hover { transform: translateY(-6px); box-shadow: 0 18px 35px rgba(13, 43, 69, 0.12); }
.rb-blog-card__cover { display: block; height: 220px; overflow: hidden; position: relative; background: #e9eef8; }
.rb-blog-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.rb-blog-card:hover .rb-blog-card__cover img { transform: scale(1.05); }
.rb-blog-card__body { padding: 24px; display: flex; flex-direction: column; flex-grow: 1; }
.rb-blog-card__meta { font-size: 13px; color: #999; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.rb-blog-card__title { font-size: 20px; line-height: 1.3; margin: 0 0 12px 0; font-weight: 700; font-family: 'Trebuchet MS', Arial, sans-serif; }
.rb-blog-card__title a { color: #0d2b45; text-decoration: none; transition: color 0.2s ease; }
.rb-blog-card__title a:hover { color: #2d5aae; }
.rb-blog-card__excerpt { font-size: 15px; color: #666; line-height: 1.6; margin-bottom: 20px; flex-grow: 1; }
.rb-blog-card__btn {
    display: inline-block; align-self: flex-start; background: #e8c46a; color: #1d1d1d !important;
    font-weight: 700; font-size: 14px; padding: 10px 20px; border-radius: 8px;
    text-decoration: none; transition: background 0.2s ease, color 0.2s ease; margin-top: auto;
}
.rb-blog-card__btn:hover { background: #25498e; color: #ffffff !important; }

/* --- 7.3. FAQ --- */
.rb-faq-wrap { max-width: 860px; margin: 0 auto; padding: 20px 0; }
.rb-faq-head h2 { font-family: 'Trebuchet MS', Arial, sans-serif; color: #0d2b45; font-size: 32px; text-align: center; margin-bottom: 30px; }
.rb-faq-list { display: flex; flex-direction: column; gap: 15px; }
.rb-faq-item { background: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(13,43,69,.05); border: 1px solid #f0f0f0; overflow: hidden; transition: box-shadow 0.3s ease; }
.rb-faq-item[open] { box-shadow: 0 8px 25px rgba(13,43,69,.08); border-color: #e8c46a; }
.rb-faq-question {
    display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; font-family: 'Trebuchet MS', Arial, sans-serif;
    font-weight: 700; font-size: 17px; color: #0d2b45; cursor: pointer; list-style: none; position: relative; transition: color 0.2s ease;
}
.rb-faq-question::-webkit-details-marker { display: none; }
.rb-faq-question:hover { color: #2d5aae; }
.rb-faq-question::after { content: "+"; font-size: 24px; color: #e8c46a; font-weight: 400; transition: transform 0.3s ease; line-height: 1; }
.rb-faq-item[open] .rb-faq-question::after { content: "−"; transform: rotate(180deg); }
.rb-faq-answer { padding: 0 24px 20px 24px; color: #555; font-size: 15px; line-height: 1.7; border-top: 1px dashed #eee; padding-top: 15px; }
.rb-faq-answer p { margin-bottom: 12px; }
.rb-faq-answer p:last-child { margin-bottom: 0; }

/* ==========================================================================
   8. МОБИЛЬНАЯ ШАПКА И МЕНЮ (общие)
   ========================================================================== */
@media (max-width: 991px) {
    #masthead { display: none !important; }
    #headerbar {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 3001 !important;
        background: var(--rb-navy-light) !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    }
    #headerbar .wrapper {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 15px !important;
        max-width: 100% !important;
        width: 100% !important;
        height: 50px !important;
    }
    body { padding-top: 50px !important; }
    #headerbar .custom-info,
    #headerbar .top-navigator,
    #headerbar .social-links { display: none !important; }

    .mobile-logo-wrapper { display: block !important; flex-shrink: 0; }
    .mobile-logo-wrapper img { height: 40px; width: 40px; object-fit: contain; display: block; }
    .mobile-mail-wrapper { display: block !important; flex-shrink: 0; }
    .mobile-mail-wrapper a { color: #ffffff !important; font-size: 20px; display: block; padding: 5px; }
    .mobile-menu-wrapper { display: block !important; flex-grow: 1; text-align: center; }
    .mobile-menu-wrapper #site-navigator-mobile { display: block !important; background: transparent !important; width: 100% !important; }
    .mobile-menu-wrapper .navigator-toggle { display: none !important; }
    .mobile-menu-wrapper .menu {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center;
        align-items: center;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        list-style: none;
        width: 100%;
    }
    .mobile-menu-wrapper .menu > li {
        display: inline-block !important;
        margin: 0 !important;
        padding: 0 !important;
        position: relative;
        flex-shrink: 1;
    }
    .mobile-menu-wrapper .menu > li > a {
        color: #ffffff !important;
        line-height: 50px !important;
        padding: 0 12px !important;
        font-size: 12px !important;
        text-transform: uppercase;
        display: block !important;
        text-decoration: none;
        white-space: nowrap;
    }
    .mobile-menu-wrapper .menu > li > .sub-menu {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        background: var(--rb-navy-dark) !important;
        min-width: 180px;
        z-index: 99999 !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        padding: 0 !important;
        margin: 0 !important;
    }
    .mobile-menu-wrapper .menu > li.active > .sub-menu,
    .mobile-menu-wrapper .menu > li:hover > .sub-menu { display: block !important; }
    .mobile-menu-wrapper .menu > li > .sub-menu a {
        color: #ffffff !important;
        padding: 10px 15px !important;
        font-size: 12px !important;
        text-transform: none;
        display: block !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    }
    .mobile-menu-wrapper .toggler { display: none !important; }

    /* Баннер на мобилке */
    #site-content #page-header {
        height: 200px !important;
        min-height: 200px !important;
        background-position: center bottom !important;
    }
    #site-content #page-header .page-title { padding-bottom: 20px !important; }

    /* Блог и FAQ на мобилке */
    .rb-blog-grid { grid-template-columns: 1fr; }
    .rb-blog-card__cover { height: 200px; }
    .rb-faq-question { padding: 16px 18px; font-size: 15px; }
    .rb-faq-answer { padding: 0 18px 18px 18px; font-size: 14px; }
    .rb-faq-head h2 { font-size: 24px; }
}

@media (max-width: 992px) {
    .rb-blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .rb-cf7__row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   9. ПЛАНШЕТНЫЕ ФИКСЫ HERO-БЛОКОВ (общие)
   ========================================================================== */
@media (max-width: 992px) {
    .home .rb-hero,
    div[style*="min-height: 560px"] {
        min-height: 480px !important;
        padding: 60px 20px !important;
    }
    h1[style*="font-size: 46px"] { font-size: 36px !important; }
    div[style*="grid-template-columns: repeat(4,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    div[style*="grid-template-columns: repeat(3,1fr)"][style*="text-align: left"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    div[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

/* ==========================================================================
   10. МОБИЛЬНЫЕ ФИКСЫ ИНЛАЙН-СТИЛЕЙ (главная / о нас / контакты)
   ========================================================================== */
@media (max-width: 991px) {
    div[style*="min-height: 560px"] { min-height: auto !important; padding: 50px 15px !important; }
    h1[style*="font-size: 46px"] { font-size: 28px !important; margin-bottom: 15px !important; line-height: 1.2 !important; }
    p[style*="font-size: 18px; color: rgba(255,255,255,.9)"] { font-size: 15px !important; margin-bottom: 25px !important; }
    div[style*="display: flex; justify-content: center; align-items: center; flex-wrap: nowrap; gap: 12px;"] { flex-wrap: wrap !important; flex-direction: column !important; gap: 10px !important; }
    div[style*="display: flex; justify-content: center; align-items: center; flex-wrap: nowrap; gap: 12px;"] a { width: 100% !important; text-align: center !important; box-sizing: border-box !important; padding: 12px 20px !important; }
    div[style*="padding: 80px 20px"],
    div[style*="padding: 90px 20px"] { padding: 40px 15px !important; }
    h2[style*="font-size: 34px"] { font-size: 24px !important; margin-bottom: 15px !important; }
    p[style*="font-size: 17px"] { font-size: 15px !important; }
    div[style*="grid-template-columns: repeat(4,1fr)"],
    div[style*="grid-template-columns: repeat(2, 1fr)"] { grid-template-columns: 1fr !important; gap: 15px !important; }
    div[style*="border-top: 4px solid #e8c46a"] { padding: 20px 15px !important; }
    h3[style*="font-size: 18px"] { font-size: 16px !important; }
    div[style*="grid-template-columns: 1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
    a[href="/about-us/"] { display: block !important; text-align: center !important; margin-top: 15px !important; }
    div[style*="grid-template-columns: repeat(3,1fr)"][style*="text-align: left"] { grid-template-columns: 1fr !important; gap: 15px !important; }
    div[style*="text-align: center; margin-top: 40px;"] a,
    div[style*="margin-top: 40px;"] a { display: block !important; width: 100% !important; box-sizing: border-box !important; text-align: center !important; }

    div[style*="padding: 110px 20px 90px"],
    div[style*="padding: 110px 20px 60px"] { padding: 50px 15px !important; }
    p[style*="font-size: 18px"] { font-size: 15px !important; }
    div[style*="padding: 80px 20px 40px"],
    div[style*="padding: 40px 20px 80px"],
    div[style*="padding: 80px 20px"] { padding: 40px 15px !important; }
    div[style*="max-width: 720px; margin: 0 auto; background: #f5f7fa"],
    div[style*="max-width: 980px; margin: 0 auto;"] { padding: 25px 20px !important; }
    div[style*="display: grid"] { grid-template-columns: 1fr !important; gap: 15px !important; }
    h2[style*="font-size: 30px"],
    h2[style*="font-size: 28px"] { font-size: 22px !important; }
    button[type="submit"],
    input[type="submit"] { width: 100% !important; box-sizing: border-box !important; }
    iframe { height: 300px !important; }
    div[style*="font-size: 48px"] { font-size: 32px !important; }
    a[href="/contacts/"] { display: block !important; width: 100% !important; text-align: center !important; box-sizing: border-box !important; }

    div[style*="grid-template-columns: repeat(4,1fr)"]:not(.rb-how-it-works-grid) {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    div.rb-how-it-works-grid[style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* Мобильные настройки баннера */
@media (max-width: 768px) {
    #page-header .title,
    #page-header .page-title,
    #page-header h2.title {
        font-size: 20px !important;
        line-height: 1.2 !important;
        padding: 0 10px !important;
        margin: 0 !important;
        max-width: 100% !important;
        text-align: center !important;
    }
    .home #page-header::after {
        top: 100px;
        right: 15px;
        padding: 8px 16px;
        font-size: 12px;
        border-width: 2px;
        transform: rotate(-10deg);
    }
}
