/* Добавь это в конец своего файла styles-4.css или полностью замени его */

/* Общие настройки для адаптивности */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f4f6f9;
    color: #333;
    padding: 12px;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 480px;
}

.back-link {
    display: inline-block;
    color: #007aff;
    text-decoration: none;
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 500;
}

.app-header {
    margin-bottom: 16px;
}

.app-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1c1c1e;
}

.breadcrumbs {
    font-size: 13px;
    color: #8e8e93;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 12px;
    border-bottom: 1px solid #f2f2f7;
    padding-bottom: 6px;
}

.time-inputs {
    display: flex;
    gap: 12px;
}

.time-field {
    flex: 1;
}

.time-field label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.time-field input[type="time"] {
    width: 100%;
    height: 44px;
    border: 1px solid #d1d1d6;
    border-radius: 10px;
    padding: 0 10px;
    font-size: 16px;
    background: #fafafa;
    outline: none;
    text-align: center;
}

.color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f2f2f7;
}

.color-row:last-child {
    border-bottom: none;
}

.color-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
}

.color-label {
    font-size: 16px;
    font-weight: 500;
    color: #1c1c1e;
}

.counter {
    display: flex;
    align-items: center;
    border: 1px solid #d1d1d6;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.counter button {
    width: 40px;
    height: 38px;
    border: none;
    background: #ffffff;
    font-size: 20px;
    font-weight: 600;
    color: #007aff;
    cursor: pointer;
}

.counter button:active {
    background: #e5e5ea;
}

/* Настройки поля ввода количества */
.counter input {
    width: 50px;
    height: 38px;
    border: none;
    background: #f2f2f7;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1c1c1e;
    outline: none;
    -moz-appearance: textfield;
}

.counter input:focus {
    background: #e5e5ea; /* Подсветка поля при вводе цифр */
}

.counter input::-webkit-outer-spin-button,
.counter input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.submit-btn {
    width: 100%;
    height: 52px;
    background: #34c759;
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.2);
}

.submit-btn:active {
    opacity: 0.85;
}


/* 🗖 СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА ОТПРАВКИ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4); /* Затемение заднего фона */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 9999;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 20px;
    width: 80%;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#modalText {
    font-size: 16px;
    font-weight: 600;
}

.modal-icon {
    font-size: 40px;
    line-height: 1;
}

/* Крутящийся круг загрузки (Spinner) */
.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007aff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Отключаем системное меню выделения и копирования в счетчиках */
.counter input {
    -webkit-user-select: none; /* Safari/Chrome iOS */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE/Edge */
    user-select: none;         /* Стандарт */
    -webkit-touch-callout: none; /* Отключает контекстное меню при долгом нажатии в iOS */
}



/* ==========================================================================
   ⌨️ СТИЛИ ДЛЯ ВСТРОЕННОЙ ЦИФРОВОЙ КЛАВИАТУРЫ (ВЫЕЗЖАЕТ СНИЗУ)
   ========================================================================== */
.keyboard-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 9998;
}

.keyboard-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.keyboard-content {
    background: #f4f6f9;
    width: 100%;
    max-width: 480px;
    border-radius: 24px 24px 0 0;
    padding: 16px 16px 34px 16px; /* Большой отступ снизу под шторку iPhone/Android */
    box-shadow: 0 -8px 24px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.25s ease;
}

.keyboard-overlay.active .keyboard-content {
    transform: translateY(0);
}

/* Шапка клавиатуры */
.keyboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#keyboardTitle {
    font-size: 18px;
    font-weight: 600;
    color: #1c1c1e;
}

.keyboard-close-btn {
    background: #007aff;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* Экранчик над кнопками */
.keyboard-display {
    background: #ffffff;
    width: 100%;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: right;
    padding: 0 16px;
    font-size: 26px;
    font-weight: 700;
    color: #1c1c1e;
    border: 1px solid #d1d1d6;
    margin-bottom: 14px;
}

/* Сетка кнопок 3х4 */
.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.key {
    background: #ffffff;
    border: none;
    height: 54px;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 600;
    color: #1c1c1e;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    cursor: pointer;
}

.key:active {
    background: #d1d1d6;
}

/* Кнопки стирания */
.key-clear {
    color: #ff3b30;
    background: #ffe5e5;
}
.key-back {
    color: #ff9500;
    background: #fff4e5;
}



/* ==========================================================================
   🏠 СТИЛИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ (МЕНЮ ПОДРАЗДЕЛЕНИЙ)
   ========================================================================== */
.main-page-header {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 24px;
}

.main-page-header h1 {
    font-size: 32px;
    color: #007aff; /* Фирменный синий акцент */
    letter-spacing: -0.5px;
}

/* Контейнер для карточек */
.menu-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Стили самой карточки-ссылки */
.menu-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #1c1c1e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    border: 1px solid transparent;
}

/* Эффект нажатия на телефоне */
.menu-card:active {
    transform: scale(0.98);
    background: #f2f2f7;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

/* Крупная иконка подразделения */
.menu-card-icon {
    font-size: 28px;
    margin-right: 16px;
    background: #f2f2f7;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* Текстовый блок внутри карточки */
.menu-card-info {
    flex: 1;
}

.menu-card-info h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #1c1c1e;
}

.menu-card-info p {
    font-size: 13px;
    color: #8e8e93;
    line-height: 1.3;
}

/* Стрелочка перехода справа */
.menu-card-arrow {
    font-size: 18px;
    color: #c7c7cc;
    font-weight: bold;
    padding-left: 8px;
}