/* ============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ - УЛУЧШЕННАЯ ВЕРСИЯ
   ============================================ */

/* Мобильное меню шагов */
.mobile-steps-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
}

.mobile-step-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-step-number {
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, rgb(250, 201, 201) 0%, rgb(245, 180, 180) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-step-label {
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    letter-spacing: 1px;
}

.mobile-menu-toggle {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #000000;
}

.mobile-menu-toggle:active {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(0.95);
}

.mobile-steps-nav {
    display: none;
    flex-direction: column;
    padding: 0 20px 20px;
    gap: 8px;
}

.mobile-steps-nav.active {
    display: flex;
}

.mobile-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-step-item:active {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(0.98);
}

.mobile-step-item.active {
    background: rgba(102, 126, 234, 0.1);
}

.mobile-step-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cccccc;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mobile-step-item.active .mobile-step-bullet {
    background: #667eea;
    width: 12px;
    height: 12px;
}

.mobile-step-text {
    font-size: 14px;
    font-weight: 600;
    color: #666666;
    letter-spacing: 0.5px;
}

.mobile-step-item.active .mobile-step-text {
    color: #000000;
}

/* Улучшенная адаптация для планшетов */
@media (max-width: 968px) {
    .mobile-steps-menu {
        display: block;
    }

    .app-wrapper {
        grid-template-columns: 1fr;
        padding-top: 73px; /* Высота мобильного меню */
    }

    .main-content {
        padding: 30px 20px 100px !important;
        min-height: calc(100vh - 73px);
    }

    .step-title {
        font-size: 36px !important;
        margin-bottom: 30px;
        line-height: 1.2;
        text-align: center;
    }

    /* Адаптация карточки сертификата */
    .step1-certificate-wrapper {
        max-width: 100% !important;
        padding: 0 10px;
    }

    .step1-certificate-wrapper .certificate-card-preview {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        transform: scale(0.85);
        transform-origin: center;
    }

    .design-carousel {
        min-height: 400px;
        gap: 10px;
        padding: 20px 10px;
    }

    .carousel-btn {
        width: 48px;
        height: 48px;
        font-size: 26px;
        z-index: 100;
    }

    /* Палитра цветов */
    .color-palette {
        gap: 12px !important;
        justify-content: center;
        flex-wrap: wrap;
    }

    .color-swatch {
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
    }

    /* Дизайн опции */
    .design-option {
        width: 60px !important;
        height: 60px !important;
        font-size: 28px !important;
    }

    .design-carousel-dots {
        gap: 8px;
        margin-top: 20px;
    }

    .design-dot {
        width: 10px;
        height: 10px;
    }
}

/* Улучшенная адаптация для мобильных телефонов */
@media (max-width: 600px) {
    .app-wrapper {
        padding-top: 70px;
    }

    .main-content {
        padding: 20px 16px 100px !important;
    }

    .step-title {
        font-size: 28px !important;
        margin-bottom: 24px;
        line-height: 1.2;
        padding: 0 10px;
    }

    .mobile-step-number {
        font-size: 28px;
    }

    .mobile-step-label {
        font-size: 12px;
    }

    /* Карточка сертификата для мобильных */
    .step1-certificate-wrapper .certificate-card-preview {
        transform: scale(0.75);
    }

    .design-carousel {
        min-height: 320px;
        gap: 8px;
        padding: 15px 5px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    /* Палитра цветов для мобильных */
    .color-palette {
        gap: 10px !important;
    }

    .color-swatch {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
    }

    /* Дизайн опции для мобильных */
    .design-option {
        width: 50px !important;
        height: 50px !important;
        font-size: 24px !important;
    }

    /* Номинал - радиальное меню */
    .amount-selection-layout {
        gap: 30px !important;
    }

    .radial-menu {
        width: 280px !important;
        height: 280px !important;
    }

    .selected-amount-value {
        font-size: 36px !important;
    }

    .amount-option {
        width: 70px !important;
        height: 70px !important;
        font-size: 16px !important;
    }

    /* Формы ввода */
    .form-group {
        margin-bottom: 20px;
    }

    .form-input,
    .form-textarea {
        font-size: 16px !important; /* Предотвращает зум на iOS */
        padding: 14px 16px !important;
        border-radius: 12px;
    }

    /* Кнопки */
    .next-btn {
        width: 70px !important;
        height: 70px !important;
        bottom: 20px !important;
        right: 20px !important;
        font-size: 12px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .btn-primary,
    .btn-secondary {
        padding: 16px 24px !important;
        font-size: 16px !important;
        min-height: 52px;
        -webkit-tap-highlight-color: transparent;
    }

    /* Опции срока действия */
    .validity-options {
        gap: 12px !important;
    }

    .validity-option {
        padding: 16px !important;
        font-size: 15px !important;
    }

    /* Подтверждение */
    .confirmation-certificate {
        transform: scale(0.9);
        margin: 20px auto;
    }

    .card-text-preview {
        font-size: 40px !important;
        letter-spacing: 2px !important;
    }

    /* Кнопка закрытия */
    .close-btn {
        top: 16px !important;
        right: 16px !important;
        width: 38px !important;
        height: 38px !important;
        font-size: 24px !important;
        z-index: 1001;
    }

    /* Типы сертификата (вкладки) */
    .design-tabs {
        gap: 8px;
        margin-bottom: 24px;
    }

    .design-tab {
        flex: 1;
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 400px) {
    .step-title {
        font-size: 24px !important;
    }

    .step1-certificate-wrapper .certificate-card-preview {
        transform: scale(0.65);
    }

    .design-carousel {
        min-height: 280px;
    }

    .radial-menu {
        width: 250px !important;
        height: 250px !important;
    }

    .selected-amount-value {
        font-size: 32px !important;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 968px) and (orientation: landscape) {
    .app-wrapper {
        padding-top: 60px;
    }

    .main-content {
        padding: 20px 16px 80px !important;
    }

    .step1-certificate-wrapper .certificate-card-preview {
        transform: scale(0.7);
    }

    .design-carousel {
        min-height: 250px;
    }
}

/* Улучшение для касаний */
@media (hover: none) and (pointer: coarse) {
    /* Увеличиваем области касания */
    .carousel-btn,
    .next-btn,
    .color-swatch,
    .design-option,
    .amount-option,
    .validity-option,
    .design-tab {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
    }

    /* Убираем hover эффекты на устройствах с касанием */
    .carousel-btn:hover,
    .next-btn:hover {
        transform: none;
    }

    .carousel-btn:active,
    .next-btn:active {
        transform: scale(0.95);
        background: #000000;
        color: #ffffff;
    }

    /* Оптимизация для форм */
    input,
    textarea,
    select {
        font-size: 16px !important; /* Предотвращает зум на iOS */
    }
}

/* Анимация появления мобильного меню */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-steps-nav.active {
    animation: slideDown 0.3s ease-out;
}

