/* Основные переменные - Темная тема (по умолчанию) */
:root,
[data-theme="dark"] {
    --bg-primary: #101010;
    --bg-secondary: #1a1a1a;
    --bg-card: #222;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-yellow: #FFD60A;
    --accent-red: #FF3B30;
    --border-radius: 16px;
    --spacing: 16px;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --button-text: #000000;
}

/* Светлая тема */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #000000;
    --text-secondary: #6e6e6e;
    --accent-yellow: #FFD60A;
    --accent-red: #FF3B30;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --button-text: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 100px;
    padding-top: 16px;
}

/* Категории */
.categories-nav-simple {
    position: sticky;
    top: 0;
    background-color: var(--bg-primary);
    z-index: 99;
    border-bottom: 1px solid var(--border-color);
    padding-top: 8px;
}

.categories-scroll {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s;
}

.category-tab.active {
    color: var(--text-primary);
}

.category-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
}

/* Основной контент */
.main-content {
    padding: 0 16px;
}

.section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.product-card {
    background: transparent;
    border-radius: var(--border-radius);
    overflow: visible;
    cursor: pointer;
    transition: transform 0.2s;
}

.product-card:active {
    transform: scale(0.98);
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    margin-bottom: 8px;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
    background: #f5f5f5;
}

.product-add-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.2s;
    z-index: 2;
}

.product-add-btn:hover {
    transform: scale(1.1);
}

.product-add-btn svg {
    width: 20px;
    height: 20px;
}

.product-add-btn.in-cart {
    width: auto;
    min-width: 80px;
    border-radius: 18px;
    padding: 0 12px;
    background: white;
}

.product-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #000;
}

.product-counter button {
    background: transparent;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
}

.product-counter span {
    min-width: 20px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
}

.product-info {
    padding: 0 4px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.3;
}

.product-weight {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Нижняя панель корзины */
.cart-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    padding: 12px 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -4px 20px var(--shadow-color);
    z-index: 1000;
}

.checkout-btn-full {
    width: 100%;
    background: var(--accent-yellow);
    color: var(--button-text);
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s;
}

.checkout-btn-full:active {
    transform: scale(0.98);
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    align-items: flex-end;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="light"] .modal-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    padding: 0;
    animation: slideUp 0.3s ease-out;
}

/* Для модального окна товара убираем padding полностью */
#productModal .modal-content {
    padding: 0;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* Для других модальных окон оставляем padding */
