/* ==========================================================================
   CO.ME.S. INDIA - Responsive Overrides & Mobile Polish
   ========================================================================== */

/* Prevent any horizontal overflow across all viewports */
html, body {
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
}

@media (max-width: 1199.98px) {
  .hero-title {
    font-size: 2.8rem;
  }
  .hero-visual-card img {
    height: 350px;
  }
}

@media (max-width: 991.98px) {
  /* Prevent horizontal AOS translations from causing mobile viewport overflow */
  [data-aos="fade-left"],
  [data-aos="fade-right"] {
    transform: translate3d(0, 0, 0) !important;
  }

  .section-padding {
    padding: 65px 0;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .hero-section {
    padding: 60px 0 70px;
  }
  
  .hero-title {
    font-size: 2.4rem;
  }
  
  .hero-visual-card {
    margin-top: 40px;
  }
  
  .hero-visual-card img {
    height: 320px;
  }
  
  .hero-float-badge {
    bottom: -15px;
    left: 10px;
    padding: 10px 16px;
  }
  
  .top-bar-left, .top-bar-right {
    text-align: center;
  }
  
  .top-bar-item {
    margin-right: 12px;
    font-size: 0.78rem;
  }

  .stat-number {
    font-size: 2.4rem;
  }
  
  .navbar-collapse {
    background: #FFFFFF;
    border-radius: 14px;
    padding: 16px 14px;
    margin-top: 12px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
    border: 1px solid var(--border-color);
  }

  .navbar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .nav-link {
    padding: 11px 16px !important;
    border-radius: 6px;
    color: #1E293B !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    background: transparent !important;
  }

  .nav-link:hover {
    background-color: rgba(139, 21, 21, 0.04) !important;
    color: var(--primary) !important;
  }

  .nav-link.active {
    background-color: transparent !important;
    background: transparent !important;
    color: var(--primary) !important;
    font-weight: 700;
    border-left: 3.5px solid var(--primary);
    padding-left: 16px !important;
  }

  /* Fix Bootstrap g-5 gutter overflow on medium/small viewports */
  .row.g-5 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
  }

  /* Ensure comparison and responsive tables scroll cleanly */
  .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }
}

@media (max-width: 767.98px) {
  .section-padding {
    padding: 50px 0;
  }

  .hero-title {
    font-size: 2rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .hero-visual-card .hero-visual-stage {
    height: 280px;
  }

  .hero-visual-card .hero-visual-stage.hero-heads-slider-stage {
    height: 330px;
  }

  .hero-heads-slider-stage .hero-slide-head-img {
    max-height: 200px;
  }

  .hero-heads-slider-stage .hero-slide-head-title {
    font-size: 1.05rem;
  }

  .hero-swiper-prev,
  .hero-swiper-next {
    width: 32px;
    height: 32px;
  }

  .hero-swiper-prev::after,
  .hero-swiper-next::after {
    font-size: 11px;
  }

  .hero-visual-card .hero-main-img {
    height: 100%;
    max-height: none;
  }

  .hero-float-badge, .hero-float-badge-2 {
    position: static;
    display: inline-flex;
    margin-top: 10px;
    margin-right: 6px;
    padding: 8px 12px;
    font-size: 0.78rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    animation: none;
    border-radius: 8px;
  }

  .hero-bg-accent {
    width: 320px;
    height: 320px;
    right: -40px;
  }

  .trust-item {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 16px;
    margin-bottom: 10px;
  }

  .filter-btn-group {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 10px;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    width: 100%;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    font-size: 26px;
  }

  .back-to-top {
    bottom: 84px;
    right: 22px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .form-card {
    padding: 24px 18px;
  }

  .footer-main {
    padding-top: 50px;
  }
  
  .stat-box {
    padding: 15px 5px;
  }
  
  .stat-number {
    font-size: 2.1rem;
  }

  /* Blueprint Feature Action Buttons Stack on Mobile */
  .blueprint-action-btns,
  .schematic-feature-card .d-flex.gap-3 {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .blueprint-action-btns .btn,
  .schematic-feature-card .d-flex.gap-3 .btn {
    width: 100%;
    justify-content: center;
  }

  /* Table padding fix */
  .table-responsive {
    padding: 12px 8px !important;
    border-radius: 10px !important;
  }

  .table-responsive table {
    min-width: 520px;
  }
}

@media (max-width: 575.98px) {
  .hero-title {
    font-size: 1.75rem;
  }
  
  /* Stack standalone CTAs on mobile without breaking flex rows */
  .hero-action-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .hero-action-btns .btn,
  .form-card .btn,
  .btn-block-mobile {
    width: 100%;
    justify-content: center;
  }

  /* Product Card & Specs Polish for Mobile */
  .product-card {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
  }

  .product-card-top {
    padding: 8px 12px;
  }

  .product-img-wrapper {
    height: 180px;
    padding: 12px;
  }

  .product-body {
    padding: 14px;
  }

  .product-title {
    font-size: 1rem;
    height: auto;
    max-height: 2.8em;
  }

  .product-specs-list {
    margin: 0 0 12px 0;
    padding: 6px 0;
  }

  .product-specs-list li {
    font-size: 0.78rem;
    gap: 8px;
  }

  .product-specs-list li span.val {
    text-align: right;
    word-break: break-word;
  }

  /* Product Footer Buttons: Clean Side-by-Side Flex */
  .product-footer {
    display: flex;
    gap: 6px;
    width: 100%;
  }

  .product-footer .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Category card footer with icon button */
  .product-footer .btn.px-3 {
    flex: 0 0 42px;
    width: 42px;
    padding: 8px 0;
    justify-content: center;
  }

  /* Filter Tabs strictly bounded with smooth touch scroll */
  .head-filter-tabs {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    width: 100%;
  }

  .head-tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: 0.82rem;
  }

  /* Component Pills strictly bounded */
  .component-filter-pills {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    width: 100%;
    margin-top: 6px;
  }

  .comp-pill-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 0.78rem;
  }

  /* Hide scrollbars for clean horizontal swipe */
  .head-filter-tabs::-webkit-scrollbar,
  .component-filter-pills::-webkit-scrollbar,
  .filter-btn-group::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
  }

  .head-filter-tabs,
  .component-filter-pills,
  .filter-btn-group {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .bg-factory-watermark::before,
  .bg-blueprint-watermark::before {
    width: 90%;
    max-width: 100%;
    opacity: 0.08;
    background-position: right top;
  }
}

/* Touch & Mobile Optimizations for 3D Tilt */
@media (hover: none) and (pointer: coarse) {
  [data-tilt],
  .tilt-card {
    transform: none !important;
  }
  .tilt-glare {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  .spindle-telemetry-hud {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .telemetry-item {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
  }
  .telemetry-item:last-child {
    border-bottom: none;
  }
}

@media (max-width: 350px) {
    .hero-stage-overlay {
      padding: 24px 0px 16px;
    }
}


