/* ============================================
   МОБИЛЬНЫЙ ВИЗАРД - ЧИСТЫЕ СТИЛИ
   Этот файл используется ТОЛЬКО для .wizard-popup.mob
   ============================================ */

/* ============================================
   ФОРМА ПОЛУЧАТЕЛЯ (ШАГ 3)
   ============================================ */

/* Контейнер формы */
.wizard-popup.mob .recipient-form-container {
    padding: 20px;
    max-width: 100%;
    width: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wizard-popup.mob .recipient-form-container.visible {
    opacity: 1;
}

.wizard-popup.mob .recipient-form {
    background: none;
}

/* Заголовок формы */
.wizard-popup.mob .form-header {
    margin-bottom: 20px;
    text-align: center;
}

.wizard-popup.mob .form-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.2;
}

/* Радио кнопки */

.wizard-popup.mob .radio-group {
    display: flex;
    width: 100%;
    position: relative;
}

.wizard-popup.mob .radio-label {
    flex: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    margin-bottom: 0;
}

.wizard-popup.mob .radio-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wizard-popup.mob .radio-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: 1px solid #e6e6e6;
    background: transparent;
    transition: border-color 0.3s ease;
    width: 100%;
    height: 48px;
    position: relative;
}

.wizard-popup.mob .radio-custom.active {
    border: 1px solid #e6e6e6;
}

/* JS-индикатор рамки вкладок */
.wizard-popup.mob .tab-border-indicator {
    position: absolute;
    top: -1px;
    left: -1px;
    height: calc(100% + 2px);
    pointer-events: none;
    transition: left 200ms ease, width 200ms ease;
    box-sizing: content-box;
    border: none;
    outline: 3px solid #000;
    outline-offset: 0;
}

.wizard-popup.mob .radio-text {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: color 0.3s ease;
}

.wizard-popup.mob .radio-custom.active .radio-text {
    color: #000;
}

/* Поля формы */
.wizard-popup.mob .form-fields {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wizard-popup.mob .field-group {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}

.wizard-popup.mob .field-group input,
.wizard-popup.mob .field-group textarea {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    background: #ffffff00;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    border-radius: 0;
}

.wizard-popup.mob .field-group input:focus,
.wizard-popup.mob .field-group textarea:focus {
    outline: none;
    border-color: #05005b;
}

.wizard-popup.mob .field-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.wizard-popup.mob .field-label {
    position: absolute;
    top: 16px;
    left: 16px;
    font-size: 16px;
    color: #999;
    pointer-events: none;
    transition: all 0.2s ease;
}

.wizard-popup.mob .field-group input:focus + .field-label,
.wizard-popup.mob .field-group input:not(:placeholder-shown) + .field-label,
.wizard-popup.mob .field-group textarea:focus + .field-label,
.wizard-popup.mob .field-group textarea:not(:placeholder-shown) + .field-label {
    top: -8px;
    font-size: 12px;
    color: #05005b;
}

.wizard-popup.mob .field-hint {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    padding-left: 4px;
}

/* Кнопка "добавить поздравление" */
.wizard-popup.mob .add-message-section {
    margin-bottom: 20px;
}

.wizard-popup.mob .add-message-btn {
    width: 100%;
    padding: 16px;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.wizard-popup.mob .add-message-btn:hover {
    border-color: #05005b;
    color: #05005b;
}

.wizard-popup.mob .add-message-btn .btn-text {
    font-weight: 500;
}

.wizard-popup.mob .add-message-btn .btn-icon {
    font-size: 18px;
    font-weight: bold;
}

/* Базовые стили для мобильного визарда */
.wizard-popup.mob .wizard-modal {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    width: 100vw;
    height: 100vh;
    height: 100svh; /* Используем Small Viewport Height для мобильных */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background 0.3s ease;
    position: relative; /* Для правильного позиционирования дочерних элементов */
}

/* Шапка визарда */
.wizard-popup.mob .wizard-header {
    flex: 0 0 auto;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e5e7eb;
}

/* Верхняя строка: назад, название, закрыть */
.wizard-popup.mob .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 8px;
    min-height: 56px;
}

.wizard-popup.mob .btn-back,
.wizard-popup.mob .btn-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.2s ease;
}

.wizard-popup.mob .btn-back:active,
.wizard-popup.mob .btn-close:active {
    transform: scale(0.9);
}

.wizard-popup.mob .btn-back svg {
    width: 24px;
    height: 24px;
    stroke: #000;
}

.wizard-popup.mob .btn-close svg {
    width: 20px;
    height: 20px;
    stroke: #000;
}

.wizard-popup.mob .step-name {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Прогресс-бар с цифрами */
.wizard-popup.mob .progress-bar {
    width: 100%;
    padding: 0 0 0.5rem 0;
    position: relative;
}

.wizard-popup.mob .progress-numbers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    position: relative;
}

.wizard-popup.mob .progress-num {
    font-size: 1.2rem;
    font-weight: 600;
    color: #bbb;
    transition: color 0.3s ease;
}

