:root {
    --bg-color: #1C1C1E;
    --secondary-bg-color: #2C2C2E;
    --text-color: #FFFFFF;
    --hint-color: #8E8E93;
    --accent-color: #FFD60A;
    --accent-text-color: #1C1C1E;
    --border-color: #3A3A3C;
    --font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --border-radius: 16px;
    --success-color: #34C759;
    --danger-color: #FF3B30;
    --grey-color: #8E8E93;
}

html.scroll-lock { overflow: hidden; }

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0 16px 150px;
    color: var(--text-color);
    background-color: var(--bg-color);
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}

.haptic-btn:active, .product-card:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

.app-container { max-width: 600px; margin: 0 auto; }
.header { padding: 16px 0; }
.header-main { display: flex; align-items: center; gap: 12px; }
.shop-icon { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.header-content { flex-grow: 1; }
.header-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shop-title { font-size: 22px; font-weight: 800; margin: 0; line-height: 1.2; }
.shop-subtitle { font-size: 13px; margin: 2px 0 0 0; color: var(--hint-color); }

.header-menu-btn {
    border: none; background: none; color: var(--hint-color);
    padding: 4px; cursor: pointer;
}

.search-bar-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.search-bar-container.visible {
    max-height: 100px;
    padding-top: 16px;
}
#search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    background: var(--secondary-bg-color);
    border-radius: 12px;
    color: var(--text-color);
}

.main-nav {
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: var(--bg-color);
    z-index: 990;
}
.main-tab {
    border: none; background: none; color: var(--hint-color); font-size: 17px;
    font-weight: 700; padding: 10px 0; cursor: pointer; position: relative;
    transition: color 0.2s ease;
    flex-grow: 1;
    text-align: center;
}
.main-tab.active { color: var(--text-color); }
.main-tab::after {
    content: ''; position: absolute; bottom: 0; left: 10%; right: 10%;
    height: 3px; background-color: var(--accent-color); border-radius: 1.5px;
    transform: scaleX(0); transition: transform 0.3s ease;
}
.main-tab.active::after { transform: scaleX(1); }

.wishlist-badge {
    position: absolute;
    top: 6px;
    right: 15%;
    background-color: var(--accent-color);
    color: var(--accent-text-color);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.wishlist-badge.visible {
    display: flex;
}
.wishlist-badge.has-stock {
    background-color: var(--danger-color);
    color: white;
}


.view-container { display: none; }
.view-container.active { display: block; }

.category-tabs { 
    display: flex; 
    gap: 10px; 
    overflow-x: auto; 
    padding: 16px 0; 
    scrollbar-width: none; 
    position: sticky; 
    top: 55px;
    background-color: var(--bg-color); 
    z-index: 980; 
}
.category-tabs::-webkit-scrollbar { display: none; }

.tab { padding: 10px 18px; border: none; background-color: var(--secondary-bg-color); color: var(--text-color); border-radius: 25px; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: all 0.2s ease; border: 1px solid var(--border-color); }
.tab.active { background-color: var(--accent-color); color: var(--accent-text-color); border-color: var(--accent-color); }
#loader { text-align: center; padding: 30px; font-size: 16px; color: var(--hint-color); grid-column: 1 / -1; }

.feed-category-title {
    font-size: 22px;
    font-weight: 800;
    padding: 24px 0 16px 0;
    margin: 0;
    background-color: var(--bg-color);
    position: sticky;
    top: 120px;
    z-index: 970;
}

#product-grid { display: block; }
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.product-card { display: flex; flex-direction: column; background-color: var(--secondary-bg-color); border-radius: var(--border-radius); overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.1); transition: transform 0.2s ease; cursor: pointer; position: relative; }
.product-card__image-wrapper { width: 100%; aspect-ratio: 1/1; position: relative; }
.product-card__image { width: 100%; height: 100%; object-fit: cover; }
.product-card__info { padding: 12px; display: flex; flex-direction: column; flex-grow: 1; }
.product-card__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px 0;
    flex-grow: 1;
    height: auto;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 42px;
}
.product-card__price { font-size: 16px; font-weight: 800; margin: 0; }
.product-card__footer { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; }
.product-card__details { font-size: 13px; color: var(--hint-color); margin: 0; }
.product-card__stock { font-size: 13px; font-weight: 700; margin: 0; color: var(--hint-color); }
.product-card__stock.low-stock { color: var(--danger-color); }
.product-card__stock.on-order { font-style: italic; }

