/* ============================================
   ОБЩИЕ СТИЛИ И ПЕРЕМЕННЫЕ
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100dvh; /* стабильная высота на iOS при появлении/скрытии адресной строки */
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    touch-action: manipulation;
    overscroll-behavior: none;
    overflow: hidden;
}

#app {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* ============================================
   ЭКРАН ЗАГРУЗКИ
   ============================================ */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FF6600, #FC6A05);
    z-index: 9999;
    transition: opacity 0.3s ease;
}

#loading-screen:not(.active) {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ============================================
   ГЛАВНОЕ ПРИЛОЖЕНИЕ
   ============================================ */
.app {
    width: 100%;
    height: 100dvh; /* избегаем скачков высоты */
    background: #FF6600;
    overflow: hidden;
}

/* ============================================
   ШАПКА
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    z-index: 100;
    padding: 0 16px;
    color: #fff;
    background: #FF6600;
    box-sizing: border-box;
}

.header__main-row {
    display: flex;
    align-items: center;
    height: 80px;
    gap: 16px;
}

.header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header__logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: #fff;
}

.header__text-block h2,
.header__text-block p {
    margin: 0;
    white-space: nowrap;
}

.header__text-block h2 {
    font-size: 20px;
    font-weight: 500;
}

.header__text-block p {
    font-size: 13px;
    font-weight: 500;
    margin-top: 2px;
    opacity: 0.9;
}

.header__cafe-selector {
    margin-left: auto;
}

.cafe-select-header {
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.cafe-select-header option {
    background: #FF6600;
    color: white;
}

/* ============================================
   КОНТЕНТ (ЛИС Т С ЗАКРУГЛЕННЫМИ УГЛАМИ)
   ============================================ */
.app__sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 80px; /* высота шапки */
    background: #fff;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    z-index: 10;
    overflow: hidden;
}

