/* ============================================
   Tracker365 — Mobile-only layout
   Applies ONLY below 768px.
   Laptop / desktop CSS is never overridden here.
   ============================================ */

@media (max-width: 767px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  img,
  video {
    max-width: 100%;
    height: auto;
  }

  /* ----- Navbar: compact + tappable ----- */
  .bottom-navbar {
    padding: 10px 16px !important;
    gap: 12px;
    height: auto !important;
    min-height: var(--navbar-total-height, 65px);
  }

  .navbar-logo {
    height: 40px;
    flex-shrink: 0;
  }

  .navbar-logo img {
    max-height: 40px;
  }

  .pres-nav-toggle,
  .nav-toggle {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  /* Homepage: hamburger menu already exists — make items full-width */
  body.pres-page .bottom-navbar .navbar-links {
    align-items: stretch;
    background: #ffffff;
    z-index: 1100;
    padding: 0.75rem 1rem 1.25rem;
  }

  body.pres-page .nav-button {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    font-size: 15px !important;
    padding: 12px 16px !important;
    border-radius: 12px;
    white-space: normal;
    box-sizing: border-box;
  }

  body.pres-page .nav-dropdown {
    width: 100%;
    position: relative;
  }

  body.pres-page .nav-dropdown .nav-button {
    display: flex;
    justify-content: space-between;
    text-align: left;
  }

  body.pres-page .nav-dropdown-content {
    display: none;
    position: static;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: #f4f8ff;
    border-radius: 12px;
    box-shadow: none;
    border: 1px solid rgba(0, 74, 173, 0.08);
    margin: 4px 0 8px;
    padding: 4px 0;
  }

  body.pres-page .nav-dropdown.open .nav-dropdown-content,
  body.pres-page .nav-dropdown:hover .nav-dropdown-content {
    display: block;
  }

  body.pres-page .nav-dropdown-content a {
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 14px;
    padding: 10px 16px;
    white-space: normal;
  }

  /* Inner pages without hamburger: horizontal scroll, readable labels */
  body:not(.pres-page):not(.has-nav-toggle) {
    padding-top: calc(var(--navbar-total-height, 65px) + 48px) !important;
  }

  body:not(.pres-page) .bottom-navbar:not(.has-nav-toggle) {
    flex-wrap: wrap !important;
    overflow: visible;
  }

  body:not(.pres-page) .bottom-navbar:not(.has-nav-toggle) .navbar-links {
    flex: 1 1 100%;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  body:not(.pres-page) .bottom-navbar:not(.has-nav-toggle) .navbar-links::-webkit-scrollbar {
    display: none;
  }

  body:not(.pres-page) .bottom-navbar:not(.has-nav-toggle) .nav-button {
    flex-shrink: 0;
    min-height: 40px;
    font-size: 14px !important;
    padding: 8px 14px !important;
  }

  body:not(.pres-page) .bottom-navbar:not(.has-nav-toggle) .nav-dropdown-content {
    min-width: 200px;
  }

  /* Inner pages with hamburger: keep a single-row bar */
  body:not(.pres-page).has-nav-toggle {
    padding-top: var(--navbar-total-height, 65px) !important;
  }

  body:not(.pres-page) .bottom-navbar.has-nav-toggle {
    flex-wrap: nowrap !important;
    overflow: visible;
  }

  body:not(.pres-page) .bottom-navbar.has-nav-toggle .navbar-links {
    flex: none;
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: hidden;
    overflow-y: auto;
    align-items: stretch;
    background: #ffffff;
    z-index: 1100;
    padding: 0.75rem 1rem 1.25rem;
    gap: 0.25rem;
  }

  body:not(.pres-page) .bottom-navbar.has-nav-toggle .nav-button {
    width: 100%;
    flex-shrink: 1;
    min-height: 44px;
    font-size: 15px !important;
    padding: 12px 16px !important;
    border-radius: 12px;
    white-space: normal;
    box-sizing: border-box;
    justify-content: flex-start;
  }

  body:not(.pres-page) .bottom-navbar.has-nav-toggle .nav-dropdown {
    width: 100%;
    position: relative;
  }

  body:not(.pres-page) .bottom-navbar.has-nav-toggle .nav-dropdown .nav-button {
    display: flex;
    justify-content: space-between;
    text-align: left;
  }

  body:not(.pres-page) .bottom-navbar.has-nav-toggle .nav-dropdown-content {
    display: none;
    position: static;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: #f4f8ff;
    border-radius: 12px;
    box-shadow: none;
    border: 1px solid rgba(0, 74, 173, 0.08);
    margin: 4px 0 8px;
    padding: 4px 0;
  }

  body:not(.pres-page) .bottom-navbar.has-nav-toggle .nav-dropdown.open .nav-dropdown-content,
  body:not(.pres-page) .bottom-navbar.has-nav-toggle .nav-dropdown:hover .nav-dropdown-content {
    display: block;
  }

  body:not(.pres-page) .bottom-navbar.has-nav-toggle .nav-dropdown-content a {
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 14px;
    padding: 10px 16px;
    white-space: normal;
  }

  /* ----- Home hero infographic: real stacked UI (no scale shrink) ----- */
  .home-hero-block {
    padding: 1.25rem 0 2rem;
  }

  .home-hero-block .hero-section {
    padding: 0 16px;
  }

  .home-hero-block .hero-section h1 {
    font-size: 1.5rem !important;
    line-height: 1.25;
  }

  .home-hero-block .hero-section p {
    font-size: 0.95rem !important;
    margin: 12px 0 0 !important;
    padding: 0 !important;
    line-height: 1.6;
  }

  .home-hero-block,
  .home-hero-block * {
    box-sizing: border-box;
  }

  .home-hero-block .container {
    position: relative;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto 0;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
  }

  .home-hero-block .ring,
  .home-hero-block .dots {
    display: none;
  }

  .home-hero-block .center-image {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: min(220px, 62vw);
    height: auto;
    margin: 0 auto 1.25rem;
    border-radius: 24px;
  }

  .home-hero-block .floating-cards {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .home-hero-block .card {
    position: relative;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 92px;
    margin: 0;
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 11px;
    line-height: 1.35;
    transform: none !important;
    animation: none !important;
    --x: 0;
    --y: 0;
  }

  .home-hero-block .card i {
    font-size: 20px;
    margin-bottom: 6px;
  }

  /* ----- Presentation sections ----- */
  .pres-section {
    padding: 2.5rem 1rem !important;
  }

  .pres-hero {
    min-height: 0;
    padding: 2rem 1rem 2.5rem !important;
  }

  .pres-hero__inner,
  .pres-walkthrough__layout,
  .pres-mobile__layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .pres-hero__title {
    font-size: 1.75rem;
  }

  .pres-hero__subtitle {
    font-size: 1rem;
    min-height: 0;
  }

  .pres-hero__content {
    max-width: 100%;
    text-align: left;
  }

  .pres-hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .pres-hero__actions .pres-btn,
  .pres-cta__actions .pres-btn {
    width: 100%;
    min-height: 48px;
  }

  .pres-heading {
    font-size: 1.5rem;
  }

  .pres-problems__grid,
  .pres-features__grid,
  .pres-security__grid,
  .pres-faq__list {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .pres-problem-card,
  .pres-feature-card,
  .pres-security-card {
    padding: 1.25rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
  }

  .pres-security__grid {
    width: 100%;
    max-width: 100%;
  }

  .pres-security-card {
    flex-direction: column;
    gap: 0.85rem;
    transform: none !important;
  }

  .pres-lifecycle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 0.75rem;
  }

  .pres-lifecycle__arrow {
    display: none;
  }

  .pres-walkthrough__nav {
    grid-template-columns: repeat(2, 1fr);
    justify-content: stretch;
    gap: 0.5rem;
  }

  .pres-walkthrough__nav-btn {
    width: 100%;
    min-height: 44px;
    font-size: 0.8rem;
    padding: 0.55rem 0.5rem;
    text-align: center;
  }

  .pres-walkthrough__panel h3 {
    font-size: 1.25rem;
  }

  .pres-dash-app {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .pres-dash-sidebar {
    width: 100%;
    max-width: 100%;
    max-height: none;
    position: static;
    flex: none;
    overflow: visible;
    box-sizing: border-box;
  }

  .pres-dash-sidebar__nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex-direction: unset;
    flex-wrap: unset;
    overflow: visible;
    gap: 0.4rem;
    padding: 0.65rem 0.5rem 0.85rem;
  }

  .pres-dash-sidebar__item {
    width: 100% !important;
    flex: none;
    min-height: 42px;
    min-width: 0;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.72rem;
    padding: 0.5rem 0.55rem;
  }

  .pres-dash-sidebar__item span {
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pres-dash-preview {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .pres-mobile__phone {
    width: min(220px, 70vw);
  }

  .pres-cta {
    padding: 2rem 1rem !important;
  }

  .pres-cta__box {
    padding: 2rem 1.25rem;
    border-radius: 16px;
  }

  .pres-cta__box h2 {
    font-size: 1.5rem;
  }

  .pres-cta__box p {
    font-size: 1rem;
  }

  .pres-faq__question {
    min-height: 48px;
    font-size: 0.95rem;
    gap: 0.75rem;
  }

  .pres-demo-modal {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .pres-demo-modal__panel {
    width: 100%;
    max-height: min(92vh, 100% - 0.75rem);
    border-radius: 16px 16px 0 0;
  }

  /* ----- Feature pages ----- */
  .feature-page {
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
    max-width: 100%;
    overflow-x: hidden;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .feature-two-col,
  .feature-content,
  .feature-gallery-wrap,
  .slider-container,
  .highlight-box,
  .feature-page-desc,
  .feature-steps,
  .feature-steps li {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }

  .feature-two-col {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    gap: 1.5rem;
    width: 100%;
  }

  .feature-gallery-wrap {
    position: static;
  }

  .feature-page-title {
    font-size: 1.6rem;
  }

  .feature-page-desc {
    font-size: 0.98rem;
  }

  .highlight-box {
    padding: 1rem;
  }

  .feature-steps .step-text {
    min-width: 0;
    flex: 1;
  }

  .slider-arrows {
    width: 36px;
    height: 36px;
  }

  .modal {
    padding: 1rem;
  }

  .modal-content {
    max-width: 100%;
    max-height: 70vh;
  }

  /* ----- Product listing pages ----- */
  .products-page-hero,
  .features-section,
  .features-section-inner,
  .feature-cards-grid,
  .feature-card-link,
  .feature-card,
  .product-back-bar {
    box-sizing: border-box;
    max-width: 100%;
  }

  .products-page-hero {
    width: 100%;
    padding: 28px 16px 24px;
  }

  .products-page-hero h1 {
    font-size: 1.6rem;
  }

  .products-page-hero p {
    font-size: 1rem;
    padding: 0 4px;
  }

  .features-section {
    width: 100%;
    padding: 32px 16px 48px;
    overflow: hidden;
  }

  .features-section-inner {
    width: 100%;
    padding: 0;
    margin: 0 auto;
  }

  .feature-cards-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
    width: 100%;
    min-width: 0;
  }

  .feature-card-link {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .feature-card {
    width: 100%;
    min-width: 0;
    padding: 22px 18px;
  }

  .product-back-bar {
    width: 100%;
    padding: 16px 16px 0;
  }

  /* ----- Product Details infographics ----- */
  h2.page-heading {
    font-size: 1.5rem;
    padding: 0 12px;
  }

  .main-wrapper {
    flex-direction: column;
    padding: 12px 8px;
    gap: 16px;
    overflow: hidden;
  }

  .main-wrapper .container,
  .software-subscription-section .container,
  .procurement-section .container {
    width: min(100%, 320px);
    height: auto;
    min-height: 280px;
    margin-left: 0;
    left: auto !important;
    top: auto !important;
  }

  .main-wrapper .center-image,
  .center-image {
    width: min(180px, 55vw);
    padding-top: 24px;
  }

  .services-section-inner {
    padding: 36px 16px 48px;
  }

  .services-section h2 {
    font-size: 1.5rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* ----- Footer ----- */
  .footer {
    padding: 36px 16px 24px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 28px;
  }

  .footer-section {
    min-width: 0;
  }

  .footer-section .company-description {
    max-width: 100%;
  }

  .footer-section h2 {
    margin-left: auto;
    margin-right: auto;
  }

  .social-links {
    justify-content: center;
  }

  .contact-info p {
    justify-content: center;
  }

  .legal-wrap {
    padding: 1.25rem 1rem 2.5rem;
  }

  .legal-wrap h1 {
    font-size: 1.5rem;
  }

  .legal-article {
    padding: 1.25rem 1rem;
    border-radius: 12px;
  }

  .legal-article h2 {
    font-size: 1.1rem;
  }

  .legal-article p,
  .legal-article li {
    font-size: 0.95rem;
  }
}

@media (max-width: 479px) {
  .home-hero-block .floating-cards {
    grid-template-columns: 1fr;
  }

  .home-hero-block .card {
    min-height: 72px;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: 10px;
    padding: 12px 14px;
    font-size: 12px;
  }

  .home-hero-block .card i {
    margin-bottom: 0;
    font-size: 18px;
  }

  .pres-lifecycle {
    grid-template-columns: 1fr;
  }

  .pres-walkthrough__nav {
    grid-template-columns: 1fr 1fr;
  }
}
