* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --bg-primary: #f5f7fa;
            --bg-secondary: #ffffff;
            --border-light: #dbe4ee;
            --border-hover: #a0c4e2;
            --accent-blue: #5b9bd5;
            --accent-light: #e8f0fe;
            --text-primary: #2c3e50;
            --text-secondary: #6b7b8b;
            --text-light: #95a5a6;
            --success: #2ecc71;
            --warning: #f39c12;
            --danger: #e74c3c;
            --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
            --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.02);
            --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.08);
            --header-height: 56px;
            --bottom-nav-height: 64px;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background-color: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.4;
            font-weight: 400;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        h1, h2, h3, h4 {
            font-weight: 500;
            letter-spacing: -0.01em;
        }

        /* ===== HEADER ===== */
        .header {
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-light);
            padding: 0 12px;
            height: var(--header-height);
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: sticky;
            top: 0;
            z-index: 100;
            backdrop-filter: blur(8px);
            background: rgba(255, 255, 255, 0.92);
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .logo-icon {
            font-size: 22px;
            color: var(--accent-blue);
        }

        .logo-text {
            font-size: 18px;
            font-weight: 400;
            color: var(--text-primary);
            letter-spacing: -0.02em;
        }

        .logo-text span {
            font-weight: 300;
            color: var(--text-light);
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .header-actions a {
            color: var(--text-secondary);
            font-size: 18px;
            transition: all 0.2s ease;
            text-decoration: none;
            position: relative;
        }

        .cart-badge {
            position: relative;
        }

        .cart-count {
            position: absolute;
            top: -6px;
            right: -8px;
            background: var(--accent-blue);
            color: white;
            font-size: 10px;
            font-weight: 400;
            width: 16px;
            height: 16px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid white;
        }

        .desktop-nav {
            display: none;
        }

        .search-wrapper {
            display: none;
        }

        .header-left {
            display: flex;
            align-items: center;
        }

        .back-btn {
            color: var(--text-secondary);
            font-size: 20px;
            margin-right: 12px;
            text-decoration: none;
        }

        /* ===== ОСНОВНОЙ КОНТЕНТ ===== */
        .main-content {
            max-width: 1200px;
            margin: 0 auto;
            width: 100%;
            padding: 0 0 20px;
            flex: 1;
        }

        /* Заголовок корзины */
        .cart-header {
            padding: 16px 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid var(--border-light);
            background: var(--bg-secondary);
        }

        .cart-title {
            font-size: 20px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .cart-count-badge {
            background: var(--accent-light);
            color: var(--accent-blue);
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 13px;
            font-weight: 400;
        }

        .clear-cart-btn {
            color: var(--text-light);
            font-size: 13px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .clear-cart-btn:hover {
            color: var(--danger);
        }

        /* Сообщение о бесплатной доставке */
        .free-shipping-banner {
            background: linear-gradient(135deg, #e8f0fe 0%, #dbeafe 100%);
            padding: 12px;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 10px;
            border-bottom: 1px solid var(--border-light);
        }

        .free-shipping-icon {
            width: 40px;
            height: 40px;
            background: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--accent-blue);
            font-size: 18px;
        }

        .free-shipping-text {
            flex: 1;
            font-size: 13px;
        }

        .free-shipping-progress {
            margin-top: 6px;
            height: 4px;
            background: rgba(91, 155, 213, 0.2);
            border-radius: 2px;
        }

        .free-shipping-bar {
            width: 65%;
            height: 100%;
            background: var(--accent-blue);
            border-radius: 2px;
        }

        /* Список товаров */
        .cart-items {
            background: var(--bg-secondary);
            margin-bottom: 8px;
        }

        .cart-item {
            display: flex;
            gap: 12px;
            padding: 16px 12px;
            border-bottom: 1px solid var(--border-light);
            position: relative;
        }

        .cart-item-checkbox {
            display: flex;
            align-items: flex-start;
            padding-top: 4px;
        }

        .cart-item-checkbox input {
            width: 20px;
            height: 20px;
            accent-color: var(--accent-blue);
            cursor: pointer;
        }

        .cart-item-image {
            width: 80px;
            height: 80px;
            background: var(--bg-primary);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .cart-item-image i {
            font-size: 36px;
            color: var(--accent-blue);
            opacity: 0.7;
        }

        .cart-item-info {
            flex: 1;
            min-width: 0;
        }

        .cart-item-title {
            font-size: 14px;
            font-weight: 500;
            margin-bottom: 4px;
            line-height: 1.3;
            padding-right: 30px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .cart-item-meta {
            font-size: 11px;
            color: var(--text-light);
            margin-bottom: 8px;
        }

        .cart-item-price {
            display: flex;
            align-items: baseline;
            gap: 8px;
            margin-bottom: 8px;
        }

        .current-price {
            font-size: 16px;
            font-weight: 500;
            color: var(--accent-blue);
        }

        .old-price {
            font-size: 12px;
            color: var(--text-light);
            text-decoration: line-through;
        }

        .cart-item-actions {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .quantity-control {
            display: flex;
            align-items: center;
            gap: 2px;
            background: var(--bg-primary);
            border-radius: 20px;
            border: 1px solid var(--border-light);
        }

        .quantity-btn {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 14px;
            cursor: pointer;
            border-radius: 20px;
        }

        .quantity-btn:active {
            background: var(--border-light);
        }

        .quantity-input {
            width: 40px;
            text-align: center;
            border: none;
            background: none;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-primary);
            outline: none;
        }

        .cart-item-total {
            font-weight: 500;
            font-size: 14px;
            color: var(--text-primary);
        }

        .remove-item {
            position: absolute;
            top: 16px;
            right: 12px;
            color: var(--text-light);
            font-size: 16px;
            cursor: pointer;
            padding: 4px;
        }

        .remove-item:hover {
            color: var(--danger);
        }

        /* Избранное в корзине */
        .save-for-later {
            font-size: 12px;
            color: var(--accent-blue);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .save-for-later i {
            font-size: 12px;
        }

        /* Блок с промокодом */
        .promo-section {
            background: var(--bg-secondary);
            padding: 16px 12px;
            margin-bottom: 8px;
        }

        .promo-title {
            font-size: 14px;
            font-weight: 500;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .promo-input-wrapper {
            display: flex;
            gap: 8px;
        }

        .promo-input {
            flex: 1;
            padding: 12px 16px;
            border: 1px solid var(--border-light);
            border-radius: 12px;
            font-size: 14px;
            background: var(--bg-primary);
            outline: none;
        }

        .promo-input:focus {
            border-color: var(--accent-blue);
        }

        .promo-btn {
            padding: 12px 20px;
            background: var(--accent-blue);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            white-space: nowrap;
        }

        .promo-applied {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 12px;
            padding: 10px 12px;
            background: var(--success);
            color: white;
            border-radius: 12px;
            font-size: 13px;
        }

        .promo-applied i {
            cursor: pointer;
        }

        /* Доставка */
        .delivery-section {
            background: var(--bg-secondary);
            padding: 16px 12px;
            margin-bottom: 8px;
        }

        .section-title {
            font-size: 14px;
            font-weight: 500;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .delivery-option {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 12px 0;
            border-bottom: 1px solid var(--border-light);
            cursor: pointer;
        }

        .delivery-option:last-child {
            border-bottom: none;
        }

        .delivery-radio {
            padding-top: 2px;
        }

        .delivery-radio input {
            width: 18px;
            height: 18px;
            accent-color: var(--accent-blue);
        }

        .delivery-info {
            flex: 1;
        }

        .delivery-name {
            font-size: 14px;
            font-weight: 500;
            margin-bottom: 2px;
        }

        .delivery-desc {
            font-size: 12px;
            color: var(--text-light);
        }

        .delivery-price {
            font-size: 14px;
            font-weight: 500;
            color: var(--text-primary);
        }

        .delivery-price.free {
            color: var(--success);
        }

        /* Способ оплаты */
        .payment-section {
            background: var(--bg-secondary);
            padding: 16px 12px;
            margin-bottom: 8px;
        }

        /* Оплата с баланса (вместо выбора способов) */
        .balance-payment-banner {
            background: linear-gradient(135deg, #ecfdf3 0%, #dcfce7 100%);
            border: 1px solid rgba(46, 204, 113, 0.25);
            padding: 16px 12px;
            margin-bottom: 8px;
            border-radius: 16px;
        }

        .balance-payment-title {
            font-size: 14px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 10px;
            color: #166534;
        }

        .balance-payment-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 6px 0;
            font-size: 13px;
        }

        .balance-payment-label {
            color: rgba(22, 101, 52, 0.75);
        }

        .balance-payment-value {
            font-weight: 500;
            color: #14532d;
        }

        .balance-payment-hint {
            margin-top: 10px;
            font-size: 12px;
            color: rgba(22, 101, 52, 0.8);
        }

        .balance-payment-hint a {
            color: #166534;
            text-decoration: none;
            font-weight: 500;
            border-bottom: 1px dashed rgba(22, 101, 52, 0.45);
        }

        .payment-option {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 0;
            border-bottom: 1px solid var(--border-light);
            cursor: pointer;
        }

        .payment-option:last-child {
            border-bottom: none;
        }

        .payment-icon {
            width: 32px;
            height: 32px;
            background: var(--bg-primary);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--accent-blue);
            font-size: 16px;
        }

        .payment-name {
            flex: 1;
            font-size: 14px;
        }

        /* Итого */
        .summary-section {
            background: var(--bg-secondary);
            padding: 16px 12px;
            margin-bottom: 8px;
        }

        .summary-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            font-size: 14px;
        }

        .summary-label {
            color: var(--text-secondary);
        }

        .summary-value {
            font-weight: 500;
        }

        .summary-discount {
            color: var(--success);
        }

        .summary-total {
            display: flex;
            justify-content: space-between;
            padding: 16px 0 8px;
            margin-top: 8px;
            border-top: 1px solid var(--border-light);
            font-size: 16px;
            font-weight: 500;
        }

        .total-price {
            font-size: 22px;
            color: var(--accent-blue);
        }

        /* Кнопка оформления */
        .checkout-section {
            padding: 12px;
        }

        .checkout-btn {
            width: 100%;
            padding: 16px;
            background: var(--accent-blue);
            color: white;
            border: none;
            border-radius: 16px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-bottom: 12px;
        }

        .checkout-btn:hover {
            background: #4a8bc7;
        }

        .checkout-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }

        .agree-text {
            text-align: center;
            font-size: 11px;
            color: var(--text-light);
        }

        .agree-text a {
            color: var(--accent-blue);
            text-decoration: none;
        }

        /* Сохранённые товары */
        .saved-section {
            background: var(--bg-secondary);
            margin-top: 8px;
            padding: 16px 12px;
        }

        .saved-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
        }

        .saved-title {
            font-size: 14px;
            font-weight: 500;
        }

        .saved-grid {
            display: flex;
            gap: 12px;
            overflow-x: auto;
            padding-bottom: 4px;
            scrollbar-width: none;
        }

        .saved-grid::-webkit-scrollbar {
            display: none;
        }

        .saved-item {
            flex: 0 0 140px;
            background: var(--bg-primary);
            border-radius: 12px;
            padding: 12px;
            border: 1px solid var(--border-light);
        }

        .saved-image {
            width: 100%;
            aspect-ratio: 1;
            background: white;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 8px;
        }

        .saved-image i {
            font-size: 32px;
            color: var(--accent-blue);
            opacity: 0.7;
        }

        .saved-name {
            font-size: 12px;
            font-weight: 500;
            margin-bottom: 4px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .saved-price {
            font-size: 14px;
            font-weight: 500;
            color: var(--accent-blue);
            margin-bottom: 8px;
        }

        .saved-add-btn {
            width: 100%;
            padding: 6px;
            background: white;
            border: 1px solid var(--accent-blue);
            color: var(--accent-blue);
            border-radius: 8px;
            font-size: 11px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }

        /* Рекомендации */
        .recommend-section {
            background: var(--bg-secondary);
            margin-top: 8px;
            padding: 16px 12px;
            margin-bottom: 20px;
        }

        .recommend-header {
            margin-bottom: 12px;
        }

        .recommend-title {
            font-size: 14px;
            font-weight: 500;
        }

        .recommend-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
        }

        .recommend-item {
            background: var(--bg-primary);
            border-radius: 12px;
            padding: 12px;
            border: 1px solid var(--border-light);
            display: flex;
            gap: 8px;
        }

        .recommend-image {
            width: 50px;
            height: 50px;
            background: white;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .recommend-image i {
            font-size: 24px;
            color: var(--accent-blue);
            opacity: 0.7;
        }

        .recommend-info {
            flex: 1;
            min-width: 0;
        }

        .recommend-name {
            font-size: 12px;
            font-weight: 500;
            margin-bottom: 2px;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .recommend-price {
            font-size: 13px;
            font-weight: 500;
            color: var(--accent-blue);
        }

        .recommend-add {
            margin-top: 4px;
            color: var(--accent-blue);
            font-size: 11px;
            cursor: pointer;
        }

        /* ===== FOOTER ===== */
        .footer {
            background: var(--bg-secondary);
            border-top: 1px solid var(--border-light);
            padding: 20px 12px;
            margin-top: auto;
        }

        .footer-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            gap: 12px;
        }

        .footer-copyright {
            color: var(--text-light);
            font-size: 12px;
        }

        .footer-links {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .footer-links a {
            text-decoration: none;
            color: var(--text-secondary);
            font-size: 12px;
        }

        .payment-icons {
            display: flex;
            gap: 12px;
            color: var(--text-light);
            font-size: 18px;
        }

        /* ===== НИЖНЕЕ МЕНЮ ===== */
        .bottom-nav {
            display: block;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: var(--bottom-nav-height);
            background: rgba(255, 255, 255, 0.96);
            backdrop-filter: blur(10px);
            border-top: 1px solid var(--border-light);
            padding: 6px 12px;
            z-index: 99;
        }

        .bottom-nav-inner {
            display: flex;
            align-items: center;
            justify-content: space-around;
            max-width: 500px;
            margin: 0 auto;
            height: 100%;
        }

        .bottom-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-decoration: none;
            color: var(--text-light);
            font-size: 10px;
            transition: color 0.2s;
            gap: 2px;
            position: relative;
        }

        .bottom-nav-item i {
            font-size: 20px;
        }

        .bottom-nav-item.active {
            color: var(--accent-blue);
        }

        .bottom-nav-item span {
            font-weight: 400;
            font-size: 10px;
        }

        .bottom-nav-badge {
            position: absolute;
            top: -2px;
            right: -6px;
            background: var(--danger);
            color: white;
            font-size: 9px;
            min-width: 14px;
            height: 14px;
            border-radius: 7px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 3px;
            border: 1px solid white;
        }

        /* Модальное окно */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: white;
            border-radius: 20px;
            max-width: 400px;
            width: 90%;
            padding: 24px;
            text-align: center;
        }

        .modal-icon {
            font-size: 48px;
            color: var(--danger);
            margin-bottom: 16px;
        }

        .modal-title {
            font-size: 18px;
            margin-bottom: 8px;
        }

        .modal-text {
            color: var(--text-secondary);
            margin-bottom: 20px;
            font-size: 14px;
        }

        .modal-actions {
            display: flex;
            gap: 12px;
        }

        .modal-btn {
            flex: 1;
            padding: 12px;
            border-radius: 12px;
            font-size: 14px;
            cursor: pointer;
            border: none;
        }

        .modal-btn.cancel {
            background: var(--bg-primary);
            color: var(--text-secondary);
        }

        .modal-btn.confirm {
            background: var(--danger);
            color: white;
        }

        /* Toast */
        .toast {
            position: fixed;
            bottom: calc(var(--bottom-nav-height) + 20px);
            left: 50%;
            transform: translateX(-50%);
            background: var(--text-primary);
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 12px;
            z-index: 1001;
            opacity: 0;
            transition: opacity 0.3s;
            white-space: nowrap;
        }

        .toast.show {
            opacity: 1;
        }

        /* Чекбокс "Выбрать всё" */
        .select-all {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-light);
        }

        .select-all input {
            width: 20px;
            height: 20px;
            accent-color: var(--accent-blue);
            cursor: pointer;
        }

        .select-all label {
            font-size: 14px;
            cursor: pointer;
        }

        /* Десктоп */
        @media (min-width: 768px) {
            :root {
                --header-height: 64px;
            }
            
            .header {
                padding: 0 20px;
            }
            
            .desktop-nav {
                display: flex;
                gap: 24px;
                margin-left: 30px;
            }
            
            .desktop-nav a {
                text-decoration: none;
                color: var(--text-secondary);
                font-size: 15px;
                padding: 8px 0;
                border-bottom: 2px solid transparent;
            }
            
            .desktop-nav a:hover,
            .desktop-nav a.active {
                color: var(--accent-blue);
                border-bottom-color: var(--accent-blue);
            }
            
            .search-wrapper {
                display: block;
                flex: 1;
                max-width: 400px;
                margin: 0 20px;
            }
            
            .search-box {
                display: flex;
                align-items: center;
                background: var(--bg-primary);
                border: 1px solid var(--border-light);
                border-radius: 20px;
                padding: 6px 14px;
            }
            
            .search-box i {
                color: var(--text-light);
                font-size: 14px;
                margin-right: 8px;
            }
            
            .search-box input {
                border: none;
                background: transparent;
                outline: none;
                font-size: 14px;
                width: 100%;
            }
            
            .back-btn {
                display: none;
            }
            
            .main-content {
                padding: 20px;
            }
            
            .cart-header {
                border-radius: 16px 16px 0 0;
                padding: 20px;
            }
            
            .cart-layout {
                display: grid;
                grid-template-columns: 1fr 380px;
                gap: 20px;
            }
            
            .cart-left {
                display: flex;
                flex-direction: column;
                gap: 16px;
            }
            
            .cart-right {
                display: flex;
                flex-direction: column;
                gap: 16px;
            }
            
            .free-shipping-banner {
                border-radius: 0 0 16px 16px;
                margin-bottom: 16px;
            }
            
            .cart-items {
                border-radius: 16px;
            }
            
            .promo-section,
            .delivery-section,
            .payment-section,
            .summary-section,
            .saved-section,
            .recommend-section {
                border-radius: 16px;
            }
            
            .bottom-nav {
                display: none;
            }
            
            .footer-content {
                flex-direction: row;
                justify-content: space-between;
                text-align: left;
            }
            
            .recommend-grid {
                grid-template-columns: repeat(3, 1fr);
            }
            
            .checkout-section {
                padding: 0;
            }
        }

        @media (min-width: 1024px) {
            .recommend-grid {
                grid-template-columns: repeat(4, 1fr);
            }
        }

        @media (max-width: 767px) {
            .cart-layout {
                display: block;
            }
            
            body {
                padding-bottom: calc(var(--bottom-nav-height));
            }
        }
