/* ==============================================================================
   DTS POWER TECH PRIVATE LIMITED
   Ultra-Responsive Mobile, Tablet & Desktop Stylesheet
   Domain: dtspowertech.com
   ============================================================================== */

/* --- Base Fluid & Anti-Overflow Rules --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

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

/* Ensure table container scrolls smoothly on mobile */
.table-responsive {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  margin-bottom: 1.5rem;
  border-radius: 8px;
}

.custom-table {
  min-width: 620px;
}

/* --- Mobile Drawer Backdrop Overlay --- */
.mobile-nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 22, 44, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Prevent body scrolling when mobile navigation is open */
body.nav-open {
  overflow: hidden !important;
  touch-action: none;
}

/* --- Mobile Navigation Header --- */
.mobile-nav-header {
  display: none;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-close {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Breakpoint: Laptops & Small Desktops (<= 1100px) --- */
@media (max-width: 1100px) {
  .hero-title {
    font-size: clamp(2.2rem, 3.5vw, 2.75rem);
  }

  .grid-3,
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .grid-contact {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

/* --- Breakpoint: Tablets & iPads (<= 992px) --- */
@media (max-width: 992px) {
  .section {
    padding: 3.5rem 0;
  }

  .grid-2,
  .grid-contact {
    grid-template-columns: 1fr !important;
    gap: 2.25rem !important;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }

  /* Hamburger Button Display */
  .mobile-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    color: var(--primary);
    cursor: pointer;
  }

  .mobile-nav-header {
    display: flex !important;
  }

  /* Hardware-Accelerated Sliding Mobile Drawer */
  .main-nav {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 320px !important;
    max-width: 88vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background-color: #ffffff !important;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25) !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 1.25rem 1.5rem !important;
    transform: translateX(100%) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 99999 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .main-nav.active {
    transform: translateX(0) !important;
  }

  .nav-list {
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
    gap: 0.35rem !important;
  }

  .nav-item {
    width: 100% !important;
  }

  .nav-link {
    width: 100% !important;
    padding: 0.85rem 1rem !important;
    font-size: 1.05rem !important;
    border-radius: var(--radius-sm) !important;
    display: flex !important;
    justify-content: space-between !important;
  }

  .nav-link.active::after {
    display: none !important;
  }

  .nav-dropdown .dropdown-menu {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    border: 1px solid var(--border-color) !important;
    background-color: var(--bg-alt) !important;
    margin: 0.25rem 0 0.5rem 1rem !important;
    width: calc(100% - 1rem) !important;
    display: none;
    border-radius: 6px !important;
  }

  .nav-dropdown.active .dropdown-menu {
    display: block !important;
  }

  .dropdown-item {
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
  }

  /* Hero Section Stacking */
  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  .hero-desc {
    max-width: 100% !important;
  }

  /* Stats Bar on Tablets */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  .stat-item:nth-child(2)::after {
    display: none !important;
  }

  .vision-mission-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .calc-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
}

/* --- Breakpoint: Small Tablets & Mobile Landscape (<= 768px) --- */
@media (max-width: 768px) {
  .section {
    padding: 2.75rem 0 !important;
  }

  /* Completely hide cluttered top bar on mobile */
  .top-bar {
    display: none !important;
  }

  .header-inner {
    height: 62px !important;
  }

  /* CRITICAL MOBILE HEADER FIX:
     Hide the bulky "Enquire Now" button from the top bar so the brand logo
     and the hamburger menu have ample space and NEVER collide or overflow! */
  .btn-enquiry-nav {
    display: none !important;
  }

  .logo-symbol {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
  }

  .logo-symbol svg {
    width: 20px !important;
    height: 20px !important;
  }

  .logo-main {
    font-size: 1.1rem !important;
  }

  .logo-sub {
    font-size: 0.6rem !important;
  }

  /* Hero Banner */
  .hero-section {
    padding: 3rem 0 2.25rem !important;
  }

  .hero-title {
    font-size: clamp(1.85rem, 6vw, 2.35rem) !important;
    line-height: 1.2 !important;
  }

  .hero-desc {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1.5rem !important;
  }

  .hero-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    margin-bottom: 1.75rem !important;
  }

  .hero-actions .btn {
    width: 100% !important;
    padding: 0.85rem 1.25rem !important;
  }

  .hero-highlights {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.85rem !important;
    padding-top: 1.5rem !important;
  }

  .hero-card {
    padding: 1.5rem 1.25rem !important;
    border-radius: var(--radius-md) !important;
  }

  /* Stats Bar on Mobile */
  .stats-bar {
    margin-top: 1.5rem !important;
    padding: 1.5rem 1rem !important;
    border-radius: var(--radius-md) !important;
  }

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

  .stat-item {
    padding: 0 !important;
  }

  .stat-item::after {
    display: none !important;
  }

  .stat-icon {
    width: 44px !important;
    height: 44px !important;
  }

  .stat-number {
    font-size: 1.85rem !important;
  }

  /* Single Column Grids */
  .grid-3,
  .services-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

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

  .form-row-2,
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .steps-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .step-card {
    padding: 1.25rem 0.75rem !important;
  }

  .vm-card {
    padding: 1.5rem 1.25rem !important;
  }

  .vm-text {
    font-size: 0.95rem !important;
  }

  /* Calculator on Mobile */
  .calc-wrapper {
    padding: 1.5rem 1rem !important;
  }

  .calc-results-card {
    padding: 1.25rem !important;
  }

  .calc-result-val {
    font-size: 1.1rem !important;
  }

  .calc-result-row {
    padding: 0.65rem 0 !important;
  }

  /* Footer on Mobile */
  .site-footer {
    padding: 3.5rem 0 1.5rem !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    margin-bottom: 2.5rem !important;
  }

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

  .footer-bottom-links {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 1rem !important;
  }

  /* Floating Quick Action Buttons */
  .floating-actions {
    bottom: 16px !important;
    right: 16px !important;
    gap: 10px !important;
  }

  .float-btn {
    width: 44px !important;
    height: 44px !important;
  }

  .float-btn svg {
    width: 22px !important;
    height: 22px !important;
  }
}

/* --- Breakpoint: Extra Small Mobile Phones (<= 480px) --- */
@media (max-width: 480px) {
  .container {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .section {
    padding: 2.25rem 0 !important;
  }

  .hero-title {
    font-size: 1.65rem !important;
  }

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

  .custom-table th, .custom-table td {
    padding: 0.75rem 0.5rem !important;
    font-size: 0.8rem !important;
  }

  .enquiry-form-card,
  .card-box {
    padding: 1.25rem 0.85rem !important;
  }

  .form-control {
    font-size: 0.9rem !important;
    padding: 0.75rem 0.85rem !important;
  }

  .btn {
    padding: 0.75rem 1.25rem !important;
    font-size: 0.9rem !important;
  }

  .btn-lg {
    padding: 0.85rem 1.5rem !important;
    font-size: 0.95rem !important;
  }

  /* Office Switcher Tabs full width */
  #tabBtnCorporate, #tabBtnRegistered {
    flex: 1 !important;
    text-align: center !important;
    padding: 0.5rem 0.5rem !important;
    font-size: 0.85rem !important;
  }
}