.product-card__add-btn { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; background-color: var(--secondary-bg-color); box-shadow: 0 4px 10px rgba(0,0,0,0.25); border-radius: 50%; border: none; color: var(--text-color); font-size: 28px; font-weight: 400; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.product-card__notify-btn { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; background-color: var(--secondary-bg-color); box-shadow: 0 4px 10px rgba(0,0,0,0.25); border-radius: 50%; border: none; color: var(--text-color); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.product-card__controls { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; justify-content: space-between; height: 36px; border-radius: 18px; background-color: rgba(44,44,46,0.8); backdrop-filter: blur(8px); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.product-card__controls button { width: 36px; height: 36px; border: none; background: none; color: var(--text-color); font-size: 22px; font-weight: 600; cursor: pointer; border-radius: 50%; }
.product-card__controls .qty { font-size: 15px; font-weight: 700; min-width: 24px; text-align: center; }

.favorite-btn { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; background: rgba(0,0,0,0.3); backdrop-filter: blur(5px); border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 5; }
.favorite-btn svg { width: 22px; height: 22px; fill: none; stroke: white; stroke-width: 2px; transition: all 0.2s ease; }
.favorite-btn.active svg { fill: var(--danger-color); stroke: var(--danger-color); }
#modal-favorite-btn { position: static; background: none; backdrop-filter: none; }
#modal-favorite-btn svg { width: 28px; height: 28px; }

.modal-container { position: fixed; inset: 0; z-index: 1000; display: none; align-items: flex-end; }
.modal-container.visible { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade-in 0.3s ease; }
.modal-content { background: var(--secondary-bg-color); width: 100%; max-height: 95vh; border-radius: var(--border-radius) var(--border-radius) 0 0; box-sizing: border-box; display: flex; flex-direction: column; animation: slide-up 0.35s ease-out; position: relative; z-index: 2; }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-container.centered {
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content.popover {
    width: 100%;
    max-width: 380px;
    border-radius: 16px; /* более скруглённые нижние углы */
    animation: fade-in 0.3s ease;
    max-height: 90vh;
}
.wishlist-content {
    padding: 24px;
    text-align: center;
}
.wishlist-content__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: calc(var(--border-radius) - 8px);
    margin-bottom: 16px;
}
.wishlist-content h3 {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 8px 0;
}
.wishlist-content .info {
    font-size: 15px;
    line-height: 1.5;
    color: var(--hint-color);
    margin: 0;
}
#wishlist-modal .modal-close-btn {
    top: 12px;
    right: 12px;
}

.modal-close-btn { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border: none; border-radius: 50%; background: rgba(0,0,0,0.5); color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 5; }
.modal-scroll-content { overflow-y: auto; flex-grow: 1; }
.modal-footer { display: flex; flex-direction: column; padding: 16px; border-top: 1px solid var(--border-color); gap: 12px; margin-top: auto; background-color: var(--secondary-bg-color); flex-shrink: 0; }
.quantity-control { display: flex; align-items: center; justify-content: center; background-color: var(--bg-color); border: 1px solid var(--border-color); border-radius: 12px; }
.quantity-btn { width: 56px; height: 48px; border: none; background: none; font-size: 24px; color: var(--text-color); }
.quantity-text { font-size: 18px; font-weight: 700; min-width: 40px; text-align: center; }
.modal-main-button { width: 100%; height: 52px; background-color: var(--accent-color); color: var(--accent-text-color); border: none; border-radius: 12px; font-size: 17px; font-weight: 700; }
#product-modal .modal-image-wrapper { width: 100%; aspect-ratio: 16/10; position: relative; }
#product-modal img { width: 100%; height: 100%; object-fit: cover; }
#product-carousel { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 16px; }
#product-carousel .carousel-track { display: flex; height: 100%; transition: transform 0.3s ease; }
#product-carousel .carousel-slide { min-width: 100%; height: 100%; }
#product-carousel .carousel-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
#product-carousel .carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.35); color: #fff; border: none; width: 36px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center; z-index: 3; }
#product-carousel .carousel-arrow.left { left: 8px; }
#product-carousel .carousel-arrow.right { right: 8px; }
#product-modal .modal-text-content { padding: 20px; }
#product-modal .modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
#product-modal h2 { flex-grow: 1; font-size: 24px; font-weight: 800; margin: 0 0 8px 0; }
#product-modal p { font-size: 16px; color: var(--hint-color); line-height: 1.5; margin: 0 0 12px 0; }
.modal-details-row { display: flex; justify-content: space-between; align-items: center; }
.modal-details-text { color: var(--text-color); font-weight: 600; }
.modal-stock-text { font-size: 14px; font-weight: 700; color: var(--hint-color); }
.modal-stock-text.low-stock { color: var(--danger-color); }
.modal-stock-text.on-order { font-style: italic; }

.bottom-ui-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 998;
    display: none;
    padding: 0 16px calc(12px + env(safe-area-inset-bottom));
    pointer-events: none;
}
.bottom-ui-container.visible {
    display: block;
}
#floating-cart-btn {
    position: absolute;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: auto;
    min-width: 64px;
    height: 64px;
    background-color: var(--accent-color);
    border-radius: 32px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    pointer-events: auto;
    cursor: pointer;
    padding: 0 20px;
    gap: 8px;
}
#floating-cart-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-text-color);
    stroke: var(--accent-text-color);
}
#floating-cart-total {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent-text-color);
}

