/* ==========================================================================
   KALYAN INFOTECH - RESPONSIVE STYLESHEET
   Mobile-First & Tablet Optimized | Fluid Layouts | Zero Overflow
   ========================================================================== */

/* Global Anti-Overflow & Boundary Rules */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

svg, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.slider-container,
.mega-dropdown,
.mobile-drawer {
  max-width: 100vw;
}

/* ==========================================================================
   MEDIUM DESKTOPS & LAPTOPS (< 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 36px;
  }

  .nav-menu {
    gap: 2px;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 0.88rem;
  }

  .mega-dropdown {
    width: 90vw;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 30px;
  }
}

/* ==========================================================================
   TABLETS & MEDIUM SCREENS (< 992px)
   ========================================================================== */
@media (max-width: 992px) {
  /* Header Navigation */
  .nav-menu {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .mega-dropdown {
    display: none !important;
  }

  /* Section Spacing */
  .section {
    padding: 75px 0;
  }

  .section-header {
    margin-bottom: 40px;
  }

  /* Hero 2-Column Stacking */
  .hero-wrapper {
    padding: 100px 0 80px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .hero-text-col {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-trust-row {
    justify-content: center;
  }

  .hero-visual-col {
    max-width: 580px;
    margin: 0 auto;
    width: 100%;
  }

  /* Grids */
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }

  .grid-4,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .service-details-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .service-sidebar-card {
    position: static;
    max-height: none;
  }
}

/* ==========================================================================
   SMALL TABLETS & LARGE SMARTPHONES (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .section {
    padding: 60px 0;
  }

  .hero-heading {
    font-size: 2.35rem;
  }

  .hero-subheading {
    font-size: 1.05rem;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-row-2 .form-group {
    margin-bottom: 20px;
  }

  .console-metrics-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Adjust floating badges so they stay within mobile screen width */
  .hero-floating-badge {
    position: static;
    margin: 12px auto 0;
    width: fit-content;
    animation: none;
  }

  .badge-top-right,
  .badge-bottom-left {
    position: static;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .stat-card {
    padding: 16px 10px;
  }

  .stat-number {
    font-size: 1.65rem;
  }

  .deliverables-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* ==========================================================================
   MOBILE PHONES (< 576px)
   ========================================================================== */
@media (max-width: 576px) {
  .container,
  .container-sm {
    padding: 0 16px;
  }

  .nav-container {
    height: 70px;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 1.15rem;
  }

  .brand-subtitle {
    display: block;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.2;
    margin-top: 1px;
    white-space: nowrap;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .btn {
    display: none;
  }

  .theme-toggle-btn {
    width: 38px;
    height: 38px;
  }

  .mobile-drawer {
    top: 70px;
    height: calc(100vh - 70px);
    height: calc(100dvh - 70px);
    padding: 20px 16px 90px;
    background: var(--bg-primary);
  }

  .hero-wrapper {
    padding: 95px 0 65px;
  }

  .hero-heading {
    font-size: clamp(1.85rem, 6.8vw, 2.25rem);
    line-height: 1.18;
    word-break: break-word;
    overflow-wrap: break-word;
    margin-bottom: 18px;
  }

  .hero-subheading {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 28px;
    padding: 0 4px;
  }

  .hero-pill {
    font-size: 0.76rem;
    padding: 5px 14px;
    margin-bottom: 18px;
    max-width: 95%;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
    margin-bottom: 40px;
  }

  .hero-actions .btn {
    width: 100%;
    padding: 13px 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px 6px;
    border-radius: var(--radius-sm);
  }

  .stat-number {
    font-size: 1.35rem;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
  }

  .stat-label {
    font-size: 0.78rem;
    line-height: 1.3;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .floating-widgets {
    bottom: 16px;
    right: 14px;
    gap: 10px;
  }

  .floating-btn {
    width: 46px;
    height: 46px;
  }

  .floating-btn svg {
    width: 22px;
    height: 22px;
  }

  .service-card,
  .feature-card,
  .product-card {
    padding: 24px 18px;
  }
}

/* ==========================================================================
   EXTRA-SMALL PHONES (< 380px)
   ========================================================================== */
@media (max-width: 380px) {
  .hero-heading {
    font-size: 1.65rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
  }
}

/* ==========================================================================
   RESPONSIVE RULES FOR NEW HOME PAGE PREMIUM SECTIONS
   ========================================================================== */
@media (max-width: 1200px) {
  .why-choose-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

@media (max-width: 992px) {
  .services-premium-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .why-choose-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .home-cta-box {
    padding: 48px 30px;
  }
}

@media (max-width: 768px) {
  .services-premium-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .why-choose-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .testimonial-card-luxury {
    padding: 28px 22px;
    min-height: auto;
  }

  .review-quote-text {
    font-size: 0.96rem;
    line-height: 1.6;
  }
}

@media (max-width: 576px) {
  .why-choose-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .why-choose-card-luxury {
    padding: 20px 16px;
  }

  .service-card-luxury {
    padding: 24px 20px;
  }

  .service-icon-wrap {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
    margin-bottom: 16px;
  }

  .home-cta-box {
    padding: 38px 18px;
  }

  .home-cta-actions {
    flex-direction: column;
    width: 100%;
  }

  .home-cta-actions .btn {
    width: 100%;
    text-align: center;
  }
}