.wizard-popup.mob .progress-num.active,
.wizard-popup.mob .progress-num.done {
    color: #000;
}

/* Прогресс-линия на всю ширину */
.wizard-popup.mob .progress-line {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    height: 2px;
    background: #bbb;
}

.wizard-popup.mob .progress-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 20%;
    background: #000;
    transition: width 0.3s ease;
}

/* Динамическая ширина линии */
.wizard-popup.mob[data-current-step="1"] .progress-line::before { width: 20%; }
.wizard-popup.mob[data-current-step="2"] .progress-line::before { width: 40%; }
.wizard-popup.mob[data-current-step="3"] .progress-line::before { width: 60%; }
.wizard-popup.mob[data-current-step="4"] .progress-line::before { width: 80%; }
.wizard-popup.mob[data-current-step="5"] .progress-line::before { width: 100%; }

/* Основной контент */
.wizard-popup.mob .wizard-main {
    flex: 1 1 auto; /* Занимает все доступное пространство */
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.wizard-popup.mob .mob-step {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Превью карты */
.wizard-popup.mob .card-preview {
    flex: 0 0 auto;
    width: min(85vw, 350px);
    height: calc(min(85vw, 350px) * 0.629);
    max-width: 350px;
    max-height: calc(350px * 0.629);
    margin: 2rem auto 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

/* Контейнер селекторов внутри шага */
.wizard-popup.mob .selectors-container {
    flex: 1 1 auto;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    position: relative;
    gap: 0;
    min-height: 0;
}

/* Круговой селектор */
.wizard-popup.mob .circular-selector {
    position: absolute;
    flex-shrink: 0;
    cursor: grab;
    overflow: visible;
    touch-action: pan-x;
    user-select: none;
    left: 50%;
    transform: translateX(-50%);
}

/* Селектор фонов - позиционируется относительно размера селектора */
.wizard-popup.mob .circular-selector.backgrounds {
    bottom: calc(-180vw + 25vw);
    width: 210vw;
    height: 210vw;
    border-radius: 50%;
}

/* Селектор изображений - позиционируется относительно размера селектора */
.wizard-popup.mob .circular-selector.images {
    bottom: calc(-180vw + 25vw);
    width: 190vw;
    height: 190vw;
    border-radius: 50%;
}

/* Селектор изображений включен */

/* Селектор номиналов */
.wizard-popup.mob .circular-selector.amounts {
    bottom: calc(-190vw + 25vw);
    width: 200vw;
    height: 200vw;
    border-radius: 50%;
}

/* Кнопки номиналов */
.wizard-popup.mob .selector-circle .amount-button {
    position: absolute;
    /* width: 8vw; */
    min-width: 60px;
    max-width: 100px;
    height: 8vw;
    min-height: 60px;
    max-height: 100px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                border-color 0.2s ease,
                box-shadow 0.2s ease;
    overflow: hidden;
    background: transparent;
    touch-action: auto;
    user-select: none;
    pointer-events: auto;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    
    /* Переопределяем стили темы */
    padding: 0;
    min-height: unset;
    gap: 0;
    text-transform: none;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
}

.wizard-popup.mob .selector-circle .amount-button.active {
    z-index: 10;
    font-size: 18px;
    font-weight: 700;
    /* transform с scale управляется через JS */
}

.wizard-popup.mob .circular-selector:active {
    cursor: grabbing;
}

/* Селектор фонов - ВКЛЮЧЕН */

.wizard-popup.mob .selector-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* убраны отладочные линии для фонов */

/* убраны отладочные линии для изображений */

/* Отключаем transition во время драггинга */
.wizard-popup.mob .circular-selector.dragging .selector-circle {
    transition: none;
}

.wizard-popup.mob .circular-selector.dragging .image-button,
.wizard-popup.mob .circular-selector.dragging .background-button {
    transition: none;
}

/* Кнопки в круговых селекторах */
.wizard-popup.mob .selector-circle .background-button {
    position: absolute;
    width: 7vw;
    height: 7vw;
    max-width: 45px;
    max-height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                border-color 0.2s ease,
                box-shadow 0.2s ease,
                width 0.2s ease,
                height 0.2s ease;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    touch-action: auto;
    user-select: none;
    pointer-events: auto;
    z-index: 5;
    
    /* Переопределяем стили темы */
    padding: 0;
    min-height: unset;
    gap: 0;
    text-transform: none;
    font-weight: normal;
    font-family: inherit;
    line-height: 1;
}

.wizard-popup.mob .selector-circle .image-button {
    position: absolute;
    width: 10vw;
    min-width: 80px;
    max-width: 120px;
    max-height: 120px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                border-color 0.2s ease,
                box-shadow 0.2s ease;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    touch-action: auto;
    user-select: none;
    pointer-events: auto;
    z-index: 5;
    
    /* Переопределяем стили темы */
    padding: 0;
    min-height: unset;
    gap: 0;
    text-transform: none;
    font-weight: normal;
    font-family: inherit;
    line-height: 1;
}

.wizard-popup.mob .selector-circle .background-button.active {
    border-color: #d3d2d87e;
    box-shadow: 0 4px 12px rgba(5, 0, 91, 0.3);
    z-index: 10;
    /* transform с scale управляется через JS */
}

.wizard-popup.mob .selector-circle .image-button.active {
    border-color: #d3d2d87e;
    box-shadow: 0 6px 20px rgba(5, 0, 91, 0.068);
    z-index: 10;
    /* transform с scale управляется через JS */
}

/* Изображения внутри кнопок */
.wizard-popup.mob .selector-circle .image-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    pointer-events: none;
    /* transform для поворота устанавливается индивидуально через JS */
}

/* Кнопка "Далее" */
.wizard-popup.mob .wizard-footer-mob {
    flex: 0 0 auto; /* Фиксированная высота в flexbox */
    width: 100%;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    min-height: 60px;
}

.wizard-popup.mob .btn-next {
    width: 100%;
    height: 56px;
    background: #05005b;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wizard-popup.mob .btn-next:active {
    background: #06006e;
}

/* Отображение номинала */
.wizard-popup.mob .amount-display {
    flex: 0 0 auto;
    text-align: center;
    padding: 1rem;
}

.wizard-popup.mob .amount-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

/* Блок "Можно купить" */
.wizard-popup.mob .product-suggestion {
    flex: 0 0 auto;
    text-align: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    margin: 0.5rem 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid #1111111a;
    flex-direction: column;
}

.wizard-popup.mob .suggestion-text {
    font-size: 12px;
    color: #888;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.wizard-popup.mob .product-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    max-width: 200px;
    margin: 0 auto;
    word-wrap: break-word;
}

/* Формы на шагах 3-5 */
.wizard-popup.mob .form-container,
.wizard-popup.mob .delivery-container,
.wizard-popup.mob .summary-container {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   ОПЛАТА / СВОДКА (ШАГ 5)
   ============================================ */
.wizard-popup.mob .order-summary {
    background: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wizard-popup.mob .summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.wizard-popup.mob .summary-item.total {
    border-bottom: none;
    padding-top: 16px;
}

.wizard-popup.mob .summary-label {
    font-size: 14px;
    color: #666;
}

.wizard-popup.mob .summary-value {
    font-size: 16px;
    color: #111;
    text-align: right;
}

/* ============================================
   ФОРМА ДОСТАВКИ (ШАГ 4)
   ============================================ */

/* Контейнер формы доставки */
.wizard-popup.mob .delivery-container {
    padding: 20px;
    max-width: 100%;
    width: 100%;
    opacity: 0; /* Для анимации появления */
    transition: opacity 0.3s ease;
}

.wizard-popup.mob .delivery-container.visible {
    opacity: 1;
}

.wizard-popup.mob .delivery-form {
    background: none;
}

/* Радио кнопки доставки */
.wizard-popup.mob .delivery-radio-group {
    display: flex;
    width: 100%;
    position: relative;
    margin-bottom: 20px;
}

.wizard-popup.mob .delivery-radio-group .radio-label {
    flex: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    margin-bottom: 0;
}

.wizard-popup.mob .delivery-radio-group .radio-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wizard-popup.mob .delivery-radio-group .radio-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: 1px solid #e6e6e6;
    background: transparent;
    transition: border-color 0.3s ease;
    width: 100%;
    height: 48px;
    position: relative;
}

.wizard-popup.mob .delivery-radio-group .radio-custom.active {
    border: 1px solid #e6e6e6;
}

.wizard-popup.mob .delivery-radio-group .radio-text {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: color 0.3s ease;
}

.wizard-popup.mob .delivery-radio-group .radio-custom.active .radio-text {
    color: #000;
}

/* Информация для режима "сейчас" */
.wizard-popup.mob .delivery-now-info {
    margin-bottom: 20px;
}

.wizard-popup.mob .delivery-now-info .field-hint {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Поля для отложенной доставки */
.wizard-popup.mob .delivery-deferred-fields {
    margin-top: 20px;
}

.wizard-popup.mob .delivery-deferred-fields .field-hint {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.4;
}

/* Строка с временем и таймзоной */
.wizard-popup.mob .time-tz-row {
    display: flex;
    gap: 12px;
}

.wizard-popup.mob .time-field {
    flex: 1;
    position: relative;
}

.wizard-popup.mob .tz-field {
    flex: 2;
    position: relative;
}

/* Стили для select */
.wizard-popup.mob .tz-field select {
    width: 100%;
    height: 52px;
    padding: 16px;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    font-size: 16px;
    background: #ffffff00;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.wizard-popup.mob .tz-field select:focus {
    outline: none;
    border-bottom-color: #05005b;
}

/* Скрытие кнопки "Назад" на первом шаге */
.wizard-popup.mob[data-current-step="1"] .btn-back {
    opacity: 0.3;
    pointer-events: none;
}

