/* =============================================
   LARXIUS TECHNOLOGIES — MOBILE APP EXPERIENCE
   ============================================= */

/* -------------------------------------------
   MOBILE HEADER
   ------------------------------------------- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 1029;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

.mobile-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-header-brand img {
  height: 28px;
  width: auto;
}

.mobile-header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.mobile-header-cta {
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-right: 8px;
}

.mobile-header-cta:active {
  transform: scale(0.95);
}

/* -------------------------------------------
   BOTTOM NAVIGATION
   ------------------------------------------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 1030;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
}

.bottom-nav-items {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  flex: 1;
  height: 100%;
  padding-top: 10px;
  padding-bottom: 10px;
  text-decoration: none;
  color: var(--color-text-light);
  position: relative;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active {
  transform: scale(0.9);
}

.bottom-nav-item.active {
  color: var(--color-primary);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 0 0 4px 4px;
}

.bottom-nav-item i {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.bottom-nav-item.active i {
  transform: scale(1.1);
  animation: navIconPop 0.3s ease;
}

.bottom-nav-item span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

@keyframes navIconPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1.1); }
}

/* -------------------------------------------
   MOBILE SCROLL BEHAVIOR
   ------------------------------------------- */
html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* -------------------------------------------
   MOBILE LAYOUT OPTIMIZATIONS
   ------------------------------------------- */

/* Horizontal scroll cards */
.mobile-scroll-container {
  display: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 16px;
  padding: 0 16px 16px;
  scrollbar-width: none;
}

.mobile-scroll-container::-webkit-scrollbar {
  display: none;
}

.mobile-scroll-container > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Swipeable card styling */
.mobile-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 280px;
  max-width: 300px;
  transition: all 0.2s ease;
}

.mobile-card:active {
  transform: scale(0.98);
}

/* -------------------------------------------
   TABLET (max-width: 991px) — show mobile header
   ------------------------------------------- */
@media (max-width: 991px) {
  html, body {
    overflow-x: hidden;
  }

  .section {
    overflow-x: hidden;
  }

  .mobile-header {
    display: flex;
  }

  body {
    padding-top: 56px;
  }

  /* Hide desktop navbar on tablet/mobile */
  #mainNav {
    display: none !important;
  }

  /* Mobile card grids — fit device width */
  .industries-section .row.g-4 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 0 16px !important;
    overflow: visible;
  }

  .products-section .row.g-4 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 0 16px !important;
    overflow: visible;
  }

  .industries-section .row.g-4 > *,
  .products-section .row.g-4 > * {
    min-width: 0;
    width: 100% !important;
    flex: unset !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .industry-card {
    padding: 18px 12px;
    height: auto;
    text-align: center;
    border-radius: 12px;
  }

  .industry-icon {
    width: 44px;
    height: 44px;
    min-width: unset;
    margin: 0 auto 10px;
    flex-shrink: unset;
  }

  .industry-icon i {
    font-size: 20px;
  }

  .industry-card h4,
  .industry-card .industry-name {
    font-size: 14px;
    margin-bottom: 4px;
  }

  .industry-card p,
  .industry-card .industry-desc {
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
  }

  .industry-card-text {
    flex: 1;
    min-width: 0;
  }

  .overview-card {
    padding: 28px 24px;
  }

  .overview-logo img {
    height: 56px;
  }
}

/* -------------------------------------------
   MOBILE (max-width: 768px) — full mobile experience
   ------------------------------------------- */
@media (max-width: 768px) {
  .bottom-nav {
    display: block;
  }

  body {
    padding-bottom: 64px;
  }

  /* Push RAI chat widget above bottom nav */
  #ai-chat-btn {
    bottom: 80px !important;
  }

  #ai-chat-box {
    bottom: 80px !important;
  }

  /* Back-to-top on mobile — above bottom nav */
  .back-to-top {
    bottom: 140px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .why-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .why-grid > * {
    min-width: 0;
  }

  .faq-section .accordion {
    display: block;
  }

  /* Touch-friendly buttons */
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Better section spacing */
  .section {
    padding: 48px 0;
  }

  /* Hero adjustments */
  .hero-section {
    padding-top: 20px;
  }

  .hero-section .row {
    display: flex;
    flex-direction: column;
  }

  .hero-section .col-lg-6:first-child {
    order: 2;
    margin-top: 32px;
  }

  .hero-section .col-lg-6:nth-child(2) {
    order: 1;
  }

  .hero-section .col-12 {
    order: 3;
    margin-top: 24px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  /* Services hero mobile */
  .sp-hero {
    padding: 10px 0 20px;
  }

  .section {
    padding: 40px 0;
  }

  .sp-detail-section {
    padding: 40px 0;
  }

  .sp-categories-section {
    padding: 40px 0;
  }

  .sp-hero .row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: auto !important;
  }

  .min-vh-sp-hero {
    min-height: auto !important;
    display: flex;
    flex-direction: column;
  }

  .sp-hero .col-lg-6:first-child {
    order: 2;
    margin-top: 20px;
  }

  .sp-hero .col-lg-6:nth-child(2) {
    order: 1;
  }

  .sp-hero-image {
    height: 240px;
  }

  .sp-detail-image {
    height: 240px;
  }

  .sp-detail-title {
    font-size: 26px;
  }

  /* Overview cards mobile */
  .products-section .row .col-md-4 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  .overview-card {
    padding: 28px 24px;
  }

  .overview-logo img {
    height: 56px;
  }

  /* Industries mobile - 1 column */
  .industries-section .row .col-6 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  .industry-card {
    padding: 24px 16px;
    text-align: center;
  }

  .industry-icon {
    width: 48px;
    height: 48px;
    font-size: 22px;
    margin: 0 auto 12px;
  }

  .industry-name {
    font-size: 15px;
  }

  .industry-desc {
    font-size: 13px;
  }

  /* CTA section mobile */
  .cta-wrapper {
    padding: 32px 20px;
    text-align: center;
  }

  .cta-mascot {
    height: 180px;
    margin-bottom: 24px;
  }

  .cta-title {
    font-size: 28px;
  }

  .cta-text {
    margin-left: auto;
    margin-right: auto;
  }

  .cta-buttons {
    justify-content: center;
  }

  /* Testimonials mobile */
  .testimonial-card {
    padding: 24px 20px;
  }

  /* FAQ mobile */
  .faq-section .row.align-items-start {
    flex-direction: column;
  }

  .faq-section .col-lg-5,
  .faq-section .col-lg-7 {
    max-width: 100%;
  }

  /* Section titles */
  .section-title {
    font-size: 26px;
  }

  .section-label {
    font-size: 12px;
  }
}

/* -------------------------------------------
   VERY SMALL MOBILE (max-width: 374px)
   ------------------------------------------- */
@media (max-width: 374px) {
  .mobile-header-title {
    font-size: 14px;
  }

  .bottom-nav-item i {
    font-size: 20px;
  }

  .bottom-nav-item span {
    font-size: 9px;
  }
}