#cart-view .modal-content { 
    height: 90vh; 
    overscroll-behavior: contain; 
    display: flex;
    flex-direction: column;
    overflow-anchor: auto; /* позволяем анчоринг внутри модалки */
}
#cart-view .modal-scroll-content { 
    /* это уже есть, но явно добавим якоринг */
    overflow-anchor: auto;
}
#cart-add-more-container, #cart-add-more-container .add-more-grid {
    overflow-anchor: none; /* не использовать элементы рекомендаций как якоря, чтобы не тянуло контент вверх */
}
#cart-view .cart-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
#cart-view h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}
#cart-close-btn {
    position: absolute; 
    right: 16px;
    background: none;
    backdrop-filter: none;
    color: var(--hint-color);
}

#cart-items-container { padding: 0 16px; }
.cart-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-color); cursor: pointer; }
.cart-item:last-child { border-bottom: none; }
.cart-item__image { width: 64px; height: 64px; object-fit: cover; border-radius: var(--border-radius); }
.cart-item__info { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; }
.cart-item__title { font-weight: 700; font-size: 16px; }
.cart-item__details { font-size: 14px; color: var(--hint-color); }
.cart-item .quantity-control { margin-left: auto; height: 36px; border-radius: 18px; background-color: var(--bg-color); flex-shrink: 0; }
.cart-item .quantity-btn { width: 36px; height: 36px; font-size: 20px; }
.cart-item .quantity-text { font-size: 15px; min-width: 20px; }
.cart-item .quantity-btn.disabled { opacity: 0.45; filter: grayscale(100%); cursor: not-allowed; }
.cart-item .quantity-btn { width: 40px; height: 40px; }
.cart-summary-total { 
    display: flex; 
    justify-content: space-between; 
    align-items: baseline; 
    font-weight: 700; 
    padding: 12px 16px; 
    background-color: var(--secondary-bg-color);
    flex-shrink: 0;
    position: sticky; /* Прилипает к верху скролл-контейнера */
    top: 0;
    z-index: 2;
    border-bottom: 1px solid var(--border-color);
}
#cart-footer { 
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    margin-top: 0;
    padding: 16px;
}
#cart-footer .modal-main-button {
    height: 52px;
}

