/* Бургер-меню и мобильная вёрстка */

.navbar-topbar {
    display: none;
}

.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 140;
    flex-shrink: 0;
}

.burger-btn span {
    display: block;
    width: 26px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.burger-btn.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.burger-btn.open span:nth-child(2) {
    opacity: 0;
}

.burger-btn.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 110;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

body.menu-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    .menu-overlay {
        display: block;
    }

    .burger-btn {
        display: flex;
    }

    .navbar-topbar {
        display: flex;
    }

    /* ——— Шапка и навигация ——— */
    .navbar {
        position: sticky !important;
        top: 0;
        z-index: 130 !important;
        height: 64px !important;
        min-height: 64px !important;
        margin-bottom: 0 !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 12px !important;
        box-sizing: border-box;
    }

    .navbar-bg {
        height: 64px !important;
    }

    .navbar-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 64px;
        position: relative;
        z-index: 135;
        pointer-events: none;
    }

    .navbar-topbar .navbar-logo,
    .navbar-topbar .burger-btn {
        pointer-events: auto;
    }

    .navbar-topbar .navbar-logo {
        height: 48px !important;
        width: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .navbar-topbar .navbar-logo img {
        width: 42px !important;
        height: 42px !important;
        max-width: 42px !important;
        max-height: 42px !important;
    }

    .navbar-inner {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        bottom: 0 !important;
        width: min(300px, 88vw) !important;
        max-width: none !important;
        height: 100vh !important;
        min-height: 100vh !important;
        margin: 0 !important;
        padding: 88px 20px 32px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        background: rgba(16, 16, 16, 0.98) !important;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 120 !important;
        overflow-y: auto;
        gap: 0 !important;
        border-radius: 0 !important;
        pointer-events: none;
    }

    .navbar-inner.open {
        transform: translateX(0);
        pointer-events: auto;
    }

    .navbar-inner a {
        position: relative;
        z-index: 1;
        pointer-events: auto;
    }

    .navbar-left,
    .navbar-right {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        margin: 0 !important;
        gap: 4px !important;
    }

    .navbar a {
        display: block !important;
        width: 100% !important;
        min-width: unset !important;
        font-size: 1.2rem !important;
        line-height: 1.35 !important;
        padding: 14px 16px !important;
        text-align: left !important;
        margin: 0 !important;
        border-radius: 8px;
        white-space: normal !important;
    }

    .navbar a:hover {
        background: rgba(255, 255, 255, 0.08) !important;
    }

    /* ——— Заголовки страниц ——— */
    .header {
        height: auto !important;
        min-height: 42vh;
    }

    .header-content {
        height: auto !important;
        min-height: unset !important;
        margin-top: 12px !important;
        margin-left: 0 !important;
        padding: 12px 20px 28px !important;
        box-sizing: border-box;
        align-items: center !important;
        text-align: center !important;
    }

    .header-title {
        font-size: clamp(1.6rem, 6.5vw, 2.4rem) !important;
        line-height: 1.25 !important;
        margin-bottom: 12px !important;
        padding: 0 8px;
        text-align: center !important;
    }

    .header-subtitle {
        font-size: clamp(1rem, 4vw, 1.3rem) !important;
        line-height: 1.35 !important;
        margin-bottom: 20px !important;
        padding: 0 8px;
        text-align: center !important;
    }

    .header-btn {
        font-size: 1rem !important;
        padding: 12px 28px !important;
    }

    /* ——— Главная ——— */
    .features {
        flex-direction: column;
        align-items: center;
        gap: 18px;
        padding: 24px 16px;
    }

    .feature-item {
        width: 100%;
        max-width: 300px;
    }

    .feature-item span {
        font-size: 1.1rem;
        min-width: unset;
    }

    .lovers-title,
    .masterclass-title,
    .delivery-title,
    .map-title,
    .welcome-title,
    .lovers-title {
        font-size: clamp(1.8rem, 7vw, 2.6rem) !important;
        margin-bottom: 24px !important;
        padding: 0 16px;
        line-height: 1.2 !important;
    }

    .masterclass-subtitle {
        font-size: clamp(1.2rem, 4.5vw, 1.6rem) !important;
    }

    .lovers-list,
    .masterclass-cards,
    .delivery-cards {
        flex-direction: column !important;
        align-items: center !important;
        gap: 24px !important;
        padding: 0 16px;
    }

    .lover-card,
    .masterclass-card,
    .delivery-card {
        width: 100% !important;
        max-width: 340px !important;
        height: auto !important;
        min-height: unset !important;
    }

    .lover-card-title,
    .masterclass-card-title {
        font-size: 1.4rem !important;
    }

    .lover-card-price,
    .delivery-card-title {
        font-size: 1.1rem !important;
    }

    .welcome-desc,
    .masterclass-card-desc,
    .delivery-card-desc {
        font-size: 1.05rem !important;
        line-height: 1.45 !important;
        padding: 0 16px;
    }

    .welcome-note {
        font-size: 0.95rem !important;
        padding: 0 16px;
    }

    .map-container iframe {
        width: calc(100% - 32px) !important;
        max-width: 100% !important;
        height: 260px !important;
    }

    /* ——— Праздник ——— */
    .about-inner {
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
        padding: 0 16px !important;
    }

    .about-img img {
        width: 100% !important;
        max-width: 360px !important;
        height: auto !important;
    }

    .about-title {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        text-align: center;
    }

    .about-main,
    .about-desc {
        font-size: 1.05rem !important;
        line-height: 1.45 !important;
        text-align: center;
    }

    .advantages-title,
    .order-process-title,
    .packaging-title,
    .order-form-title {
        font-size: clamp(1.5rem, 5.5vw, 2rem) !important;
        padding: 0 16px;
        text-align: center;
    }

    .advantages-list {
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
        padding: 0 16px;
    }

    .advantage-item {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        width: 100%;
        max-width: 320px;
    }

    .advantage-title {
        font-size: 1.2rem !important;
    }

    .advantage-desc {
        font-size: 1rem !important;
    }

    .order-process-list {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
        padding: 0 16px;
    }

    .order-process-list::before {
        display: none;
    }

    .order-step {
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 12px;
        width: 100%;
    }

    .order-step-title {
        font-size: 1.15rem !important;
    }

    .order-step-desc {
        font-size: 1rem !important;
    }

    .packaging-steps {
        flex-direction: column !important;
        align-items: center !important;
        gap: 16px !important;
    }

    .packaging-arrow {
        transform: rotate(90deg);
        font-size: 1.5rem;
    }

    .order-form,
    .ask-form {
        width: calc(100% - 32px) !important;
        max-width: 400px;
        margin: 0 auto;
        padding: 0 16px;
        box-sizing: border-box;
    }

    .order-form input,
    .order-form textarea,
    .ask-form input,
    .ask-form textarea {
        font-size: 16px !important;
        width: 100%;
        box-sizing: border-box;
    }

    .order-form-subtitle {
        font-size: 1rem !important;
        padding: 0 16px;
    }

    /* ——— Вопросы ——— */
    .faq-title,
    .ask-form-title {
        font-size: clamp(1.4rem, 5vw, 1.8rem) !important;
        padding: 0 16px;
        text-align: center;
    }

    .faq-block,
    .ask-form-block {
        padding-left: 16px;
        padding-right: 16px;
    }

    .faq-question {
        font-size: 1.05rem !important;
        line-height: 1.35 !important;
    }

    .faq-answer {
        font-size: 1rem !important;
        line-height: 1.45 !important;
    }

    /* ——— Каталог ——— */
    .catalog-section {
        padding: 32px 0 48px !important;
    }

    .catalog-filters {
        padding: 0 12px;
        gap: 8px;
    }

    .filter-btn {
        font-size: 0.95rem;
        padding: 8px 14px;
    }

    .catalog-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 12px;
    }

    .catalog-card-title {
        font-size: 1.35rem !important;
    }

    .catalog-card-desc {
        font-size: 1rem !important;
    }

    /* ——— Админка ——— */
    .admin-section {
        padding: 24px 0 40px !important;
    }

    .admin-tabs {
        flex-wrap: wrap;
        gap: 8px;
        padding: 0 12px;
    }

    .tab-btn {
        font-size: 0.95rem !important;
        padding: 8px 14px !important;
    }

    .tab-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
        padding: 0 12px;
    }

    .tab-header h2 {
        font-size: 1.3rem !important;
    }

    .admin-container {
        padding: 0 8px;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        font-size: 0.85rem;
        min-width: 600px;
    }

    .admin-table th,
    .admin-table td {
        padding: 6px 8px !important;
        font-size: 0.85rem !important;
    }

    .modal-content {
        width: calc(100% - 24px) !important;
        max-width: 100% !important;
        margin: 12px;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* ——— Профиль и авторизация ——— */
    body:not(.profile-layout) {
        align-items: flex-start !important;
        padding: 16px 0;
    }

    body.profile-layout .header {
        min-height: 180px !important;
        padding-bottom: 24px !important;
    }

    body.profile-layout .header-content {
        margin-left: 0 !important;
        align-items: center !important;
    }

    body.profile-layout .header-title {
        font-size: 2rem !important;
        text-align: center !important;
    }

    .profile-main-inner,
    .profile-layout .page-container {
        padding: 24px 16px 40px !important;
        max-width: 100% !important;
    }

    .orders-list,
    .quests-list {
        flex-direction: column !important;
    }

    .order-card,
    .quest-card {
        flex: 1 1 100% !important;
    }

    .profile-text {
        font-size: 1rem !important;
    }

    .profile-order-title {
        font-size: 1.6rem !important;
    }

    .order-card {
        padding: 16px !important;
    }

    h2,
    .auth-block__title {
        font-size: 2.2rem !important;
    }

    .form-input {
        font-size: 16px !important;
        padding: 12px !important;
    }

    .form-label {
        font-size: 1rem !important;
    }

    .auth-button {
        font-size: 1rem !important;
        padding: 12px !important;
    }

    .page-container {
        padding: 16px !important;
    }

    /* ——— Поддержка / чат ——— */
    .chat-section {
        padding: 24px 0 40px !important;
    }

    .chat-container {
        margin: 0 12px !important;
        border-radius: 12px !important;
    }

    .chat-messages {
        height: 50vh !important;
        min-height: 280px;
    }

    .message {
        max-width: 92% !important;
    }

    .message-content {
        font-size: 0.95rem !important;
    }

    .chat-input-area {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .chat-input-area textarea,
    .chat-input-area button {
        width: 100% !important;
        font-size: 16px !important;
    }

    /* ——— Подвал ——— */
    .footer {
        font-size: 1rem !important;
        padding: 20px 0 !important;
    }

    .footer-inner {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 16px !important;
        padding: 0 16px !important;
    }

    .footer-logo {
        align-self: center !important;
    }

    .footer-logo img {
        width: 72px !important;
        height: 72px !important;
    }

    .footer-center {
        font-size: 0.95rem !important;
    }

    .footer-info {
        font-size: 0.95rem !important;
    }

    .footer-contacts {
        padding-right: 0 !important;
        justify-content: center;
    }

    .footer-icon img {
        width: 44px !important;
        height: 44px !important;
    }
}