.catalog-container {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ============================================
   НАВИГАЦИЯ ПО КАТЕГОРИЯМ
   ============================================ */
.category-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    background: #fff;
    padding: 10px 20px;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-btn {
    flex-shrink: 0;
    display: inline-flex;
    background: #fff;
    color: #707071;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    scroll-snap-align: center;
}

.category-btn.active {
    background: #515151;
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(81, 81, 81, 0.3);
}

.category-btn:active {
    transform: scale(0.95);
}

/* ============================================
   КАТАЛОГ ТОВАРОВ
   ============================================ */
.catalog {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 0 13px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #fff;
    scroll-padding-top: 60px;
}

.catalog__category-block {
    margin-bottom: 16px;
    scroll-margin-top: 60px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.catalog__category-block:last-child {
    margin-bottom: 0;
}

.catalog__category-block h2,
.category-title {
    grid-column: 1 / -1;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
    padding-left: 4px;
}

.catalog__item {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    padding: 8px;
    background: #fff;
}

.catalog__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.catalog__image:active {
    opacity: 0.8;
}

.catalog__image-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    background: linear-gradient(135deg, #FF6600, #FC6A05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.catalog__image-placeholder:active {
    opacity: 0.8;
}

.catalog__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.catalog__title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.catalog__subtitle {
    display: none;
}

.catalog__price {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    display: inline-block;
    background: #F2F2F2;
    color: #333;
    padding: 6px 10px;
    border-radius: 8px;
    align-self: flex-start;
    cursor: pointer;
    transition: background 0.2s ease;
}

.catalog__price:active {
    background: #E0E0E0;
}

/* ============================================
   НИЖНЯЯ КНОПКА КОРЗИНЫ
   ============================================ */
.app__bottom-bar {
    position: fixed;
    bottom: 16px;
    left: 0;
    right: 0;
    z-index: 999;
    pointer-events: none;
    display: flex;
    justify-content: center;
    padding: 0 16px;
}

.orange-button {
    pointer-events: auto;
    width: 100%;
    max-width: 600px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border: none;
    border-radius: 40px;
    background-color: rgba(255, 102, 6, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.orange-button:active {
    transform: scale(0.98);
}

.orange-button__price {
    font-size: 26px;
    font-weight: 700;
}

.orange-button__items {
    display: flex;
    align-items: center;
    gap: 8px;
}

.orange-button__item {
    position: relative;
    width: 40px;
    height: 40px;
}

.orange-button__item-mask {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #F86606;
}

.orange-button__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.orange-button__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #fff;
    color: #F86606;
    border-radius: 50%;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    min-width: 18px;
    text-align: center;
}

/* ============================================
   ПЛАШКА УСТАНОВКИ (PWA)
   ============================================ */
.install-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5000;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
}

.install-banner__content {
    max-width: 680px;
    margin: 0 auto;
    background: #FFFFFF;
    border: 1px solid #E5E5E6;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    pointer-events: auto;
}

.install-banner__text {
    font-size: 14px;
    color: #333;
}

.install-banner__actions { display: flex; gap: 8px; align-items: center; }

.install-banner__btn {
    background: #FF6600;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.install-banner__close {
    background: #F2F2F7;
    border: none;
    color: #8E8E93;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}

/* ============================================
   КОРЗИНА (BOTTOM SHEET)
   ============================================ */
.cart-sheet-wrapper {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-sheet-wrapper.visible {
    opacity: 1;
    pointer-events: auto;
}

.cart-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #EFEEF4;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cart-sheet-wrapper.visible .cart-sheet {
    transform: translateY(0);
}

.cart-sheet__header {
    padding: 0 16px 12px;
    background: #EFEEF4;
}

.cart-sheet__handle {
    width: 40px;
    height: 4px;
    background: #E5E5E6;
    border-radius: 2px;
    margin: 18px auto 16px;
    cursor: pointer;
}

.cart-sheet__toggle-wrapper {
    width: 100%;
    display: flex;
}

.cart-sheet__toggle-segment {
    width: 100%;
    display: flex;
    background: #F2F3F8;
    border-radius: 10px;
    padding: 4px 2px;
    box-sizing: border-box;
    justify-content: space-between;
}

.cart-sheet__toggle-btn {
    flex: 1;
    text-align: center;
    background: none;
    border: none;
    padding: 8px 16px;
    margin: 0 2px;
    font-size: 16px;
    font-weight: 400;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.cart-sheet__toggle-btn.active {
    background: #fff;
    font-weight: 700;
}

.cart-sheet__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px;
    overscroll-behavior: contain;
    gap: 16px;
}

.cart-sheet__items-block {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
}

.cart-sheet__items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-sheet__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.cart-sheet__item:last-child {
    border-bottom: none;
}

.cart-sheet__item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.cart-sheet__item-info {
    flex: 1;
    min-width: 0;
}

.cart-sheet__item-title {
    margin: 0 0 2px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.cart-sheet__item-price {
    margin: 0;
    font-size: 15px;
    color: #B6B6B6;
}

.cart-sheet__quantity-block {
    display: flex;
    align-items: center;
    background: #F2F3F8;
    border-radius: 10px;
    padding: 4px 10px;
    gap: 10px;
}

.cart-sheet__quantity-block button {
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    font-size: 20px;
    font-weight: 400;
    padding: 4px 8px;
}

.cart-sheet__quantity-block span {
    font-size: 20px;
    font-weight: 400;
    color: #333;
    min-width: 24px;
    text-align: center;
}

.cart-sheet__summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 0.5px solid #C6C6C8;
}

.cart-sheet__summary-row {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
    font-size: 18px;
    font-weight: 400;
    color: #7E7E7E;
}

.cart-sheet__summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-weight: 700;
    font-size: 18px;
    color: #333;
    padding-top: 10px;
    border-top: 0.5px solid #C6C6C8;
}

/* Форма заказа */
.cart-sheet__form {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-sheet__form-label {
    display: flex;
    flex-direction: column;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.cart-sheet__form-label input,
.cart-sheet__form-label select {
    margin-top: 8px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #E5E5E6;
    font-size: 16px;
    background: #F9F9F9;
}

.cart-sheet__form-label--inline {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.cart-sheet__form-label--inline input,
.cart-sheet__form-label--inline select {
    margin-top: 0;
    width: 180px;
}

.cart-sheet__form-label--collapsible {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.cart-sheet__form-label--clickable {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 12px 16px;
    background: #F9F9F9;
    border-radius: 8px;
    border: 1px solid #E5E5E6;
    transition: all 0.2s;
}

.cart-sheet__form-label--clickable:hover {
    background: #F2F2F2;
}

.cart-sheet__form-label--clickable:active {
    transform: scale(0.98);
}

.cart-sheet__address-value {
    font-size: 15px;
    color: #8E8E93;
    font-weight: 400;
}

.cart-sheet__chevron {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.cart-sheet__chevron.rotated {
    transform: rotate(90deg);
}

.cart-sheet__comment {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #E5E5E6;
    font-size: 16px;
    background: #F9F9F9;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.addresses-list {
    background: #fff;
    border: 1px solid #E5E5E6;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.addresses-list__item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.addresses-list__item:last-child {
    border-bottom: none;
}

.addresses-list__item:hover {
    background: #f9f9f9;
}

.cart-sheet__footer {
    padding: 16px 16px 32px;
    background: #EFEEF4;
}

.cart-sheet__submit-btn {
    width: 100%;
    background: #FF6600;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    padding: 16px;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.cart-sheet__submit-btn:active {
    opacity: 0.8;
}

.cart-sheet__submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   ЭКРАН УСПЕХА
   ============================================ */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.success-content {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #2ECC71;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 20px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.success-content h2 {
    font-size: 24px;
    margin: 0 0 16px 0;
    color: #333;
}

.order-number {
    font-size: 16px;
    color: #FF6600;
    font-weight: 600;
    margin: 12px 0;
}

.success-message {
    font-size: 16px;
    color: #666;
    margin: 16px 0 24px 0;
    line-height: 1.5;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #FF6600;
    color: white;
}

.btn-primary:active {
    opacity: 0.8;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ОШИБКИ
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 4000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #E5E5E6;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin: 0;
    white-space: pre-line;
    line-height: 1.6;
    color: #333;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #E5E5E6;
    text-align: right;
}

.btn-secondary {
    background: #E5E5E6;
    color: #333;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ИНФОРМАЦИИ О БЛЮДЕ
   ============================================ */
.dish-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    animation: fadeIn 0.2s ease;
}

.dish-modal {
    background: white;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.dish-modal__handle {
    width: 36px;
    height: 4px;
    background: #D1D1D6;
    border-radius: 100px;
    margin: 12px auto 8px;
    cursor: pointer;
}

.dish-modal__content {
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 20px));
}

.dish-modal__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
}

.dish-modal__info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dish-modal__title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.dish-modal__description {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

.dish-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 16px;
}

.dish-modal__price {
    font-size: 24px;
    font-weight: 700;
    color: #FF6600;
    margin: 0;
}

.dish-modal__add-btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ВЫБОРА АДРЕСА
   ============================================ */
.address-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.address-modal {
    background: white;
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    position: relative;
    animation: slideUpScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.address-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #F2F2F7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #8E8E93;
    transition: all 0.2s;
}

.address-modal__close:hover {
    background: #E5E5EA;
    transform: scale(1.1);
}

.address-modal__content {
    padding: 32px 24px 24px;
    text-align: center;
}

.address-modal__title {
    font-size: 22px;
    font-weight: 700;
    color: #000;
    margin: 0 0 12px 0;
}

.address-modal__subtitle {
    font-size: 15px;
    color: #8E8E93;
    line-height: 1.4;
    margin: 0 0 28px 0;
}

.address-modal__btn {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.address-modal__btn:last-child {
    margin-bottom: 0;
}

.address-modal__btn--primary {
    background: #FF6600;
    color: white;
}

.address-modal__btn--primary:hover {
    background: #E55A00;
    transform: scale(1.02);
}

.address-modal__btn--primary:active {
    transform: scale(0.98);
}

.address-modal__btn--secondary {
    background: #F2F2F7;
    color: #000;
}

.address-modal__btn--secondary:hover {
    background: #E5E5EA;
}

.address-modal__btn--secondary:active {
    transform: scale(0.98);
}

@keyframes slideUpScale {
    from {
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ============================================
   ПОЛНОЭКРАННЫЙ ЭКРАН ВЫБОРА АДРЕСА
   ============================================ */
.address-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #F2F2F7;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    animation: slideInFromRight 0.3s ease;
}

.address-screen__header {
    background: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #E5E5EA;
}

.address-screen__back {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #FF6600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.2s;
}

.address-screen__back:active {
    transform: scale(0.9);
}

.address-screen__toggle {
    flex: 1;
    display: flex;
    background: #F2F2F7;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.address-screen__toggle-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #000;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.address-screen__toggle-btn.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.address-screen__content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Поиск адреса */
.address-screen__search {
    margin: 16px;
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.address-screen__search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.address-screen__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #000;
    background: transparent;
}

.address-screen__input::placeholder {
    color: #8E8E93;
}

.address-screen__suggestions {
    margin: 0 16px;
}

.address-screen__loading {
    padding: 20px 0;
    text-align: center;
    color: #8E8E93;
    font-size: 15px;
    margin: 0;
}

.address-screen__suggestion-item {
    background: white;
    padding: 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.address-screen__suggestion-item:active {
    transform: scale(0.98);
    background: #F9F9F9;
}

.address-screen__suggestion-icon {
    width: 32px;
    height: 32px;
    background: #F2F2F7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.address-screen__suggestion-text {
    flex: 1;
}

.address-screen__suggestion-title {
    font-size: 15px;
    font-weight: 500;
    color: #000;
    margin: 0 0 4px 0;
}

.address-screen__suggestion-subtitle {
    font-size: 13px;
    color: #8E8E93;
    margin: 0;
}

/* Карточка самовывоза */
.address-screen__pickup-card {
    background: white;
    margin: 16px;
    padding: 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.address-screen__pickup-card:active {
    transform: scale(0.98);
    background: #F9F9F9;
}

.address-screen__pickup-icon {
    width: 48px;
    height: 48px;
    background: #FFF3E6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.address-screen__pickup-info {
    flex: 1;
}

.address-screen__pickup-name {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0 0 4px 0;
}

.address-screen__pickup-address {
    font-size: 14px;
    color: #8E8E93;
    margin: 0;
}

.address-screen__pickup-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ОФОРМЛЕНИЯ ЗАКАЗА
   ============================================ */
.checkout-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.checkout-modal {
    background: white;
    border-radius: 20px;
    max-width: 440px;
    width: 100%;
    position: relative;
    animation: slideUpScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.checkout-modal__header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #E5E5EA;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkout-modal__title {
    font-size: 20px;
    font-weight: 700;
    color: #000;
    margin: 0;
}

.checkout-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: #F2F2F7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #8E8E93;
    transition: all 0.2s;
}

.checkout-modal__close:hover {
    background: #E5E5EA;
    transform: scale(1.1);
}

.checkout-modal__content {
    padding: 24px;
}

.checkout-modal__label {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.checkout-modal__label:last-child {
    margin-bottom: 0;
}

.checkout-modal__label span {
    font-size: 14px;
    font-weight: 600;
    color: #000;
    margin-bottom: 8px;
}

.checkout-modal__label input,
.checkout-modal__label select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E5E5EA;
    border-radius: 12px;
    font-size: 16px;
    color: #000;
    background: white;
    transition: all 0.2s;
    box-sizing: border-box;
}

.checkout-modal__label input:focus,
.checkout-modal__label select:focus {
    outline: none;
    border-color: #FF6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.checkout-modal__label input::placeholder {
    color: #8E8E93;
}

.checkout-modal__footer {
    padding: 16px 24px 24px;
}

.checkout-modal__btn {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: #FF6600;
    color: white;
}

.checkout-modal__btn:hover {
    background: #E55A00;
    transform: scale(1.02);
}

.checkout-modal__btn:active {
    transform: scale(0.98);
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 768px) {
    .header__text-block h2 {
        font-size: 18px;
    }
    
    .header__text-block p {
        font-size: 12px;
    }
    
    .cafe-select-header {
        font-size: 12px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .catalog__category-block {
        gap: 10px;
    }
    
    .catalog__title {
        font-size: 14px;
    }
    
    .catalog__price {
        font-size: 16px;
        padding: 5px 8px;
    }
}

/* ============================================
   ДЕСКТОПНАЯ ВЕРСИЯ (от 1024px)
   ============================================ */
@media (min-width: 1024px) {
    html, body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        background: #f0f0f2;
    }

    #app {
        position: relative;
        max-width: 1200px;
        margin: 0 auto;
        min-height: 100vh;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
    }

    .app {
        max-width: 1200px;
        margin: 0 auto;
        min-height: 100vh;
        height: auto;
        border-radius: 16px;
        overflow: visible;
    }

    .header {
        position: relative;
        border-radius: 16px 16px 0 0;
        padding: 0 24px;
        height: 72px;
    }

    .header__main-row {
        height: 72px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .header__logo {
        width: 48px;
        height: 48px;
    }

    .header__text-block h2 {
        font-size: 22px;
    }

    .header__text-block p {
        font-size: 14px;
    }

    .cafe-select-header {
        font-size: 15px;
        padding: 10px 16px;
    }

    .app__sheet {
        position: relative;
        top: 0;
        border-radius: 0 0 16px 16px;
        min-height: calc(100vh - 72px);
        max-width: 1200px;
        margin: 0 auto;
    }

    .catalog-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 24px 100px;
    }

    .category-nav {
        padding: 16px 0;
        flex-wrap: wrap;
        gap: 10px;
        overflow-x: visible;
        scroll-snap-type: none;
    }

    .category-btn {
        scroll-snap-align: none;
    }

    .catalog {
        padding: 0 0 32px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .catalog__category-block {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        margin-bottom: 32px;
    }

    .catalog__category-block h2,
    .catalog-title {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .catalog__item {
        padding: 12px;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        transition: box-shadow 0.2s ease, transform 0.2s ease;
    }

    .catalog__item:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }

    .catalog__image,
    .catalog__image-placeholder {
        border-radius: 10px;
    }

    .catalog__title {
        font-size: 16px;
    }

    .catalog__price {
        font-size: 18px;
        padding: 8px 12px;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .catalog__price:hover {
        background: #e8e8e8;
    }

    /* Нижняя кнопка корзины — по центру внизу с ограничением ширины */
    .app__bottom-bar {
        left: 50%;
        transform: translateX(-50%);
        max-width: 1200px;
        width: calc(100% - 48px);
        padding: 0 24px 24px;
        bottom: 24px;
    }

    .orange-button {
        max-width: 400px;
        margin: 0 auto;
        border-radius: 16px;
        height: 56px;
        padding: 0 24px;
    }

    .orange-button:hover {
        transform: scale(1.02);
    }

    /* Корзина на десктопе — боковая панель справа */
    .cart-sheet-wrapper {
        align-items: stretch;
        justify-content: flex-end;
    }

    .cart-sheet-wrapper.visible .cart-sheet {
        transform: translateX(0);
    }

    .cart-sheet {
        position: fixed;
        left: auto;
        right: 0;
        top: 0;
        bottom: 0;
        width: 420px;
        max-width: 90vw;
        max-height: none;
        height: 100vh;
        border-radius: 16px 0 0 16px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    }

    .cart-sheet__handle {
        display: none;
    }

    .cart-sheet__header {
        padding: 20px 24px 16px;
    }

    .cart-sheet__content {
        padding: 20px 24px;
    }

    .cart-sheet__footer {
        padding: 24px;
    }

    /* Модальные окна — по центру с ограничением ширины */
    .address-modal-wrapper,
    #phone-for-address-modal-wrapper,
    .checkout-modal-wrapper {
        align-items: center;
        justify-content: center;
        padding: 24px;
    }

    .address-modal,
    .checkout-modal {
        max-width: 440px;
        width: 100%;
        border-radius: 20px;
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
    }

    .dish-modal-wrapper {
        align-items: center;
        justify-content: center;
        padding: 24px;
    }

    .dish-modal {
        max-width: 480px;
        width: 100%;
        max-height: 90vh;
        border-radius: 20px;
        animation: scaleIn 0.3s ease;
    }

    .dish-modal__handle {
        display: none;
    }

    .dish-modal__content {
        padding: 24px;
    }

    .dish-modal__title {
        font-size: 26px;
    }

    /* Полноэкранный экран адреса — как модальное окно по центру */
    .address-screen {
        align-items: center;
        justify-content: flex-start;
        padding: 24px;
        background: rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }

    .address-screen .address-screen__header,
    .address-screen .address-screen__content {
        max-width: 520px;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .address-screen .address-screen__header {
        border-radius: 20px 20px 0 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .address-screen .address-screen__content {
        border-radius: 0 0 20px 20px;
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    }

    /* Экран успеха и ошибка — уже по центру, только тень */
    .success-content,
    .modal-content {
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
    }

    /* Плашка установки PWA */
    .install-banner__content {
        max-width: 500px;
    }
}
