/* ==========================================================================
   VITAMINO INDIA PVT LTD. - Master Mobile Button & Anti-Clipping Ruleset
   Fixes all button overflow, long button text, cut-off headings & phone layouts
   ========================================================================== */

/* Core Global Viewport Lock */
html {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
}

body {
  overflow-x: clip !important;
  width: 100% !important;
  position: relative;
}

*, *::before, *::after {
  max-width: 100%;
}

img, svg, iframe, video, canvas {
  max-width: 100% !important;
  height: auto;
}

h1, h2, h3, h4, h5, h6, p, span, a, label, th, td, button {
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
}

.container {
  width: 100% !important;
  max-width: var(--container-max) !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* Specification Tables Mobile Touch Scroll Containment */
.spec-table-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.spec-table {
  width: 100% !important;
  min-width: 280px !important;
}

/* Laptop & Small Desktop (<= 1199px) */
@media (max-width: 1199px) {
  :root {
    --container-max: 960px;
  }

  .section-title {
    font-size: 2.25rem;
  }

  .footer-grid {
    grid-template-columns: 1.2fr 0.8fr 1fr 1.1fr;
    gap: 32px;
  }

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

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

/* Tablet Layout (<= 991px) */
@media (max-width: 991px) {
  :root {
    --header-height: 76px;
  }

  .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .nav-links, .header-cta {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .section-padding {
    padding: 50px 0 !important;
  }

  .section-title {
    font-size: 1.85rem !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }

  .hero-section .container {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    text-align: center;
  }

  /* Inline 2-Column Grid Overrides for Hero & About Banners */
  div[style*="grid-template-columns: 1.2fr 0.8fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1.2fr"],
  div[style*="grid-template-columns: 0.9fr 1.1fr"] {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    width: 100% !important;
  }

  /* Multi-Column Grid Overrides for Tablets */
  div[style*="grid-template-columns: repeat(5, 1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px !important;
  }

  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }

  div[style*="grid-template-columns: repeat(6, 1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px !important;
  }

  .products-grid .product-card,
  .product-grid .product-card {
    width: calc(33.333% - 14px) !important;
  }

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

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  /* Hide floating hero elements that cause overflow on tablets */
  .floating-hero-pill {
    display: none !important;
  }
}

/* Mobile Layout (<= 767px) — COMPREHENSIVE PHONE FIXES */
@media (max-width: 767px) {
  .announcement-bar {
    display: none !important;
  }

  .main-header {
    height: 66px !important;
  }

  .header-actions .btn {
    display: none !important; /* Hide header CTA button on phone to prevent logo overlap */
  }

  .brand-logo img {
    height: 38px !important;
    max-width: 160px !important;
  }

  .section-padding {
    padding: 36px 0 !important;
  }

  /* Headings Scaling Down to Prevent Cut-Off */
  .section-title {
    font-size: 1.5rem !important;
    line-height: 1.25 !important;
  }

  .section-subtitle {
    font-size: 0.875rem !important;
    margin-bottom: 20px !important;
  }

  h1[style*="font-size: 3.25rem"],
  h1[style*="font-size: 2.75rem"],
  h1[style*="font-size: 2.5rem"],
  h1 {
    font-size: 1.75rem !important;
    line-height: 1.25 !important;
  }

  h2[style*="font-size: 2.25rem"],
  h2[style*="font-size: 1.85rem"],
  h2 {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
  }

  h3 {
    font-size: 1.15rem !important;
  }

  p {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
  }

  /* BUTTON FIXES FOR PHONE (Prevent Overflow & Clipping) */
  .btn,
  button.btn,
  a.btn {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 16px !important;
    font-size: 0.85rem !important;
    white-space: normal !important;
    text-align: center !important;
    justify-content: center !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

  .btn span {
    white-space: normal !important;
    word-break: break-word !important;
    text-align: center !important;
    line-height: 1.3 !important;
  }

  .btn svg {
    flex-shrink: 0;
  }

  /* Button Wrappers */
  div[style*="display: flex; gap: 20px; justify-content: center"],
  div[style*="display: flex; gap: 16px; flex-wrap: wrap"],
  div[style*="display: flex; gap: 12px"] {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  /* Category & Filter Tab Buttons */
  .category-tabs,
  .sector-tabs,
  .showcase-tabs {
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
  }

  .category-btn,
  .sector-tab-btn,
  .showcase-tab-btn {
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
    white-space: normal !important;
  }

  /* Multi-Column Grid Overrides for Mobile */
  div[style*="grid-template-columns: repeat(5, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  div[style*="grid-template-columns: repeat(6, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Product Catalog Cards Mobile Width */
  .products-grid .product-card,
  .product-grid .product-card {
    width: calc(50% - 6px) !important;
    min-width: 0 !important;
  }

  .product-card-body {
    padding: 12px !important;
  }

  .product-card-title {
    font-size: 0.95rem !important;
  }

  .product-card-desc {
    font-size: 0.8rem !important;
    margin-bottom: 10px !important;
  }

  .product-card-actions {
    flex-direction: column !important;
    gap: 6px !important;
  }

  .superiority-grid,
  .qa-matrix-grid,
  .testimonials-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  /* QA 7-Stage Pipeline Sequence Cards Mobile */
  div[style*="display: flex; align-items: center; gap: 28px"] {
    flex-direction: column !important;
    text-align: center !important;
    padding: 20px 14px !important;
    gap: 10px !important;
  }

  /* Form & Estimator Cards Padding */
  div[style*="padding: 56px"],
  div[style*="padding: 44px"],
  div[style*="padding: 40px"],
  div[style*="padding: 32px"] {
    padding: 20px 14px !important;
  }

  /* Form Inputs Padding */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    padding: 10px 12px !important;
    font-size: 0.85rem !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .footer-bottom {
    flex-direction: column !important;
    gap: 12px !important;
    text-align: center !important;
  }

  .whatsapp-float {
    bottom: 16px !important;
    right: 12px !important;
    padding: 8px 14px !important;
    font-size: 0.75rem !important;
  }

  .whatsapp-float svg {
    width: 18px !important;
    height: 18px !important;
  }
}

/* Small Mobile & Foldables (<= 479px) */
@media (max-width: 479px) {
  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .brand-logo img {
    height: 34px !important;
    max-width: 140px !important;
  }

  h1[style*="font-size: 3.25rem"],
  h1[style*="font-size: 2.75rem"],
  h1 {
    font-size: 1.5rem !important;
  }

  div[style*="grid-template-columns: repeat(5, 1fr)"],
  div[style*="grid-template-columns: repeat(6, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* 1 Product Per Row on Small Mobile */
  .products-grid .product-card,
  .product-grid .product-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .btn {
    padding: 10px 14px !important;
    font-size: 0.8rem !important;
  }
}