#cart-add-more-container { padding: 16px; border-top: 8px solid var(--bg-color); }
#cart-add-more-container h3 { font-size: 18px; font-weight: 800; margin: 0 0 16px 0; }
.add-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.add-more-card { background: var(--bg-color); border-radius: 18px; overflow: hidden; cursor: pointer; transition: transform .08s ease, box-shadow .15s ease; display: flex; flex-direction: column; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.add-more-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-bottom: 0; }
.add-more-card__image-wrapper { position: relative; }
.add-more-card__add-btn { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 16px; border: none; background: #fff; color: #111; font-size: 24px; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.add-more-card .product-card__controls { left: 12px; right: 12px; bottom: 12px; border-radius: 20px; }

.add-more-card__info { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1 1 auto; }
.add-more-card__price { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.add-more-card__title { font-size: 14px; font-weight: 700; line-height: 1.3; min-height: 54px; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.add-more-card__bottom { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.add-more-card__unit { font-size: 12px; color: var(--hint-color); }
.add-more-card__stock { font-size: 12px; color: var(--hint-color); }
.add-more-card__stock.low { color: #ff6b6b; font-weight: 700; }

/* badge В корзине */
.add-more-card.in-cart::before { content: 'В корзине'; position: absolute; left: 10px; top: 10px; background: #FFD60A; color: #1C1C1E; font-weight: 800; font-size: 11px; padding: 4px 8px; border-radius: 8px; }
/* Нижняя часть как колонка слева */
.add-more-card__bottom { display: grid; grid-template-columns: 1fr 36px; gap: 10px; align-items: end; }
.add-more-card__stack { display: flex; flex-direction: column; gap: 4px; }
.add-more-card__price { font-size: 14px; font-weight: 700; }
.add-more-card__unit, .add-more-card__stock { font-size: 12px; color: var(--hint-color); }

#queue-list { display: flex; flex-direction: column; gap: 12px; padding-top: 16px;}
.wishlist-item { display: flex; align-items: center; gap: 12px; background-color: var(--secondary-bg-color); padding: 12px; border-radius: var(--border-radius); cursor: pointer; }
.wishlist-item__image { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.wishlist-item__info { flex-grow: 1; }
.wishlist-item__title { font-size: 16px; font-weight: 700; }
.wishlist-item__details { font-size: 14px; color: var(--hint-color); margin-top: 4px; }
.wishlist-item__delete-btn { width: 44px; height: 44px; border: none; background: var(--bg-color); color: var(--hint-color); border-radius: 50%; flex-shrink: 0; }

.page { position: fixed; inset: 0; background-color: var(--bg-color); z-index: 2000; display: none; flex-direction: column; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    flex-shrink: 0;
}
.page-header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.page-back-btn { position: absolute; left: 16px; border: none; background: none; color: var(--text-color); }
.page-content { overflow-y: auto; padding: 12px 16px; flex-grow: 1; }

.checkout-section { margin-bottom: 20px; }
.checkout-section h3 { font-size: 16px; font-weight: 800; margin: 0 0 12px 0; }
#checkout-items-summary { display: flex; flex-direction: column; gap: 10px; }
.checkout-item { display: flex; align-items: center; gap: 10px; }
.checkout-item__image { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.checkout-item__info { flex-grow: 1; }
.checkout-item__title { font-size: 15px; font-weight: 600; }
.checkout-item__details { font-size: 13px; color: var(--hint-color); white-space: nowrap; }
.checkout-item__total { font-size: 15px; font-weight: 700; white-space: nowrap; }

.form-input-group, .form-input-row { display: flex; gap: 10px; }
.form-input-group { flex-direction: column; }
.form-input { display: flex; flex-direction: column; width: 100%; }
.form-input label { font-size: 12px; color: var(--hint-color); margin-bottom: 4px; padding-left: 4px; }
.form-input input, .form-input textarea, .form-input select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    background: var(--secondary-bg-color);
    border-radius: 10px;
    color: var(--text-color);
    font-family: inherit;
}
.form-input select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%238E8E93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.form-input textarea { resize: vertical; min-height: 70px; }

/* Удалено - заменено новым дизайном ниже */
/* Старые стили удалены - используется новый дизайн */
.delivery-conditions {
    list-style: none;
    padding: 0 0 0 16px;
    margin: 0 0 20px 0;
    font-size: 14px;
    color: var(--hint-color);
}
.delivery-conditions li {
    position: relative;
    padding-left: 10px;
    margin-bottom: 4px;
}
.delivery-conditions li::before {
    content: '•';
    position: absolute;
    left: -10px;
    color: var(--accent-color);
}


.payment-method-mini { display: flex; flex-direction: column; gap: 8px; }
.payment-option-mini { display: flex; align-items: center; background: var(--secondary-bg-color); padding: 14px; border-radius: 12px; }
.payment-option-mini input { margin-right: 12px; }
#change-from-container { margin-top: 12px; }
#change-from-container input { background: var(--secondary-bg-color); }

.delivery-toggle { display: flex; background: var(--secondary-bg-color); border-radius: 12px; padding: 4px; }
.delivery-toggle label { flex: 1; }
.delivery-toggle input { display: none; }
.delivery-toggle span { display: block; text-align: center; padding: 8px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.delivery-toggle input:checked + span { background: var(--bg-color); }

.pickup-info { background: var(--secondary-bg-color); padding: 12px; border-radius: 12px; margin-bottom: 12px; }
.pickup-info p { margin: 4px 0; font-size: 14px; }

.checkout-receipt { background: var(--secondary-bg-color); border-radius: 12px; padding: 12px; font-size: 15px; }
.receipt-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.receipt-row:last-child { margin-bottom: 0; }
.receipt-row.total { font-weight: 800; font-size: 17px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-color); }

#header-menu-modal .modal-content {
    border-radius: var(--border-radius);
    padding: 8px;
}
.header-menu-list {
    display: flex;
    flex-direction: column;
}
.header-menu-item {
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 12px;
}
.header-menu-item:active {
    background-color: var(--border-color);
}

/* Orders redesigned */
#orders-list { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.order-card {
  position: relative;
  background: var(--secondary-bg-color);
  border-radius: 12px;
  padding: 18px 12px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border: 1px solid var(--border-color);
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.order-card:active { transform: translateY(1px); }
.order-status-pill {
  position: absolute;
  top: 8px; right: 8px;
  padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800;
}
.order-head { display: flex; justify-content: space-between; align-items: center; }
.order-title { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.order-total { font-size: 16px; font-weight: 800; }
.order-thumbs-plate { background: rgba(0,0,0,.22); padding: 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,.06); overflow: hidden; }
.order-thumbs { display: flex; gap: 8px; margin: 10px 0 8px; }
.order-thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--bg-color); flex: 0 0 auto; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.order-thumb.more { display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--text-color); background: var(--bg-color); }
.order-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.06); margin-top: 2px; }
.order-date { font-size: 12px; color: var(--hint-color); margin-top: 6px; }

/* Status colors */
.badge.new { background: #2563EB; color: #fff; }
.badge.processing { background: #F59E0B; color: #1C1C1E; }
.badge.delivering { background: #10B981; color: #062e23; }
.badge.completed { background: #16A34A; color: #fff; }
.badge.cancelled { background: #EF4444; color: #fff; }

/* Filters */
#order-filters { display: flex; gap: 8px; padding: 12px 16px 0; position: sticky; top: 56px; background: var(--bg-color); z-index: 960; }
.filter-btn { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-color); background: var(--secondary-bg-color); color: var(--text-color); font-weight: 700; font-size: 13px; }
.filter-btn.active { background: var(--bg-color); border-color: var(--accent-color); }
.filter-btn:active { transform: translateY(1px); }

/* Buttons */
.btn-dark { background: #2a2a2a; color: #fff; border: 1px solid #3a3a3a; border-radius: 12px; padding: 10px 14px; font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.copy-id { border: none; background: none; color: var(--hint-color); font-size: 13px; line-height: 1; cursor: pointer; }
.copy-id:active { transform: translateY(1px); }
.order-id { cursor: pointer; position: relative; transition: color .15s ease; font-weight: 800; }
.order-id.copied { color: var(--accent-color); }

/* Order details modal */
.order-details-content { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.order-modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.order-modal-title-group { display: flex; align-items: center; gap: 8px; }
.order-modal-title { font-size: 18px; font-weight: 800; }
.order-modal-status { font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.order-modal-meta { font-size: 12px; color: var(--hint-color); }

.od-card { background: rgba(0,0,0,.18); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; }
.od-card-title { font-size: 14px; font-weight: 800; margin-bottom: 8px; color: var(--hint-color); }
.od-items { display: flex; flex-direction: column; gap: 10px; }
.od-item { display: grid; grid-template-columns: 56px 1fr; gap: 10px; }
.od-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--bg-color); }
.od-title { font-size: 15px; font-weight: 700; }
.od-sub { font-size: 13px; color: var(--hint-color); }
.od-card.total .od-row { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.od-row span { color: var(--hint-color); }
.od-row b { font-size: 16px; }

/* Timeline */
.od-timeline { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.od-timeline-item { display: grid; grid-template-columns: 12px 1fr; gap: 8px; align-items: start; }
.od-timeline-item .dot { width: 8px; height: 8px; background: var(--accent-color); border-radius: 50%; margin-top: 6px; }
.od-timeline-item .text { font-size: 13px; color: var(--text-color); }

/* Orders list — small spacing + proper space after label */
.order-total-row span { margin-right: 4px; }
.od-row { font-size: 13px; color: var(--hint-color); }

.product-card__controls button.disabled,
.product-card__add-btn.disabled,
.add-more-card__add-btn.disabled {
  opacity: 0.45;
  filter: grayscale(100%);
  cursor: not-allowed;
}

/* Увеличенная зона клика для плюсиков и кнопок контролов */
.product-card__add-btn { width: 48px; height: 48px; border-radius: 50%; }
.product-card__controls button { width: 40px; height: 40px; }
.add-more-card__add-btn { width: 48px; height: 48px; }
.add-more-card .product-card__controls button { width: 40px; height: 40px; }

.address-card { display: flex; justify-content: space-between; align-items: center; background: var(--secondary-bg-color); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; margin: 12px 0; }
.address-card__main { display: flex; flex-direction: column; gap: 2px; max-width: calc(100% - 120px); }
.address-card__title { font-size: 14px; font-weight: 800; }
.address-card__text { font-size: 13px; color: var(--hint-color); }
.address-card__prices { margin-top: 8px; }
.address-card__prices .prices-title { font-size: 12px; color: var(--hint-color); }
.address-card__prices ul { margin: 4px 0 0 16px; padding: 0; }
.address-card__prices li { font-size: 12px; color: var(--hint-color); }

/* Убедимся, что кнопка «Изменить» над кликабельной зоной */
#address-edit-btn { position: relative; z-index: 1; }
.address-card__row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.address-card__zone-label { font-size: 13px; color: var(--hint-color); }
.address-card__zone-select { background: var(--bg-color); color: var(--text-color); border: 1px solid var(--border-color); border-radius: 8px; padding: 6px 8px; }
#address-modal .modal-content.popover { max-width: 420px; }
#address-modal .modal-footer { gap: 10px; }

.checkout-page-footer { position: fixed; left: 0; right: 0; bottom: 0; background: var(--secondary-bg-color); border-top: 1px solid var(--border-color); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 2200; }
.checkout-page-footer .modal-main-button { width: 100%; height: 56px; background: var(--accent-color); color: var(--accent-text-color); }

.delivery-prices { margin-top: 6px; }
.delivery-prices .prices-title { font-size: 12px; color: var(--hint-color); }
.delivery-prices ul { margin: 4px 0 0 16px; padding: 0; }
.delivery-prices li { font-size: 12px; color: var(--hint-color); }

/* Z-index корректировки для окна адреса */
#checkout-page { position: fixed; inset: 0; z-index: 2100; display: none; flex-direction: column; }
.page-content { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.page-content { padding-bottom: 88px; }
#address-modal { z-index: 2200; }
#address-modal .modal-backdrop { z-index: 2201; }
#address-modal .modal-content { z-index: 2202; max-height: 80vh; }

/* Компактный стиль для модального окна адреса */
#address-modal .form-input-group { gap: 8px; }
#address-modal .form-input { margin-bottom: 8px; }
#address-modal .form-input label { font-size: 12px; margin-bottom: 4px; }
#address-modal .form-input input, #address-modal .form-input select, #address-modal .form-input textarea { 
    padding: 12px 14px; 
    font-size: 15px; 
    border: 1px solid var(--border-color); 
    background: var(--secondary-bg-color); 
    border-radius: 12px; 
    height: 48px;
}
#address-modal .form-row { gap: 8px; }
#address-modal .modal-footer { padding: 12px; gap: 8px; }

/* Новый упрощённый блок адресных полей */
.addr-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; width: 100%; max-width: 100%; box-sizing: border-box; }
.addr-field { display: flex; flex-direction: column; min-width: 0; }
.addr-field label { font-size: 12px; color: var(--hint-color); margin-bottom: 4px; padding-left: 2px; }
.addr-field input { height: 48px; padding: 12px 14px; font-size: 15px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--secondary-bg-color); color: var(--text-color); box-sizing: border-box; }

/* Старый дизайн удален - заменен на .new-delivery-card */
.cart-delivery-info {
    display: none !important;
}

/* Верхняя часть: иконка + заголовок + цена */
.delivery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    order: 1;
    width: 100%;
}

.delivery-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.delivery-icon {
    color: var(--text-color);
    flex-shrink: 0;
}

.delivery-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 15px;
}

/* Строка времени и дней */
.delivery-schedule {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    order: 2;
    width: 100%;
    justify-content: flex-start;
}

.delivery-time {
    color: var(--text-color);
    font-size: 14px;
}

.delivery-days {
    color: #FFD700;
    font-weight: 500;
    font-size: 14px;
}

/* Ценник - белый на чёрном */
.delivery-price {
    background: #000000;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
}

/* Секция стоимости доставки */
.delivery-costs {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    width: 100%;
    order: 3;
}

.delivery-costs__title {
    font-size: 13px;
    color: var(--hint-color);
    margin-bottom: 8px;
    order: 1;
}

.delivery-zone {
    font-size: 12px;
    color: var(--hint-color);
    position: relative;
    padding-left: 12px;
    line-height: 1.4;
    margin-bottom: 4px;
    order: 2;
    width: 100%;
}

.delivery-zone::before {
    content: '•';
    color: #FFD700;
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
}

.delivery-zone strong {
    color: var(--text-color);
}

/* Новая карточка доставки - пересобрана с нуля */
.new-delivery-card {
    background: var(--secondary-bg-color) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin: 12px 0 20px 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    display: block !important;
    visibility: visible !important;
}

/* Визуальное разделение после карточки доставки */
.new-delivery-card::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* Главная строка: иконка + текст + цена */
.delivery-main-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.delivery-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.delivery-svg {
    color: var(--hint-color);
    flex-shrink: 0;
}

.delivery-text {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-color);
}

.delivery-price-badge {
    background: #3a3a3a;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
}

/* Строка времени */
.delivery-time-line {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 10px;
}

.delivery-time-row { display: flex; align-items: center; gap: 8px; }
.delivery-time-note { font-size: 12px; color: var(--hint-color); margin-top: -2px; line-height: 1; }
.delivery-time-row .delivery-time { font-family: 'Nunito', sans-serif; font-weight: 700; letter-spacing: .2px; }

.delivery-time {
    font-size: 16px;
    color: var(--text-color);
}

.delivery-days {
    font-size: 16px;
    color: #FFD700;
    font-weight: 700;
}

/* Зоны доставки */
.delivery-zones {
    margin-top: 6px;
}

.zones-title {
    font-size: 15px;
    color: var(--hint-color);
    margin-bottom: 6px;
}

.zone-item { font-size: 14px; color: var(--hint-color); margin-bottom: 4px; line-height: 1.4; position: relative; padding-left: 14px; }
.zone-item.selected { color: #ffffff; font-weight: 700; }
.zone-item.selected::before { color: #FFD700; }

.zone-item::before {
    content: '•';
    color: #FFD700;
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    font-size: 16px;
}

.zone-item strong { font-weight: 700; color: inherit; }



/* Улучшенная карточка адреса */
.address-card {
    background: var(--secondary-bg-color);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.address-card__header {
    margin-bottom: 12px;
}

.address-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

.address-card__content { margin-bottom: 6px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }

.address-card__address { margin-bottom: 6px; }
.address-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; }
.address-chip { background: transparent; border: none; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.address-chip__label { font-size: 11px; color: var(--hint-color); line-height: 1.1; }
.address-chip__value { font-size: 14px; color: var(--text-color); font-weight: 700; line-height: 1.2; }

.address-card__zone { font-size: 12px; color: #000; background: #FFD700; padding: 4px 8px; border-radius: 8px; display: inline-block; font-weight: 800; }

.zone-name-badge { display: none; }

.address-card__footer { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.address-card__footer-left { display: flex; flex-direction: column; gap: 4px; }
.address-card__zone-label { font-size: 12px; color: var(--hint-color); }
.address-card__footer #address-edit-btn { justify-self: end; align-self: end; }
.address-card__footer-left { display: flex; flex-direction: column; gap: 4px; justify-self: start; align-self: end; }

.address-card__footer .btn { background: #2a2a2a; color: #fff; border: 1px solid #3a3a3a; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 700; letter-spacing: .2px; box-shadow: none; transition: opacity .15s ease; }

/* Админ панель - улучшения */

/* Маленькие группы полей для БЖУ */
.nutrition-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: end;
}

.form-group-small {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group-small label {
    font-size: 12px;
    font-weight: 600;
    color: var(--hint-color);
    margin: 0;
}

.form-group-small input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--secondary-bg-color);
    color: var(--text-color);
    font-size: 14px;
}

/* Модальные окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-dialog {
    background: var(--bg-color);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    z-index: 1001;
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    padding: 20px 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
}

.modal-close {
    background: var(--secondary-bg-color);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-color);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 0 20px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Кнопки в модалках */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn.primary {
    background: var(--accent-color);
    color: var(--accent-text-color);
}

.btn.secondary {
    background: var(--secondary-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn.orange {
    background: #FF8C00;
    color: white;
}

.btn.orange:hover {
    background: #FF7F00;
}

/* Карточки товаров в списке */
.product-card {
    background: var(--secondary-bg-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 12px;
    align-items: start;
}

.product-card-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--border-color);
}

.product-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.product-card-description {
    font-size: 14px;
    color: var(--hint-color);
    line-height: 1.3;
    margin: 0;
}

.product-card-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-color);
    margin: 4px 0 0;
}

.product-card-stock {
    font-size: 12px;
    color: var(--hint-color);
}

.product-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Сортировка категорий */
.category-item {
    background: var(--secondary-bg-color);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.category-order {
    background: var(--border-color);
    color: var(--hint-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.category-actions {
    display: flex;
    gap: 8px;
}

.sort-btn {
    background: var(--border-color);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
}

.sort-btn:hover {
    background: var(--accent-color);
    color: var(--accent-text-color);
}

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

/* Склад - улучшенный layout */
.stock-item {
    background: var(--secondary-bg-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 1fr auto 60px auto;
    gap: 12px;
    align-items: center;
}

.stock-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.stock-variant {
    font-size: 14px;
    color: var(--hint-color);
}

.stock-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stock-btn {
    background: var(--border-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
}

.stock-btn:hover {
    background: var(--accent-color);
    color: var(--accent-text-color);
}

.stock-quantity {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    min-width: 60px;
}

.stock-btn-plus {
    margin-left: auto;
}
.address-card__footer .btn:hover { opacity: .95; }