:root {
    --red: #c8102e;
    --red-dark: #a00d24;
    --gold: #d4a017;
    --dark: #1a1a1a;
    --gray: #6b7280;
    --bg: #f7f7f8;
    --line: #e5e7eb;
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--dark);
    line-height: 1.6;
    background: #fff;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 820px; }
.center { text-align: center; margin-top: 24px; }

/* Header */
.header { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 50; }
.header__inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-size: 22px; font-weight: 800; color: var(--dark); }
.logo span { color: var(--red); }
.logo--light { color: #fff; }
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a { color: var(--dark); font-weight: 500; }
.nav a.active { color: var(--red); }

/* Buttons */
.btn { display: inline-block; padding: 12px 22px; border-radius: var(--radius); font-weight: 600;
    cursor: pointer; border: 2px solid transparent; transition: .15s; text-align: center; }
.btn:hover { text-decoration: none; opacity: .92; }
.btn--primary { background: var(--red); color: #fff; }
.btn--outline { border-color: var(--red); color: var(--red); background: #fff; }
.btn--sm { padding: 8px 14px; font-size: 14px; }
.btn--block { width: 100%; }

/* Hero */
.hero { background: linear-gradient(135deg, #1a1a1a, #3a1116); color: #fff; padding: 64px 0; }
.hero__inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 40px; line-height: 1.2; margin-bottom: 16px; }
.hero p { font-size: 18px; color: #e5e5e5; margin-bottom: 24px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__card { background: #fff; color: var(--dark); border-radius: var(--radius); padding: 24px; }
.hero__card h3 { margin-bottom: 16px; }

/* Sections */
.section { padding: 56px 0; }
.section--alt { background: var(--bg); }
.section__title { font-size: 28px; margin: 8px 0 28px; }
.lead { font-size: 18px; color: var(--gray); margin-bottom: 24px; }

/* Grid + cards */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-bottom: 10px; }
.card--price { text-align: center; }
.price { font-size: 24px; font-weight: 800; color: var(--red); margin: 12px 0 18px; }
.price small { display: block; font-size: 13px; color: var(--gray); font-weight: 400; }

.step { text-align: center; }
.step span { display: inline-flex; width: 44px; height: 44px; border-radius: 50%; background: var(--red);
    color: #fff; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 10px; }

.list { margin: 0 0 24px 20px; }
.list li { margin-bottom: 8px; }

/* CTA */
.cta { background: var(--red); color: #fff; padding: 48px 0; text-align: center; }
.cta h2 { margin-bottom: 20px; font-size: 26px; }
.cta .btn--primary { background: #fff; color: var(--red); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.form--card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 14px; }
.form input, .form select, .form textarea {
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--red); border-color: var(--red); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form__note { font-size: 12px; color: var(--gray); }
.form__msg { font-size: 14px; min-height: 18px; }
.form__msg--ok { color: #15803d; }
.form__msg--error { color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.total { font-size: 18px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.total strong { color: var(--red); }

/* Footer */
.footer { background: var(--dark); color: #cfcfcf; padding: 40px 0 20px; }
.footer__inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer a { color: #fff; }
.footer__bottom { border-top: 1px solid #333; margin-top: 24px; padding-top: 16px; font-size: 13px; color: var(--gray); }

/* Floating button */
.float-btn { position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%;
    background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 24px; box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 60; border: none; cursor: pointer; }
.float-btn:hover { text-decoration: none; }

/* Consent checkbox */
.agree { flex-direction: row !important; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--gray); }
.agree input { width: auto !important; margin-top: 2px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal__box { position: relative; background: #fff; border-radius: var(--radius); padding: 28px;
    width: 92%; max-width: 380px; z-index: 1; }
.modal__box h3 { margin-bottom: 8px; }
.modal__box p { color: var(--gray); margin-bottom: 14px; }
.modal__close { position: absolute; top: 10px; right: 14px; background: none; border: none;
    font-size: 26px; line-height: 1; cursor: pointer; color: var(--gray); }

/* Auth + Cabinet */
.auth-form { max-width: 420px; margin: 0 auto; }
.cabinet-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.cabinet-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; margin-top: 16px; }
.muted { color: var(--gray); font-size: 14px; }

/* Cabinet layout */
.cab { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.cab__menu { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 84px; }
.cab__user { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.cab__avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: 0 0 44px; }
.cab__name { font-weight: 700; }
.cab__email { font-size: 12px; color: var(--gray); word-break: break-all; }
.cab__nav { display: flex; flex-direction: column; }
.cab__nav a { padding: 10px 12px; border-radius: 8px; color: var(--dark); font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.cab__nav a:hover { background: var(--bg); text-decoration: none; }
.cab__nav a.on { background: var(--red); color: #fff; }
.cab__logout { color: var(--gray) !important; margin-top: 8px; border-top: 1px solid var(--line); border-radius: 0 !important; }
.cab__content { min-width: 0; }
.cab__content h1 { margin-bottom: 16px; }

.card--stat { text-align: center; }
.card__big { font-size: 40px; font-weight: 800; color: var(--red); }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.admin-add { flex-direction: row !important; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; align-items: center; }
.admin-add input { width: auto; flex: 1; min-width: 120px; }

/* Status badges */
.status { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status--new { background: #eef; color: #3340c0; }
.status--confirmed { background: #fff4d6; color: #9a6b00; }
.status--paid { background: #e6f6ea; color: #15803d; }
.status--done { background: #e5e7eb; color: #374151; }
.status--cancelled { background: #fde2e2; color: var(--red); }

/* Chat */
.chat { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; display: flex; flex-direction: column; }
.chat__body { padding: 16px; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.chat__empty { color: var(--gray); text-align: center; padding: 20px 0; }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; }
.bubble__text { white-space: pre-wrap; word-break: break-word; }
.bubble__time { font-size: 11px; opacity: .6; margin-top: 4px; }
.bubble--client { align-self: flex-end; background: var(--red); color: #fff; }
.bubble--producer { align-self: flex-end; background: var(--gold); color: #fff; }
.bubble--manager { align-self: flex-start; background: var(--bg); color: var(--dark); }
.chat__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat__form input { flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.badge-count { background: var(--red); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 12px; margin-left: 6px; }

/* Admin */
.admin-body { background: var(--bg); padding: 24px 0; }
.admin-login { max-width: 360px; margin: 60px auto; }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { background: var(--bg); }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form select { padding: 6px; }
.btn.btn--sm { background: var(--dark); color: #fff; }

.card__icon { font-size: 36px; margin-bottom: 8px; }

/* Каталог заводов */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.filters select { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; cursor: pointer; }
.filters select:focus { outline: 2px solid var(--red); border-color: var(--red); }
.factory-card__media { height: 160px; border-radius: 8px; overflow: hidden; margin-bottom: 12px;
    background: var(--bg); display: flex; align-items: center; justify-content: center; }
.factory-card__media img { width: 100%; height: 100%; object-fit: cover; }
.factory-card__media .card__icon { font-size: 48px; margin: 0; }
.factory__hero { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); margin: 16px 0 24px; }

/* Featured price card */
.card--featured { border-color: var(--red); box-shadow: 0 10px 30px rgba(200,16,46,.15); position: relative; }
.badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--gold);
    color: #fff; padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.list--check { list-style: none; margin: 16px 0; text-align: left; }
.list--check li { padding-left: 26px; position: relative; margin-bottom: 8px; }
.list--check li::before { content: "✓"; position: absolute; left: 0; color: var(--red); font-weight: 700; }

/* Price list (extras) */
.list--price { list-style: none; margin: 20px 0; max-width: 760px; margin-left: auto; margin-right: auto; }
.list--price li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
    padding: 12px 0; border-bottom: 1px solid var(--line); }
.list--price strong { white-space: nowrap; color: var(--red); }

/* Timeline */
.timeline { margin: 24px 0; }
.timeline__item { display: flex; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.timeline__num { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; background: var(--red);
    color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }

/* Reviews */
.review { display: flex; flex-direction: column; }
.stars { color: var(--gold); font-size: 18px; margin-bottom: 10px; }
.review__text { flex: 1; font-style: italic; color: #333; }
.review__name { margin-top: 12px; font-weight: 600; }

/* FAQ */
.faq__item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 20px; margin-bottom: 12px; }
.faq__item summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; float: right; color: var(--red); font-weight: 700; }
.faq__item[open] summary::after { content: "−"; }
.faq__item p { margin-top: 12px; color: var(--gray); }

/* Stats + trust */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 32px; }
.stat { text-align: center; }
.stat__num { font-size: 34px; font-weight: 800; color: var(--gold); }
.stat__label { font-size: 14px; color: #ddd; }
.hero__badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.hero__badge { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
    padding: 6px 12px; border-radius: 20px; font-size: 13px; }

/* Mobile */
@media (max-width: 860px) {
    .hero__inner, .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .hero h1 { font-size: 30px; }
    .nav { display: none; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .cabinet-grid { grid-template-columns: 1fr; }
    .cab { grid-template-columns: 1fr; }
    .cab__menu { position: static; }
}

/* Expo cabinet */
.expo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.expo-code-form, .expo-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; align-items: end; margin: 16px 0 24px; }
.expo-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.expo-tags { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.expo-tags legend { padding: 0 6px; font-weight: 600; }
.expo-tags .check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.expo-media__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.expo-media__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.expo-media__item { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin: 0; }
.expo-media__item img { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; display: block; }
.expo-media__item audio { width: 100%; }
.expo-report__head { margin-bottom: 20px; }
.expo-report__card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.expo-report__photo { max-width: 180px; max-height: 140px; object-fit: cover; border-radius: 6px; }
.expo-qr-print { text-align: center; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); max-width: 360px; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.trip-block { margin: 28px 0; }
.chat-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; max-height: 360px; overflow: auto; margin-bottom: 12px; }
.chat-msg { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; background: var(--bg); }
.chat-msg--client, .chat-msg--producer { background: #fff3f3; }
.chat-msg--manager, .chat-msg--escort, .chat-msg--agent, .chat-msg--admin { background: #f3f7ff; }
.chat-msg__meta { font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Capacitor / app shell bottom nav */
body.app-shell { padding-bottom: 72px; }
.app-bottom-nav {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: #fff; border-top: 1px solid var(--line);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around; gap: 4px;
}
body.app-shell .app-bottom-nav { display: flex; }
.app-bottom-nav a {
    flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--dark);
    padding: 8px 4px; border-radius: 8px; text-decoration: none;
}
.app-bottom-nav a.on { background: var(--red); color: #fff; }

@media print {
    .header, .footer, .cab__menu, .no-print, .float-cta, .app-bottom-nav { display: none !important; }
    .cab { display: block; }
    .expo-report__card { break-inside: avoid; }
}
