/* ========================================
   ExpertAuto-BG — Responsive (Mobile-first)
   ======================================== */

/* ---- Tablet & Mobile Navigation (< 1025px) ---- */
@media (max-width: 1024px) {
  .hamburger {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--color-light-surface);
    padding: 80px var(--space-xl) var(--space-xl);
    transition: right var(--transition-normal);
    z-index: calc(var(--z-header) - 1);
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  }

  .main-nav.nav--open {
    right: 0;
  }

  .main-nav .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .main-nav .nav-list a {
    padding: 0.85rem 0.9rem;
    font-size: var(--fs-base);
    border-bottom: none;
    border-radius: 10px;
    margin-bottom: 2px;
    transition: background var(--transition-fast), color var(--transition-fast);
  }

  /* The desktop horizontal underline indicator doesn't belong in the
     vertical drawer — hide it and use a clean pill + left accent instead. */
  .main-nav .nav-list a::after {
    display: none;
  }

  /* Force dark text in mobile sidebar (overrides header--dark white text) */
  .site-header .main-nav .nav-list a,
  .site-header.header--dark .main-nav .nav-list a,
  .site-header.header--dark .main-nav .nav-list > li > a,
  .site-header.header--scrolled.header--dark .main-nav .nav-list a {
    color: var(--color-text-dark, #1d1729);
  }

  /* Subtle hover */
  .site-header .main-nav .nav-list a:hover,
  .site-header.header--dark .main-nav .nav-list a:hover {
    color: var(--color-accent-purple, #7243f2);
    background: rgba(114, 67, 242, 0.06);
  }

  /* Active "you are here" — clean filled pill + purple left accent bar */
  .site-header .main-nav .nav-list a.active,
  .site-header.header--dark .main-nav .nav-list a.active,
  .site-header.header--scrolled.header--dark .main-nav .nav-list a.active {
    color: var(--color-accent-purple, #7243f2);
    background: rgba(114, 67, 242, 0.10);
    box-shadow: inset 3px 0 0 var(--color-accent-purple, #7243f2);
  }

  /* Keep PRO button white on purple; add breathing room below the nav items */
  .site-header .main-nav .nav-list a.nav-pro-btn,
  .site-header.header--dark .main-nav .nav-list a.nav-pro-btn {
    color: #fff;
    margin-top: 14px;
  }

  /* On hover the PRO button must KEEP its filled purple pill — the generic
     nav-link hover would lighten the background and leave the white text
     invisible. Higher specificity (extra .nav-pro-btn) beats that rule. */
  .site-header .main-nav .nav-list a.nav-pro-btn:hover,
  .site-header.header--dark .main-nav .nav-list a.nav-pro-btn:hover {
    background: linear-gradient(135deg, #6333e2, #8b5cf6);
    color: #fff;
  }

  /* Nav dropdown — mobile */
  .nav-dropdown__trigger {
    width: 100%;
    padding: 0.85rem 0.9rem;
    font-size: var(--fs-base);
    border-bottom: none;
    border-radius: 10px;
    margin-bottom: 2px;
    justify-content: space-between;
  }

  .nav-dropdown__menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    display: none;
    background: rgba(114, 67, 242, 0.03);
  }

  .nav-dropdown--open .nav-dropdown__menu {
    display: block;
    transform: none;
  }

  /* Larger chevron tap target on mobile */
  .nav-dropdown__chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 8px;
    background: rgba(114, 67, 242, 0.06);
    transition: background 0.15s;
  }

  .nav-dropdown__chevron:active {
    background: rgba(114, 67, 242, 0.15);
  }

  .nav-dropdown__chevron svg,
  .site-header.header--dark .nav-dropdown__chevron svg {
    width: 14px;
    height: 14px;
    stroke: #7243f2;
    opacity: 1;
  }

  .nav-dropdown--open .nav-dropdown__chevron svg {
    transform: rotate(180deg);
  }

  /* Submenu items (under "Приложение") — identical on EVERY page, whether the
     header is dark or light. The non-dark selector below is required so this
     wins over the newer ".nav-list a" rule on light-header pages (calculators,
     collision); otherwise the items lose their indent and the menu looks
     different depending on the section you're in. */
  .nav-dropdown__menu a,
  .site-header .main-nav .nav-list .nav-dropdown__menu a,
  .site-header.header--dark .main-nav .nav-list .nav-dropdown__menu a {
    padding: 0.7rem 0.9rem 0.7rem 2.25rem;
    font-size: var(--fs-sm);
    border-bottom: none;
    border-radius: 10px;
    margin-bottom: 2px;
    box-shadow: none;
    color: var(--color-text-dark, #1d1729);
  }

  .nav-dropdown__menu a:hover,
  .site-header .main-nav .nav-list .nav-dropdown__menu a:hover,
  .site-header.header--dark .main-nav .nav-list .nav-dropdown__menu a:hover {
    color: var(--color-accent-purple, #7243f2);
    background: rgba(114, 67, 242, 0.06);
  }

  /* Current sub-page — same clean pill + left accent as the top-level items */
  .nav-dropdown__menu a.active,
  .site-header .main-nav .nav-list .nav-dropdown__menu a.active,
  .site-header.header--dark .main-nav .nav-list .nav-dropdown__menu a.active {
    color: var(--color-accent-purple, #7243f2);
    background: rgba(114, 67, 242, 0.10);
    box-shadow: inset 3px 0 0 var(--color-accent-purple, #7243f2);
  }

  /* Grid to single column */
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  /* Steps vertical */
  .steps {
    flex-direction: column;
    gap: var(--space-lg);
  }

  /* Stats */
  .stats-row {
    gap: var(--space-xl);
  }

  /* Hero sizes */
  .page-hero h1 {
    font-size: var(--fs-2xl);
  }

  .section__title {
    font-size: var(--fs-2xl);
  }

  /* Footer */
  .site-footer .grid--4 {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  /* Pricing featured */
  .card--pricing.featured {
    transform: none;
  }

  .card--pricing.featured:hover {
    transform: translateY(-4px);
  }
}

/* ---- Tablet (768px+) ---- */
@media (min-width: 768px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Laptop (992px+) ---- */
@media (min-width: 992px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---- Desktop (1200px+) ---- */
@media (min-width: 1200px) {
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---- Learn Player Responsive ---- */
@media (max-width: 767px) {
  .learn-sidebar {
    position: fixed;
    top: 56px;
    left: -320px;
    width: 300px;
    height: calc(100vh - 56px);
    z-index: 100;
    transition: left var(--transition-normal);
  }

  .learn-sidebar--open {
    left: 0;
  }

  .learn-sidebar-toggle {
    display: flex;
  }

  .learn-header__title {
    font-size: var(--fs-xs);
  }

  .learn-player__info {
    padding: var(--space-lg);
  }

  .learn-player__nav {
    padding: var(--space-md) var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .learn-player__nav-btn {
    min-width: 120px;
    font-size: var(--fs-xs);
    padding: var(--space-sm) var(--space-md);
  }

  .learn-player__autoadvance {
    order: -1;
    width: 100%;
    justify-content: center;
  }
}

/* ---- Misc responsive ---- */
@media (max-width: 576px) {
  .container {
    padding-inline: var(--space-md);
  }

  .section {
    padding: var(--space-3xl) 0;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: var(--fs-sm);
  }

  .hero__buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__buttons .btn {
    width: 100%;
  }

  /* Pricing modal mobile */
  .pricing-modal__grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .pricing-modal__card {
    padding: var(--space-lg);
  }

  .pricing-modal .modal-content {
    padding: var(--space-md);
    margin: var(--space-sm);
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Diagram toolbar mobile */
  .diagram-toolbar {
    width: 100%;
    position: relative;
    min-width: 0;
  }
}

/* ==========================================================================
   App Shell (calculators, collision, indictment, expertise-review, ai-check)
   ========================================================================== */

/* Таблет (≤ 1024px) */
@media (max-width: 1024px) {
  .app-shell__body {
    flex-direction: column;
  }
  .app-shell__sidebar {
    width: 100% !important;
    max-width: 100% !important;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 12px;
    gap: 6px;
    border-right: none;
    border-bottom: 1px solid var(--color-light-muted, #e5e7eb);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .app-shell__sidebar-label {
    display: none;
  }
  .app-shell__nav-item {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
  }
  .app-shell__nav-item span:not(.app-shell__nav-badge) {
    display: inline;
  }
  .app-shell__nav-icon {
    width: 16px;
    height: 16px;
  }
  .app-shell__nav-badge {
    font-size: 0.6rem;
    padding: 1px 5px;
  }
  .app-shell__sidebar-footer {
    display: none;
  }
  .app-shell__content {
    padding: 0;
  }
  .app-content-header {
    padding: 18px 16px 12px;
  }
  .app-content-header__title {
    font-size: 1.35rem;
    line-height: 1.2;
  }
  .app-content-header__subtitle {
    font-size: 0.88rem;
  }
}

/* Мобилни (≤ 640px) — калкулатор панели */
@media (max-width: 640px) {
  .calc-panel {
    padding: 16px 12px !important;
    border-radius: 10px;
  }
  .calc-panel__header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .calc-panel__header h3 {
    font-size: 1rem !important;
    line-height: 1.25;
  }
  .calc-formula {
    font-size: 0.72rem !important;
    display: block;
    margin-top: 4px;
    overflow-x: auto;
    white-space: nowrap;
    max-width: 100%;
  }
  .calc-panel__split {
    flex-direction: column !important;
    gap: 12px;
  }
  .calc-panel__main,
  .calc-panel__notes {
    width: 100% !important;
    flex: 1 1 auto !important;
  }
  .calc-input-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .calc-input-group {
    width: 100% !important;
  }
  .calc-input-group input,
  .calc-input-group select {
    font-size: 16px !important; /* prevent zoom on iOS */
  }
  .calc-btn {
    width: 100%;
    justify-content: center;
  }

  /* Collision analysis — мобилно оформление */
  .method-selector {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .method-card {
    padding: 12px 14px !important;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .method-card__icon {
    width: 32px !important;
    height: 32px !important;
    margin-bottom: 0 !important;
    flex-shrink: 0;
  }
  .method-card__name {
    font-size: 0.92rem !important;
    margin-bottom: 0;
  }
  .method-card__desc {
    display: none;
  }
  .method-info-btn {
    position: static !important;
    margin-left: auto;
    flex-shrink: 0;
  }
  .collision-panel .input-field input[type="number"] {
    font-size: 16px !important;
  }
  .collision-grid {
    grid-template-columns: 1fr !important;
  }
  .method-header h3 {
    font-size: 1rem !important;
  }
  .method-header p {
    font-size: 0.82rem !important;
  }

  /* Обвинение по ЗДвП */
  .indict-step {
    padding: 14px 12px !important;
  }
  .indict-step__head {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  .indict-step__head h2 {
    font-size: 1.02rem !important;
  }
  .indict-step__head p {
    font-size: 0.82rem !important;
  }
  .indict-checks {
    grid-template-columns: 1fr !important;
  }
  .indict-actions {
    flex-direction: column;
  }
  .indict-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .indict-output__pre {
    font-size: 0.72rem !important;
  }

  /* Изследване на САТЕ */
  .er-params {
    grid-template-columns: 1fr !important;
  }
  .er-ai-criteria {
    grid-template-columns: 1fr !important;
  }
  .er-upload {
    padding: 20px 12px !important;
  }
  .er-upload__title {
    font-size: 0.88rem;
  }

  /* Param helper popover */
  .param-help-popover {
    width: calc(100vw - 20px) !important;
    left: 10px !important;
    right: 10px;
    max-height: 78vh;
  }

  /* Method advisor modal */
  .method-modal {
    padding: 0 !important;
    align-items: flex-end;
  }
  .method-modal__dialog {
    width: 100% !important;
    max-height: 92vh;
    border-radius: 14px 14px 0 0;
  }
  .method-modal__head {
    padding: 16px 48px 16px 16px !important;
  }
  .method-modal__title {
    font-size: 1.1rem !important;
  }
  .method-modal__body {
    padding: 16px !important;
  }

  /* Приложение (app.html) */
  .appl-primary-grid {
    grid-template-columns: 1fr !important;
  }
  .appl-feature-card {
    padding: 20px 16px !important;
  }
  .appl-feature-card__title {
    font-size: 1.1rem !important;
  }
  .appl-why-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .appl-section__title {
    font-size: 1.3rem !important;
  }

  /* Pricing */
  #pricingGrid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .p-card {
    padding: 20px 16px !important;
  }
  .p-card__amount {
    font-size: 2rem !important;
  }
  .pricing-table {
    font-size: 0.82rem;
  }
  .pricing-table th,
  .pricing-table td {
    padding: 6px 4px !important;
  }

  /* Home — app showcase (mockup) */
  .app-mockup__panel {
    padding: 12px !important;
  }
  .app-mockup__panel-info h3 {
    font-size: 0.92rem !important;
  }
  .app-mockup__panel-info p {
    font-size: 0.78rem !important;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .app-mockup__panel-features {
    display: none; /* много плътно на телефон */
  }
  .app-mockup__sidebar {
    display: none; /* показваме само content-а */
  }
}

/* Auth page */
@media (max-width: 640px) {
  .auth-card,
  .auth-form {
    padding: 20px 16px !important;
  }
  .form-input {
    font-size: 16px !important; /* prevent iOS zoom */
    padding: 10px 12px;
  }
  .social-btn {
    font-size: 0.88rem;
    padding: 10px 14px;
  }
  .auth-tabs {
    margin-bottom: 16px;
  }
  .auth-tab {
    font-size: 0.88rem;
    padding: 10px;
  }
}

/* ==========================================================================
   Footer — modern mobile redesign
   ========================================================================== */
@media (max-width: 768px) {
  .site-footer {
    padding: 32px 0 16px !important;
  }
  .site-footer .container.grid--4 {
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
  }
  .site-footer .footer__brand {
    grid-column: 1 / -1 !important;
    text-align: center;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .site-footer .footer__brand .logo__img--footer {
    margin: 0 auto 8px;
    max-width: 160px;
  }
  .site-footer .footer__brand p {
    font-size: 0.82rem;
    max-width: 380px;
    margin: 0 auto;
  }
  .site-footer h4 {
    font-size: 0.82rem !important;
    margin-bottom: 8px !important;
    color: #c9a961;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .site-footer ul {
    gap: 4px !important;
  }
  .site-footer ul li {
    margin: 0 !important;
  }
  .site-footer ul li a {
    font-size: 0.82rem !important;
    padding: 4px 0;
    display: block;
    line-height: 1.4;
  }
  .site-footer .footer__contact {
    grid-column: 1 / -1 !important;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .site-footer .footer__contact p {
    font-size: 0.8rem;
    margin: 4px 0;
  }
  .site-footer__bottom,
  .footer__bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    font-size: 0.72rem !important;
  }
}

/* Mobile phones only */
@media (max-width: 480px) {
  .site-footer .container.grid--4 {
    grid-template-columns: 1fr !important;
  }
  .site-footer .footer__nav,
  .site-footer .footer__services {
    text-align: center;
  }
  .site-footer .footer__nav h4,
  .site-footer .footer__services h4 {
    text-align: center;
  }
}

/* ---- Extra Small Mobile (≤375px) ---- */
@media (max-width: 375px) {
  .container {
    padding-inline: 0.75rem;
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .page-hero {
    padding: calc(var(--space-3xl) + 60px) 0 var(--space-2xl);
  }

  .page-hero h1 {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .section__title {
    font-size: clamp(1.35rem, 6vw, 1.75rem);
  }

  .section__header {
    margin-bottom: var(--space-xl);
  }

  .btn {
    padding: 0.6rem 1.25rem;
    font-size: var(--fs-xs);
  }

  .btn-lg {
    padding: 0.65rem 1.25rem;
    font-size: var(--fs-sm);
  }

  .card {
    padding: var(--space-lg);
  }

  .testimonial__quote {
    font-size: var(--fs-sm);
  }

  .about-inline-stats {
    gap: var(--space-md);
  }

  .about-inline-stat__number {
    font-size: var(--fs-xl);
  }

  .footer__bottom {
    font-size: var(--fs-xs);
  }

  .section-wave {
    height: 30px;
  }

  .section-wave svg {
    height: 30px;
  }
}

/* ============================================================
   ===== MOBILE FIXES (≤1024px / ≤768px / ≤480px / ≤375px) =====
   ============================================================ */

/* ---- Header: hide auth buttons on mobile, keep only language + hamburger ---- */
@media (max-width: 1024px) {
  /* Hide login/register from header (they appear inside burger menu instead) */
  #headerAuthArea {
    display: none !important;
  }

  /* Tighten header actions spacing on tablet/mobile */
  .header-actions {
    gap: 8px;
  }

  /* Compact lang toggle */
  .lang-toggle {
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }
}

/* On very narrow phones (≤375px), hide language toggle too — accessible from menu */
@media (max-width: 375px) {
  .lang-toggle {
    display: none;
  }
}

/* ---- Mobile burger menu — show auth buttons inside the slide-out nav ---- */
@media (max-width: 1024px) {
  /* Inject auth buttons inside burger menu via existing nav-list at the bottom */
  .main-nav.nav--open #headerAuthArea--mobile {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-light-muted);
  }

  /* The drawer is WHITE, so the ghost "Вход"/profile button must stay readable
     even on pages with a dark header (otherwise it renders white-on-white and
     looks like it's missing — only the filled "Регистрация" shows). */
  .site-header .main-nav.nav--open #headerAuthArea--mobile .btn-ghost,
  .site-header.header--dark .main-nav.nav--open #headerAuthArea--mobile .btn-ghost,
  .site-header.header--scrolled.header--dark .main-nav.nav--open #headerAuthArea--mobile .btn-ghost {
    color: var(--color-accent-purple, #7243f2);
    border: 1px solid var(--color-accent-purple, #7243f2);
    background: transparent;
  }
}

/* ---- Cookie consent banner — mobile redesign ---- */
@media (max-width: 768px) {
  .cookie-banner {
    padding: 14px 16px !important;
    font-size: 12.5px !important;
    line-height: 1.45 !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .cookie-banner__inner {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
    text-align: left !important;
    max-width: 100% !important;
  }

  .cookie-banner__text {
    font-size: 12.5px !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .cookie-banner__actions {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
    justify-content: stretch !important;
  }

  .cookie-banner__actions button {
    flex: 1 1 0 !important;
    font-size: 13px !important;
    padding: 10px 14px !important;
    white-space: nowrap;
  }
}

/* Very narrow phones — stack cookie buttons */
@media (max-width: 375px) {
  .cookie-banner__actions {
    flex-direction: column !important;
  }
  .cookie-banner__actions button {
    width: 100%;
  }
}

/* ---- Hero titles — responsive font sizing ---- */
@media (max-width: 768px) {
  .crash-hero__intro h1,
  .appl-hero__title,
  .page-hero h1,
  .page-hero__title {
    font-size: clamp(22px, 5.8vw, 32px) !important;
    line-height: 1.15 !important;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
  }

  .crash-hero__intro p,
  .appl-hero__sub,
  .page-hero p,
  .page-hero__subtitle {
    font-size: clamp(13px, 3.4vw, 15px) !important;
    line-height: 1.55 !important;
    max-width: 100%;
    overflow-wrap: break-word;
  }

  /* Section titles on mobile */
  .section__title {
    font-size: clamp(20px, 5.2vw, 28px) !important;
    line-height: 1.2 !important;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }

  .section__subtitle {
    font-size: clamp(12.5px, 3.3vw, 15px) !important;
    line-height: 1.55 !important;
    max-width: 100%;
  }
}

/* Even smaller phones — extra compaction */
@media (max-width: 375px) {
  .crash-hero__intro h1,
  .appl-hero__title,
  .page-hero h1,
  .page-hero__title {
    font-size: 22px !important;
    letter-spacing: -0.01em !important;
  }

  .section__title {
    font-size: 20px !important;
  }
}

/* ---- Container padding on mobile (more content space) ---- */
@media (max-width: 480px) {
  .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

@media (max-width: 375px) {
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* ---- Calculators page — feature icon grid wraps on mobile ---- */
@media (max-width: 768px) {
  .feature-icon-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .feature-icon-item {
    padding: 16px 10px !important;
  }

  .feature-icon-item__title {
    font-size: 13px !important;
    line-height: 1.3;
  }

  .feature-icon-item__desc {
    font-size: 11px !important;
  }
}

/* ---- App-shell sidebar on mobile (calculators/collision/indictment/ai-check pages) ---- */
@media (max-width: 768px) {
  .app-shell__nav {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .app-shell__nav::-webkit-scrollbar {
    display: none;
  }

  .app-shell__nav-item {
    flex-shrink: 0 !important;
    white-space: nowrap;
    font-size: 12.5px !important;
    padding: 10px 14px !important;
  }
}

/* ---- App showcase panel cards — comfortable on narrow screens ---- */
@media (max-width: 480px) {
  .app-mockup__panel {
    padding: 16px !important;
  }
  .app-mockup__panel-header h3 {
    font-size: 16px !important;
  }
  .app-mockup__mini-ui {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .app-mockup__mini-result {
    margin-left: 0 !important;
    text-align: center;
    font-size: 22px !important;
  }
}

/* ---- Pricing cards on mobile ---- */
@media (max-width: 768px) {
  .pricing-cards,
  #pricingGrid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .p-card {
    padding: 24px 20px !important;
  }

  .p-card__name {
    font-size: 14px !important;
  }

  .p-card__amount {
    font-size: 56px !important;
  }
}

/* ---- AI demo / showcase grid stack on mobile ---- */
@media (max-width: 768px) {
  .showcase__grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}

/* ---- Live calc layout stack on mobile ---- */
@media (max-width: 991px) {
  .live-calc {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* ---- Crash hero content (post-scroll CTA buttons stack) ---- */
@media (max-width: 480px) {
  .crash-hero__ctas {
    flex-direction: column !important;
    width: 100%;
    gap: 8px !important;
  }

  .crash-hero__ctas .btn {
    width: 100%;
    text-align: center;
  }
}

/* ---- Feature card list flow on mobile (wrap with smaller separator) ---- */
@media (max-width: 480px) {
  .app-mockup__panel-flow {
    font-size: 11.5px !important;
    line-height: 1.6 !important;
  }
}

/* ---- Site-wide: prevent horizontal overflow ---- */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }

  body * {
    max-width: 100vw;
  }

  /* Catch elements that might cause horizontal scroll */
  img, video, iframe, .container > *, h1, h2, h3, p {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Header itself fits viewport */
  .site-header,
  .site-header__inner,
  .site-header > div,
  .header-actions,
  .container {
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

/* ---- Trust bar wrap on mobile ---- */
@media (max-width: 768px) {
  .trust-bar__badges {
    flex-wrap: wrap !important;
    justify-content: center;
    gap: 8px !important;
  }

  .trust-badge {
    font-size: 11.5px !important;
    padding: 6px 12px !important;
  }

  .trust-badge svg {
    width: 14px !important;
    height: 14px !important;
  }
}

/* ---- Collision page — inputs and tabs ---- */
@media (max-width: 768px) {
  .collision-tabs,
  .calc-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .collision-tab,
  .calc-tab {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* ---- About page hero ---- */
@media (max-width: 768px) {
  .about-hero-layout {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}