#cartModal .modal-content {
    padding: 20px;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(108, 108, 112, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    z-index: 100;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-close:active {
    transform: scale(0.95);
    background: rgba(108, 108, 112, 1);
}

[data-theme="light"] .modal-close {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}

[data-theme="light"] .modal-close:active {
    background: rgba(0, 0, 0, 0.2);
}

/* Модальное окно товара */
.product-modal-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

/* Слайдер изображений */
.product-slider {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
    border-radius: var(--border-radius);
    overflow: hidden;
}


.slider-container {
    position: relative;
    width: 100%;
    padding-top: 75%; /* Соотношение 4:3 */
    overflow: hidden;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.slider-container:active {
    cursor: grabbing;
}

.slider-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.slider-track.no-transition {
    transition: none;
}

.slider-image {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.slider-prev {
    left: 12px;
}

.slider-next {
    right: 12px;
}

.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(8px);
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s;
}

.slider-dot.active {
    width: 24px;
    border-radius: 4px;
    background: white;
}

/* Новый дизайн модального окна товара */
.product-modal-image-container {
    position: relative;
    width: 100%;
    margin: 0;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    overflow: hidden;
}

.product-modal-info {
    background: var(--bg-secondary);
    padding: 20px 20px 160px 20px;
    min-height: 200px;
}

.product-modal-section {
    margin-bottom: 16px;
}

.product-modal-section:last-child {
    margin-bottom: 0;
}

.product-modal-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-modal-description {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
}

.product-modal-nutrition {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.product-modal-weight-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.product-modal-footer-new {
    position: sticky;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 20px calc(env(safe-area-inset-bottom) + 24px);
    border-radius: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

[data-theme="light"] .product-modal-footer-new {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.product-modal-footer-top {
    margin-bottom: 16px;
}

.product-modal-title-price {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.product-modal-title-new {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.product-modal-price-new {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.product-modal-footer-bottom {
    display: flex;
    gap: 12px;
    align-items: center;
}

.quantity-controls-new {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .quantity-controls-new {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.quantity-btn-new {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.quantity-btn-new:active {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .quantity-btn-new:active {
    background: rgba(0, 0, 0, 0.1);
}

.quantity-value-new {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 32px;
    text-align: center;
}

.add-to-cart-btn-new {
    flex: 1;
    background: var(--accent-yellow);
    color: #000;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(255, 214, 10, 0.3);
}

.add-to-cart-btn-new:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 214, 10, 0.2);
}

/* Старые стили для совместимости */
.product-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-modal-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.product-modal-price {
    font-size: 20px;
    font-weight: 700;
}

.product-modal-weight {
    color: var(--text-secondary);
    font-size: 14px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    padding: 8px 16px;
    border-radius: 12px;
}

.quantity-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.quantity-value {
    min-width: 30px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.add-to-cart-btn {
    flex: 1;
    background: var(--accent-yellow);
    color: var(--button-text);
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

/* Модальное окно корзины */
.cart-modal-content {
    max-height: 95vh;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-right: 40px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.trash-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-image {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    background: #f5f5f5;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.cart-item-price {
    font-weight: 700;
}

.cart-item-weight {
    font-size: 13px;
    color: var(--text-secondary);
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

.cart-additional {
    margin: 20px 0;
}

.cutlery-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 12px;
}

.cutlery-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cutlery-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 10px;
}

.cutlery-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.comment-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    background: var(--bg-card);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
}

.comment-btn span {
    flex: 1;
    text-align: left;
}

.suggestions-section {
    margin: 24px 0;
}

.suggestions-section h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.suggestions-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.suggestions-grid::-webkit-scrollbar {
    display: none;
}

.suggestion-item {
    min-width: 140px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
}

.suggestion-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.suggestion-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.suggestion-price {
    font-size: 14px;
    font-weight: 700;
}

.suggestion-weight {
    font-size: 12px;
    color: var(--text-secondary);
}

.payment-btn {
    width: 100%;
    background: var(--accent-yellow);
    color: var(--button-text);
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.cart-footer-message {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Профиль */
.profile-content {
    padding: 20px 0;
}

.profile-header {
    text-align: center;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: var(--bg-secondary);
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-username {
    color: var(--text-secondary);
}

.profile-orders {
    margin-top: 24px;
}

.profile-orders h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.order-item {
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 12px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.order-id {
    font-weight: 600;
}

.order-status {
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(76, 217, 100, 0.2);
    color: #4CD964;
}

.order-items {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.order-total {
    font-weight: 700;
}

/* ==================== ГЛАВНАЯ СТРАНИЦА ==================== */

.home-container {
    padding-bottom: 100px;
}

.home-header {
    text-align: center;
    padding: 24px 20px;
    background: var(--bg-secondary);
    border-radius: 0 0 24px 24px;
    margin-bottom: 20px;
}

.restaurant-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.logo-placeholder {
    font-size: 60px;
}

.restaurant-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.restaurant-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.welcome-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.table-info {
    display: inline-block;
}

.table-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-yellow), #FFB800);
    color: #000;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(255, 214, 10, 0.3);
}

.home-section {
    padding: 0 16px;
    margin-bottom: 20px;
}

.section-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.section-card-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.events-list, .promotions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-item, .promotion-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.event-icon, .promotion-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.event-content, .promotion-content {
    flex: 1;
}

.event-title, .promotion-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.event-description, .promotion-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.event-time, .promotion-valid {
    font-size: 13px;
    color: var(--accent-yellow);
    margin-top: 6px;
}

.promotion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.promo-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.promo-badge.discount {
    background: rgba(255, 59, 48, 0.2);
    color: var(--accent-red);
}

.promo-badge.bonus {
    background: rgba(255, 214, 10, 0.2);
    color: var(--accent-yellow);
}

.loading-state, .empty-state {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== НИЖНЯЯ НАВИГАЦИЯ ==================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 12px 8px calc(env(safe-area-inset-bottom) + 8px);
    background: rgba(var(--bg-secondary-rgb, 26, 26, 26), 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: 0 -2px 12px var(--shadow-color);
}

.glass-effect {
    background: rgba(18, 18, 18, 0.85);
}

[data-theme="light"] .glass-effect {
    background: rgba(255, 255, 255, 0.85);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.2s;
    position: relative;
    min-width: 70px;
}

.nav-btn:active {
    transform: scale(0.95);
    background: var(--bg-card);
}

.nav-btn.active {
    color: var(--accent-yellow);
    position: relative;
}

.nav-btn.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--accent-yellow);
    border-radius: 2px 2px 0 0;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 40px;
        opacity: 1;
    }
}

/* Анимация перехода страниц */
body {
    transition: opacity 0.2s ease-out;
}

body.page-transition-out {
    opacity: 0;
}

html, body {
    overflow-x: hidden;
}

/* ==================== ПОЛНОЭКРАННЫЙ ПРОСМОТР ИЗОБРАЖЕНИЙ ==================== */

.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    background: rgba(0, 0, 0, 0.98);
}

.image-viewer.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.image-viewer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    z-index: 10001;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-viewer-close:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

.image-viewer-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
}

.image-viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.image-viewer-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    opacity: 1;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 10000;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Курсор для увеличенного изображения */
.image-viewer-container.zoomed {
    cursor: zoom-out;
}

/* Добавляем курсор pointer для изображений в модалке */
.slider-image,
.product-modal-image {
    cursor: pointer;
}

.nav-icon {
    font-size: 24px;
}

.nav-btn span {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: var(--accent-red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== ПРОФИЛЬ ==================== */

.profile-container {
    padding-bottom: 100px;
}

.profile-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-button {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 12px;
}

.back-button:active {
    background: var(--bg-card);
}

.profile-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.profile-user-info {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-secondary);
    border-radius: 0 0 24px 24px;
    margin-bottom: 20px;
}

.user-avatar-container {
    margin-bottom: 16px;
}

.user-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-yellow), #FFB800);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.avatar-placeholder {
    font-size: 48px;
    color: #000;
}

.avatar-letter {
    font-size: 42px;
    font-weight: 700;
    color: #000;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.user-username {
    font-size: 15px;
    color: var(--text-secondary);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 16px 20px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 20px 12px;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-yellow);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-section {
    padding: 0 16px;
    margin-bottom: 24px;
}

.profile-section .section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.orders-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.order-date {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.order-total {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 16px;
}

.order-total-price {
    color: var(--accent-yellow);
}

.status-pending {
    background: rgba(255, 214, 10, 0.2);
    color: var(--accent-yellow);
}

.status-completed {
    background: rgba(76, 217, 100, 0.2);
    color: #4CD964;
}

.status-cancelled {
    background: rgba(255, 59, 48, 0.2);
    color: var(--accent-red);
}

.empty-orders {
    text-align: center;
    padding: 40px 20px;
}

.empty-orders-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-orders p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.setting-item:active {
    transform: scale(0.98);
    background: var(--bg-card);
}

.setting-item svg {
    color: var(--text-secondary);
}

/* Адаптивность */
@media (min-width: 768px) {
    body {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 16px 16px 0 0;
    }
}

