@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-color: #F4F5F7;
    --surface-color: #FFFFFF;
    --text-color: #111111;
    --hint-color: #8E8E93;
    --brand-red: #E31E24;
    --brand-red-hover: #C5161C;
    --gold: #FFD86B;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; font-family: 'Inter', -apple-system, sans-serif; }
html, body { height: 100%; overflow: hidden; background: #000; }
body { display: flex; flex-direction: column; height: 100vh; }

.app-wrapper {
    width: 100%; max-width: 500px; margin: 0 auto; background: var(--bg-color);
    height: 100vh; display: flex; flex-direction: column; position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

/* SPLASH */
.splash { position: fixed; inset: 0; background: radial-gradient(ellipse at center, #150509 0%, #000000 80%); z-index: 9999; overflow: hidden; transition: opacity 0.9s ease-out; display: flex; align-items: center; justify-content: center; }
.splash.hidden { opacity: 0; pointer-events: none; }
.particles { position: absolute; inset: 0; pointer-events: none; }
.particle { position: absolute; width: 2px; height: 2px; background: var(--gold); border-radius: 50%; box-shadow: 0 0 6px var(--gold), 0 0 14px rgba(255,216,107,0.4); animation: floatUp linear infinite; }
@keyframes floatUp { 0% { transform: translateY(105vh); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(-5vh); opacity: 0; } }
.flag-wrap { position: absolute; top: 50%; left: 50%; width: 180px; height: 120px; opacity: 0; transition: opacity 0.8s ease-out, transform 1.2s cubic-bezier(0.45, 0, 0.55, 1); z-index: 2; }
.flag-china-wrap { transform: translate(-50%, -50%) translateX(-220px); }
.flag-china-wrap.show { opacity: 1; transform: translate(-50%, -50%) translateX(-220px); }
.flag-china-wrap.center { transform: translate(-50%, -50%) translateX(-100px); }
.flag-china-wrap.hide { opacity: 0; transition: opacity 0.4s ease-out; }
.flag-kyrgyz-wrap { transform: translate(-50%, -50%) translateX(220px); }
.flag-kyrgyz-wrap.show { opacity: 1; transform: translate(-50%, -50%) translateX(220px); }
.flag-kyrgyz-wrap.center { transform: translate(-50%, -50%) translateX(100px); }
.flag-kyrgyz-wrap.hide { opacity: 0; transition: opacity 0.4s ease-out; }
.flag-img { width: 100%; height: 100%; display: block; border-radius: 4px; box-shadow: 0 12px 40px rgba(0,0,0,0.75), 0 4px 12px rgba(220,47,62,0.35), inset 0 0 30px rgba(0,0,0,0.15); animation: flagWave 2.6s ease-in-out infinite; }
@keyframes flagWave { 0%, 100% { transform: skewY(0deg) rotate(0deg); } 25% { transform: skewY(1deg) rotate(0.5deg); } 50% { transform: skewY(-0.7deg) rotate(-0.4deg); } 75% { transform: skewY(0.8deg) rotate(0.3deg); } }
.flash { position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,235,150,0.9) 25%, rgba(232,168,0,0.5) 55%, transparent 80%); transform: translate(-50%, -50%); opacity: 0; pointer-events: none; z-index: 3; }
.flash.fire { animation: flashBurst 0.8s ease-out forwards; }
@keyframes flashBurst { 0% { width: 0; height: 0; opacity: 1; } 20% { width: 140px; height: 140px; opacity: 1; } 50% { width: 320px; height: 320px; opacity: 1; } 100% { width: 600px; height: 600px; opacity: 0; } }
.logo-stage { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) scale(0.3); opacity: 0; pointer-events: none; z-index: 4; }
.logo-stage.show { animation: logoPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
@keyframes logoPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); } 60% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.logo-halo { position: absolute; top: 50%; left: 50%; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle, rgba(255,216,107,0.55) 0%, rgba(220,47,62,0.25) 40%, transparent 70%); transform: translate(-50%, -50%); animation: haloPulse 2.2s ease-in-out infinite; z-index: -1; }
@keyframes haloPulse { 0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; } 50% { transform: translate(-50%, -50%) scale(1.18); opacity: 1; } }
.logo-K { width: 150px; height: 150px; display: block; border-radius: 50%; filter: drop-shadow(0 0 22px rgba(220,47,62,0.7)); }
.title-stage { position: absolute; bottom: 20%; left: 50%; transform: translateX(-50%); text-align: center; opacity: 0; white-space: nowrap; pointer-events: none; z-index: 4; }
.title-stage.show { opacity: 1; }
.title-main { font-size: 30px; font-weight: 800; letter-spacing: 8px; color: #FFFFFF; margin-bottom: 14px; display: flex; justify-content: center; gap: 0; }
.title-letter { display: inline-block; opacity: 0; transform: translateY(15px); color: #FFFFFF; text-shadow: 0 0 15px rgba(255,255,255,0.4), 0 0 30px rgba(255,216,107,0.3); animation: letterReveal 0.35s ease-out forwards; }
.title-stage.show .title-letter:nth-child(1) { animation-delay: 0.00s; } .title-stage.show .title-letter:nth-child(2) { animation-delay: 0.10s; } .title-stage.show .title-letter:nth-child(3) { animation-delay: 0.20s; } .title-stage.show .title-letter:nth-child(4) { animation-delay: 0.30s; } .title-stage.show .title-letter:nth-child(5) { animation-delay: 0.40s; } .title-stage.show .title-letter:nth-child(6) { animation-delay: 0.50s; } .title-stage.show .title-letter:nth-child(7) { animation-delay: 0.60s; } .title-stage.show .title-letter:nth-child(8) { animation-delay: 0.70s; }
@keyframes letterReveal { 0% { opacity: 0; transform: translateY(15px) scale(0.8); } 60% { opacity: 1; transform: translateY(0) scale(1.08); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.title-line { width: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 0 auto 12px; }
.title-stage.show .title-line { animation: lineGrow 0.7s ease-out 0.7s forwards; }
@keyframes lineGrow { from { width: 0; opacity: 0; } to { width: 140px; opacity: 1; } }
.title-sub { font-size: 10px; letter-spacing: 5px; color: rgba(255,216,107,0); font-weight: 600; transition: color 0.5s ease-out 1.0s; }
.title-stage.show .title-sub { color: rgba(255,216,107,0.75); }

/* ИНТЕРФЕЙС */
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--bg-color); z-index: 10; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-circle { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, var(--brand-red) 0%, #A11217 100%); color: white; font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(227, 30, 36, 0.3); }
.logo-text { font-weight: 800; font-size: 20px; color: var(--text-color); letter-spacing: -0.5px;}
.user-info { display: flex; flex-direction: column; align-items: flex-end; }
.delivery-label { font-size: 11px; color: var(--hint-color); font-weight: 500; }
.delivery-city { font-size: 14px; font-weight: 700; color: var(--text-color); }

.app-content { flex: 1; overflow-y: auto; padding: 0 20px 90px 20px; scrollbar-width: none; }
.app-content::-webkit-scrollbar { display: none; }
.page { display: none; animation: fadeIn 0.3s ease-out; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.search-box { display: flex; align-items: center; background: var(--surface-color); border-radius: 16px; padding: 0 16px; height: 52px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 16px; }
.search-icon { font-size: 20px; margin-right: 10px; color: var(--hint-color); }
.search-box input { flex: 1; border: none; background: transparent; font-size: 15px; color: var(--text-color); outline: none; font-weight: 500; }
.search-box input::placeholder { color: var(--hint-color); font-weight: 400; }

.trust-bar { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.trust-item { flex: 1; display: flex; align-items: center; gap: 6px; background: var(--surface-color); padding: 10px; border-radius: 12px; font-size: 11px; font-weight: 600; color: #444; line-height: 1.2; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.trust-icon { font-size: 20px; color: var(--brand-red); }

.promo-banner { background: linear-gradient(135deg, var(--brand-red) 0%, #A11217 100%); border-radius: 20px; padding: 24px; position: relative; overflow: hidden; margin-bottom: 24px; box-shadow: 0 12px 25px rgba(227, 30, 36, 0.25); display: flex; justify-content: space-between; align-items: center; }
.promo-banner::before { content: ''; position: absolute; top: -50%; right: -20%; width: 150px; height: 150px; background: rgba(255,255,255,0.1); border-radius: 50%; filter: blur(20px); }
.promo-content { position: relative; z-index: 1; }
.promo-tag { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,0.2); color: white; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; margin-bottom: 12px; backdrop-filter: blur(5px); }
.promo-content h3 { color: white; font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.promo-content p { color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 500; }
.promo-icon { font-size: 64px; color: white; position: relative; z-index: 1; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2)); transform: rotate(-10deg); }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-title { font-size: 18px; font-weight: 800; color: var(--text-color); letter-spacing: -0.3px;}
.see-all { font-size: 13px; font-weight: 600; color: var(--brand-red); cursor: pointer; }

.categories { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.category-card { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface-color); padding: 12px 4px; border-radius: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.03); cursor: pointer; transition: all 0.2s ease; border: 1px solid rgba(0,0,0,0.02); }
.category-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
.category-icon { width: 44px; height: 44px; border-radius: 50%; background: #F4F5F7; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #4A4A4A; margin-bottom: 8px; transition: all 0.2s; }
.category-card:hover .category-icon { background: #FFF0F0; color: var(--brand-red); }
.category-name { font-size: 12px; font-weight: 600; color: var(--text-color); white-space: nowrap; }

.all-categories-btn { width: 100%; display: flex; justify-content: center; align-items: center; gap: 6px; background: var(--surface-color); border: 1px solid rgba(0,0,0,0.05); padding: 12px; border-radius: 14px; font-size: 13px; font-weight: 600; color: var(--text-color); cursor: pointer; margin-bottom: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); transition: background 0.2s; }
.all-categories-btn:hover { background: #F8F9FA; }
.all-categories-btn i { font-size: 16px; color: var(--hint-color); }

.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.product-card { background: var(--surface-color); border-radius: 18px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.04); cursor: pointer; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.product-image { width: 100%; aspect-ratio: 1.1; background: #F8F9FA; display: flex; align-items: center; justify-content: center; position: relative; }
.product-badge { position: absolute; top: 10px; left: 10px; background: #FFF0F0; color: var(--brand-red); font-size: 10px; font-weight: 800; padding: 4px 8px; border-radius: 6px; text-transform: uppercase; }
.product-info { padding: 14px; display: flex; flex-direction: column; flex: 1; justify-content: space-between; }
.product-name { font-size: 14px; font-weight: 600; color: var(--text-color); margin-bottom: 6px; line-height: 1.3; height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;}
.product-rating { font-size: 12px; font-weight: 600; color: #FF9500; margin-bottom: 12px; display: flex; align-items: center; gap: 4px;}
.rating-count { color: var(--hint-color); font-weight: 500; }
.product-bottom { display: flex; align-items: center; justify-content: space-between; }
.product-price { font-size: 16px; font-weight: 800; color: var(--text-color); }
.product-price span { font-size: 12px; font-weight: 600; color: var(--hint-color); }
.buy-btn { width: 32px; height: 32px; border-radius: 12px; border: none; background: var(--brand-red); color: white; font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 10px rgba(227, 30, 36, 0.3); transition: background 0.2s; }
.buy-btn:active { background: var(--brand-red-hover); }

.placeholder-text { text-align: center; color: var(--hint-color); font-size: 15px; margin-top: 40px; font-weight: 500;}
.support-btn { display: block; width: 100%; text-align: center; margin-top: 20px; padding: 16px; background: var(--brand-red); color: white; text-decoration: none; border-radius: 16px; font-weight: 700; box-shadow: 0 4px 15px rgba(227, 30, 36, 0.2); }

/* НИЖНЕЕ МЕНЮ */
.bottom-nav { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; align-items: center; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid rgba(0,0,0,0.05); padding: 10px 4px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 100; }
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; background: none; border: none; padding: 4px; cursor: pointer; color: var(--hint-color); gap: 4px; transition: all 0.2s; }
.nav-icon { font-size: 24px; transition: all 0.2s; }
.nav-label { font-size: 10px; font-weight: 600; }
.nav-btn.active { color: var(--brand-red); }
.nav-btn.active .nav-icon { transform: translateY(-2px); }

/* МОИ ЗАКАЗЫ */
.order-card { background: var(--surface-color); border-radius: 20px; padding: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.04); margin-bottom: 16px; }
.order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.order-id { font-size: 14px; font-weight: 700; color: var(--text-color); }
.order-status { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; }
.order-status.in-transit { background: #FFF4E5; color: #FF9500; }
.order-product { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.order-img { width: 50px; height: 50px; background: #F4F5F7; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #555; }
.order-name { font-size: 14px; font-weight: 600; color: var(--text-color); margin-bottom: 4px; }
.order-price { font-size: 13px; font-weight: 700; color: var(--brand-red); }
.tracker { position: relative; display: flex; justify-content: space-between; margin-bottom: 24px; padding: 0 10px; }
.tracker::before { content: ''; position: absolute; top: 12px; left: 20px; right: 20px; height: 2px; background: #E5E5EA; z-index: 1; }
.tracker-progress { position: absolute; top: 12px; left: 20px; height: 2px; background: var(--brand-red); z-index: 1; transition: width 0.5s ease; }
.tracker-step { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-color); border: 2px solid #E5E5EA; display: flex; align-items: center; justify-content: center; font-size: 12px; color: transparent; transition: all 0.3s; }
.tracker-step.completed .step-dot { background: var(--brand-red); border-color: var(--brand-red); color: white; }
.tracker-step.active .step-dot { border-color: var(--brand-red); color: var(--brand-red); }
.tracker-step.active .step-dot::after { content: ''; position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--brand-red); opacity: 0.3; animation: ping 1.5s infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.8); opacity: 0; } }
.step-label { font-size: 10px; font-weight: 600; color: var(--hint-color); }
.tracker-step.completed .step-label { color: var(--text-color); }
.tracker-step.active .step-label { color: var(--brand-red); }
.order-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; border-top: 1px dashed #E5E5EA; }
.tracking-number { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--hint-color); background: #F8F9FA; padding: 6px 10px; border-radius: 8px; }
.delivery-days { font-size: 12px; font-weight: 700; color: var(--text-color); }

/* ==================== МОДАЛЬНОЕ ОКНО СОГЛАСИЯ ==================== */
.terms-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.terms-content {
    background: var(--surface-color); border-radius: 24px; padding: 30px 24px;
    width: 100%; max-width: 400px; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalPop { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.terms-icon {
    width: 60px; height: 60px; border-radius: 50%; background: #FFF0F0; color: var(--brand-red);
    display: flex; align-items: center; justify-content: center; font-size: 32px;
    margin: 0 auto 16px auto;
}
.terms-content h2 { font-size: 20px; font-weight: 800; color: var(--text-color); text-align: center; margin-bottom: 12px; }
.terms-content p { font-size: 14px; color: var(--hint-color); text-align: center; margin-bottom: 12px; line-height: 1.4; }
.terms-content b { color: var(--text-color); }
.terms-note { font-size: 12px !important; color: #999 !important; margin-bottom: 20px !important; }

.terms-checkbox {
    display: flex; align-items: flex-start; gap: 10px; margin-bottom: 24px; cursor: pointer;
    background: #F8F9FA; padding: 12px; border-radius: 12px;
}
.terms-checkbox input { display: none; }
.checkmark {
    width: 20px; height: 20px; border-radius: 6px; border: 2px solid #CCC;
    display: inline-block; position: relative; flex-shrink: 0; margin-top: 2px;
    transition: all 0.2s;
}
.terms-checkbox input:checked + .checkmark { background: var(--brand-red); border-color: var(--brand-red); }
.terms-checkbox input:checked + .checkmark::after {
    content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
    border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.terms-text { font-size: 12px; color: var(--text-color); font-weight: 500; line-height: 1.4; }
.terms-text a { color: var(--brand-red); text-decoration: none; font-weight: 600; }

.terms-btn {
    width: 100%; padding: 16px; border-radius: 16px; border: none;
    background: var(--brand-red); color: white; font-size: 16px; font-weight: 700;
    cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 15px rgba(227, 30, 36, 0.2);
}
.terms-btn:disabled { background: #E5E5EA; color: #999; box-shadow: none; cursor: not-allowed; }
.terms-btn:not(:disabled):active { transform: scale(0.98); }