/* ===== РЕЖИМ ПРИЛОЖЕНИЯ ===== */

/* Оверлей для затемнения фона */
.app-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.app-overlay.active {
    display: block;
}

/* Слайдер-панель приложения */
.app-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85vh;
    background: #f5f5f5;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.app-panel.active {
    transform: translateY(0);
}

/* Хэндл для свайпа */
.app-handle {
    width: 50px;
    height: 5px;
    background: #ccc;
    border-radius: 10px;
    margin: 10px auto;
    flex-shrink: 0;
}

/* Шапка приложения */
.app-header {
    padding: 10px 20px 5px 20px;
    background: white;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.app-back-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    color: #666;
}

.app-back-btn.hidden {
    visibility: hidden;
}

.app-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    color: #999;
}

/* Контент приложения (скроллится) */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px 80px 20px;
    -webkit-overflow-scrolling: touch;
}

/* Список брендов / категорий */
.app-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.app-list-item {
    background: white;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
    border: 1px solid #f0f0f0;
}

.app-list-item:active {
    background: #f0f0f0;
    transform: scale(0.97);
}

.app-list-item .item-name {
    font-weight: 500;
    color: #222;
    font-size: 16px;
}

.app-list-item .item-arrow {
    color: #bbb;
    font-size: 18px;
}

.app-list-item .item-count {
    font-size: 13px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 10px;
    border-radius: 20px;
}

/* Карточка товара в приложении */
.app-product-card {
    background: white;
    border-radius: 12px;
    padding: 15px 18px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #4CAF50;
}

.app-product-card .product-model {
    font-weight: 600;
    font-size: 16px;
    color: #222;
}

.app-product-card .product-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 6px;
    font-size: 14px;
    color: #555;
}

.app-product-card .product-price {
    font-weight: 700;
    color: #4CAF50;
    font-size: 17px;
    margin-top: 8px;
}

.app-product-card .product-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.app-product-card .btn-order-app,
.app-product-card .btn-discount-app {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.app-product-card .btn-order-app {
    background: #4CAF50;
    color: white;
}

.app-product-card .btn-discount-app {
    background: #FF9800;
    color: white;
}

.app-product-card .btn-order-app:active,
.app-product-card .btn-discount-app:active {
    transform: scale(0.95);
}

/* Плавающая кнопка открытия приложения */
.app-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 28px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
    cursor: pointer;
    z-index: 50;
    transition: 0.3s;
}

.app-fab:active {
    transform: scale(0.9);
}

/* Кнопка переключения режима в шапке */
.app-toggle-btn {
    background: none;
    border: 2px solid #4CAF50;
    color: #4CAF50;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
}

.app-toggle-btn.active {
    background: #4CAF50;
    color: white;
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .app-panel {
        height: 92vh;
        border-radius: 16px 16px 0 0;
    }
    .app-fab {
        width: 54px;
        height: 54px;
        font-size: 24px;
        bottom: 16px;
        right: 16px;
    }
}