/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #1e293b; background: #f8fafc; line-height: 1.6; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.main { min-height: calc(100vh - 140px); }

/* ── Header ───────────────────────────────────────────────────────────────── */
.header { background: #fff; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: #1e293b; text-decoration: none; }
.logo-dot { color: #2563eb; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav-link { padding: 6px 14px; border-radius: 6px; color: #64748b; font-size: 14px; font-weight: 500; transition: all .15s; text-decoration: none; }
.nav-link:hover, .nav-link.active { background: #eff6ff; color: #2563eb; text-decoration: none; }
.cart-btn { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: #2563eb; color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s; }
.cart-btn:hover { background: #1d4ed8; }
.cart-count { background: #ef4444; color: #fff; border-radius: 10px; padding: 1px 6px; font-size: 11px; font-weight: 700; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all .15s; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid #cbd5e1; color: #475569; }
.btn-outline:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.btn-disabled { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-icon { background: none; border: none; cursor: pointer; color: #94a3b8; padding: 4px 8px; font-size: 16px; }
.btn-icon:hover { color: #ef4444; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); color: #fff; padding: 60px 0 50px; }
.hero-title { font-size: 42px; font-weight: 700; line-height: 1.2; margin-bottom: 16px; }
.hero-accent { color: #93c5fd; }
.hero-sub { font-size: 18px; color: #bfdbfe; max-width: 560px; }
@media (max-width: 600px) { .hero-title { font-size: 28px; } .hero-sub { font-size: 16px; } }

/* ── Catalog ──────────────────────────────────────────────────────────────── */
.catalog { padding: 48px 0; }
.section-title { font-size: 22px; font-weight: 600; margin-bottom: 24px; color: #1e293b; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 48px; }

/* Карточка */
.card-item { background: #fff; border-radius: 12px; border: 1.5px solid #e2e8f0; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.card-item:hover { box-shadow: 0 4px 20px rgba(37,99,235,.12); transform: translateY(-2px); }
.card-item.card-out { opacity: .55; }
.card-visual { background: linear-gradient(135deg, #1e3a8a, #2563eb); padding: 24px 20px 20px; color: #fff; position: relative; min-height: 110px; }
.card-chip { width: 32px; height: 24px; background: rgba(255,255,255,.25); border-radius: 4px; margin-bottom: 12px; }
.card-amount { font-size: 28px; font-weight: 700; }
.card-amount-rub { font-size: 13px; color: #bfdbfe; margin-top: 2px; }
.card-brand { position: absolute; top: 16px; right: 16px; font-size: 11px; color: rgba(255,255,255,.6); font-weight: 600; letter-spacing: 1px; }
.card-info { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.btn-add { width: 100%; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-gray  { background: #f1f5f9; color: #64748b; }
.badge-blue  { background: #dbeafe; color: #2563eb; }

/* ── How it works ─────────────────────────────────────────────────────────── */
.how-it-works { padding: 48px 0 0; }
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num { flex-shrink: 0; width: 36px; height: 36px; background: #2563eb; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.step-text strong { display: block; font-size: 15px; margin-bottom: 4px; }
.step-text p { font-size: 14px; color: #64748b; }

/* ── Cart Sidebar ─────────────────────────────────────────────────────────── */
.cart-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; }
.cart-overlay.open { display: block; }
.cart-panel { position: fixed; top: 0; right: -400px; width: 380px; max-width: 100vw; height: 100vh; background: #fff; z-index: 201; transition: right .25s ease; display: flex; flex-direction: column; box-shadow: -4px 0 20px rgba(0,0,0,.1); }
.cart-panel.open { right: 0; }
.cart-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #e2e8f0; }
.cart-panel-header h3 { font-size: 16px; font-weight: 600; }
.close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: #64748b; }
.cart-panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-panel-footer { padding: 16px 20px; border-top: 1px solid #e2e8f0; }
.cart-empty { color: #94a3b8; text-align: center; padding: 40px 0; }
.cart-total { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 12px; }
.cart-total-rub { font-size: 13px; color: #64748b; }
.cart-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.cart-row-denom { font-weight: 600; min-width: 40px; }
.cart-row-qty { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.qty-btn { width: 28px; height: 28px; border-radius: 6px; border: 1.5px solid #e2e8f0; background: #fff; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.qty-btn:hover { border-color: #2563eb; color: #2563eb; }
.cart-row-remove { background: none; border: none; cursor: pointer; color: #94a3b8; padding: 4px; }
.cart-row-remove:hover { color: #ef4444; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #374151; }
.form-input { width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 15px; transition: border .15s; outline: none; }
.form-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.form-hint-bottom { text-align: center; font-size: 13px; color: #94a3b8; margin-top: 12px; }
.form-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.form-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
fieldset.fieldset { border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
fieldset.fieldset legend { font-size: 13px; font-weight: 600; color: #64748b; padding: 0 6px; }

/* ── Card Box ─────────────────────────────────────────────────────────────── */
.card-box { background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 24px; }
.card-box h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* ── Checkout ─────────────────────────────────────────────────────────────── */
.checkout-wrap { max-width: 900px; margin: 40px auto; }
.page-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.page-sub { font-size: 16px; color: #64748b; margin-bottom: 32px; max-width: 600px; }
.checkout-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 700px) { .checkout-grid { grid-template-columns: 1fr; } }
.checkout-form-col, .checkout-summary-col { display: flex; flex-direction: column; }
.checkout-form-col .card-box, .checkout-summary-col .card-box { flex: 1; }
.order-total { border-top: 1.5px solid #e2e8f0; margin-top: 16px; padding-top: 16px; }
.order-total-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 15px; }
.order-total-rub { color: #2563eb; font-weight: 600; }
.checkout-note { font-size: 13px; color: #94a3b8; margin-top: 12px; }
.payment-methods { margin-top: 16px; }
.payment-label { font-size: 13px; color: #64748b; margin-bottom: 8px; }
.payment-icons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pay-icon { padding: 4px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 12px; font-weight: 600; color: #475569; }
.payment-hint { font-size: 12px; color: #94a3b8; }

/* ── Order Page ───────────────────────────────────────────────────────────── */
.order-wrap { max-width: 700px; margin: 40px auto; }
.order-success-banner { display: flex; gap: 20px; align-items: center; background: #f0fdf4; border: 1.5px solid #bbf7d0; border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.order-success-banner h2 { font-size: 20px; margin-bottom: 4px; }
.order-pending-banner { background: #fffbeb; border: 1.5px solid #fde68a; border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.order-info-banner { background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.order-details { margin-bottom: 20px; }
.order-table { width: 100%; border-collapse: collapse; }
.order-table th, .order-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.order-table th { color: #64748b; font-weight: 500; }
.activate-info { margin-bottom: 20px; }
.activate-steps { margin: 12px 0 20px; padding-left: 20px; }
.activate-steps li { margin-bottom: 8px; font-size: 15px; }
.order-support { font-size: 13px; color: #64748b; text-align: center; margin-top: 20px; }

/* ── B2B ──────────────────────────────────────────────────────────────────── */
.b2b-wrap { max-width: 960px; margin: 40px auto; }
.b2b-header { margin-bottom: 32px; }
.b2b-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
@media (max-width: 700px) { .b2b-grid { grid-template-columns: 1fr; } }
.b2b-features ul.feature-list { list-style: none; padding: 0; }
.b2b-features ul.feature-list li { padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.b2b-features ul.feature-list li::before { content: "✓ "; color: #22c55e; font-weight: 700; }
.b2b-item-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.form-qty { width: 80px !important; }
.item-sum { font-size: 14px; color: #64748b; min-width: 50px; }
.b2b-total { margin-top: 12px; font-size: 15px; font-weight: 500; }
.rub-hint { font-size: 13px; color: #64748b; margin-left: 8px; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer { background: #1e293b; color: #94a3b8; padding: 32px 0; margin-top: 60px; }
.footer-inner { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.footer-brand .footer-logo { font-size: 16px; font-weight: 700; color: #e2e8f0; }
.footer-brand p { font-size: 13px; margin-top: 4px; }
.footer-brand a { color: #60a5fa; }
.footer-links { display: flex; gap: 20px; margin-left: auto; }
.footer-links a { font-size: 13px; color: #94a3b8; }
.footer-links a:hover { color: #e2e8f0; }
.footer-copy { font-size: 12px; align-self: flex-end; }
@media (max-width: 600px) { .footer-links { margin-left: 0; flex-wrap: wrap; } }

/* ── Cookie banner ────────────────────────────────────────────────────────── */
.cookie-banner { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 500; background: #1e293b; color: #e2e8f0; padding: 14px 24px; align-items: center; justify-content: space-between; gap: 20px; box-shadow: 0 -2px 12px rgba(0,0,0,.2); }
.cookie-banner.visible { display: flex; }
.cookie-banner-text { font-size: 14px; line-height: 1.5; }
.cookie-banner-text a { color: #60a5fa; }
.cookie-accept-btn { flex-shrink: 0; }
@media (max-width: 600px) { .cookie-banner { flex-direction: column; align-items: flex-start; } }

/* ── Protected data (anti-scraping) ──────────────────────────────────────── */
/* Данные хранятся split в data-a/data-b, парсер не найдёт полный реквизит  */
.pd { display: inline; user-select: all; }
.pd::before { content: attr(data-a) attr(data-b); }

/* ── Legal pages ──────────────────────────────────────────────────────────── */
.legal-wrap { max-width: 780px; margin: 40px auto 60px; }
.legal-date { color: #94a3b8; font-size: 14px; margin-bottom: 32px; }
.legal-body h2 { font-size: 17px; font-weight: 600; margin: 28px 0 10px; color: #1e293b; }
.legal-body p { font-size: 15px; color: #374151; margin-bottom: 12px; line-height: 1.7; }
.legal-body ul { padding-left: 20px; margin-bottom: 12px; }
.legal-body ul li { font-size: 15px; color: #374151; margin-bottom: 6px; line-height: 1.6; }
.legal-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.legal-table td { padding: 10px 14px; border: 1px solid #e2e8f0; font-size: 14px; }
.legal-table td:first-child { font-weight: 500; color: #64748b; width: 180px; background: #f8fafc; }

/* ── Admin ────────────────────────────────────────────────────────────────── */
body.admin-body { background: #f1f5f9; display: flex; }
.admin-sidebar { width: 220px; min-height: 100vh; background: #1e293b; flex-shrink: 0; padding: 24px 0; }
.admin-sidebar-logo { color: #e2e8f0; font-weight: 700; font-size: 15px; padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.admin-nav { padding: 12px 0; }
.admin-nav-link { display: block; padding: 10px 20px; font-size: 14px; color: #94a3b8; transition: all .15s; text-decoration: none; }
.admin-nav-link:hover { background: rgba(255,255,255,.05); color: #e2e8f0; text-decoration: none; }
.admin-content { flex: 1; padding: 28px 32px; overflow-x: auto; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-topbar h1 { font-size: 22px; font-weight: 600; }
.admin-section-title { font-size: 16px; font-weight: 600; margin: 28px 0 14px; }
.admin-section { margin-bottom: 24px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: 10px; padding: 20px; border: 1.5px solid #e2e8f0; }
.stat-val { font-size: 28px; font-weight: 700; color: #2563eb; }
.stat-label { font-size: 13px; color: #64748b; margin-top: 4px; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; border: 1.5px solid #e2e8f0; }
.admin-table th { background: #f8fafc; padding: 10px 14px; text-align: left; font-size: 13px; color: #64748b; font-weight: 500; }
.admin-table td { padding: 10px 14px; border-top: 1px solid #f1f5f9; font-size: 14px; }
.admin-table tr:hover td { background: #f8fafc; }
.cards-stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stock-item { background: #fff; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 16px; text-align: center; }
.stock-item.stock-low { border-color: #fde68a; background: #fffbeb; }
.stock-denom { font-size: 20px; font-weight: 700; color: #2563eb; }
.stock-count { font-size: 13px; color: #64748b; margin: 4px 0 10px; }
.admin-login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; width: 100%; background: #f1f5f9; }
.admin-login-box { background: #fff; border-radius: 12px; padding: 36px; width: 100%; max-width: 380px; border: 1.5px solid #e2e8f0; }
.admin-login-logo { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 24px; }
.admin-login-sub { font-size: 13px; color: #64748b; font-weight: 400; margin-top: 4px; }
.form-group-btn { display: flex; flex-direction: column; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.status-pending          { background: #fef3c7; color: #92400e; }
.status-awaiting_payment { background: #dbeafe; color: #1e40af; }
.status-paid             { background: #d1fae5; color: #065f46; }
.status-completed        { background: #d1fae5; color: #065f46; }
.status-cancelled        { background: #fee2e2; color: #991b1b; }
.status-available        { background: #d1fae5; color: #065f46; }
.status-reserved         { background: #dbeafe; color: #1e40af; }
.status-sold             { background: #fef3c7; color: #92400e; }
.status-activated        { background: #e0e7ff; color: #3730a3; }
.detail-list { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px; }
.detail-list dt { color: #64748b; }
.admin-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .admin-detail-grid { grid-template-columns: 1fr; } }
.text-muted { color: #64748b; font-size: 14px; margin-bottom: 16px; }
