/**
 * DURAI INFRA — FINAL MINIMAL FIX v8
 * Solves: Black circle (scrollTopBtn) appearing below buttons
 * Replace ONLY the CSS file - no JS needed
 */

/* ════════════════════════════════════════════════════════════
   CRITICAL FIX: Hide the black scrollTopBtn circle completely
   It was appearing below WhatsApp/Phone buttons showing black
════════════════════════════════════════════════════════════ */

/* MASTER RULE: Hide scrollTopBtn by default */
#scrollTopBtn {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Only show on scroll (when user scrolls down) */
#scrollTopBtn.visible {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ════════════════════════════════════════════════════════════
   FLOATING BUTTONS - Ensure they work perfectly
════════════════════════════════════════════════════════════ */

.floating-cta {
  position: fixed !important;
  right: 28px !important;
  bottom: 28px !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: none !important;
}

/* Individual FAB buttons */
.floating-cta .fab-btn {
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  font-size: 1.25rem !important;
  text-decoration: none !important;
  border: none !important;
  cursor: pointer !important;
  transition: transform 0.25s ease !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* WhatsApp button - ALWAYS GREEN */
.floating-cta .fab-btn.whatsapp {
  background: #25D366 !important;
}

.floating-cta .fab-btn.whatsapp:hover {
  transform: scale(1.1) !important;
}

/* Phone button - ALWAYS RED */
.floating-cta .fab-btn.phone {
  background: linear-gradient(135deg, #C0392B 0%, #E05A3A 100%) !important;
}

.floating-cta .fab-btn.phone:hover {
  transform: scale(1.1) !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .floating-cta {
    right: 16px !important;
    bottom: 16px !important;
  }
}

/* ════════════════════════════════════════════════════════════
   CRITICAL: Neutralize body transform that breaks fixed elements
════════════════════════════════════════════════════════════ */
html,
body {
  animation: none !important;
  transform: none !important;
  perspective: none !important;
  filter: none !important;
}

/* ════════════════════════════════════════════════════════════
   Keep all other responsive fixes
════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  [style*="grid-template-columns:repeat(5,1fr)"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.6rem !important;
  }
  [style*="grid-template-columns:repeat(5,1fr)"] > [style*="position:absolute"] {
    display: none !important;
  }
}

@media (max-width: 420px) {
  [style*="grid-template-columns:repeat(5,1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  [style*="grid-template-columns:repeat(4,1fr)"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
  }
}

@media (max-width: 420px) {
  [style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 900px) and (min-width: 601px) {
  .testi-slide {
    grid-template-columns: 1fr 1fr !important;
  }
  .home-testi-card:last-child {
    display: none;
  }
}

@media (max-width: 600px) {
  .testi-slide {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 360px) {
  .calc-wrap {
    border-radius: 12px !important;
  }
  .calc-inputs,
  .calc-result {
    padding: 1.4rem !important;
  }
  .calc-res-range {
    font-size: 1.6rem !important;
  }
}

@media (max-width: 520px) {
  #offer-banner > div > div:first-child {
    flex-direction: column !important;
    gap: 8px !important;
    text-align: center !important;
  }
  #offer-banner #offer-tag {
    font-size: 9px !important;
  }
  #offer-banner #offer-text {
    font-size: 12px !important;
  }
}

.slider-btn,
.testi-btn,
.slider-pause-btn,
.scroll-top-btn,
.fab-btn {
  min-width: 44px !important;
  min-height: 44px !important;
}

.nav-toggle {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1024px) and (min-width: 769px) {
  .footer-main-grid {
    grid-template-columns: 1.2fr 0.8fr 0.8fr !important;
    gap: 1.8rem !important;
  }
  .footer-contact-box {
    grid-column: 1 / -1;
  }
}

.home-why,
.home-projects,
.home-testimonials,
.home-calculator,
.faq-section {
  content-visibility: auto;
  contain-intrinsic-size: 0 600px;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.4s ease;
}
img[loading="lazy"].loaded {
  opacity: 1;
}

.contact-form-new input,
.contact-form-new select,
.contact-form-new textarea {
  transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}

.contact-form-new input:focus,
.contact-form-new select:focus,
.contact-form-new textarea:focus {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.1) !important;
  outline: none !important;
}

.slide-bg {
  background-color: #0a1628;
}

@media print {
  .floating-cta,
  .sticky-wa-bar,
  #offer-banner,
  .home-cta,
  header,
  .top-bar,
  .footer-cta-strip,
  #scrollTopBtn,
  #site-visit-popup,
  #careerModal,
  .slider-btn,
  .hero-progress-bar,
  .slider-pause-btn,
  .slider-dots-wrap {
    display: none !important;
  }
  body {
    color: #000 !important;
    background: #fff !important;
    font-size: 12pt !important;
  }
  .slide {
    min-height: unset !important;
    height: auto !important;
  }
  .home-story-grid,
  .home-services-grid,
  .home-why-grid,
  .home-projects-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  a::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #666;
  }
  a[href^="tel"]::after,
  a[href^="mailto"]::after,
  a[href^="#"]::after {
    content: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto !important;
  }
}

@media (max-width: 600px) {
  .home-why-grid {
    grid-template-columns: 1fr !important;
  }
  .home-why-card {
    padding: 1.2rem !important;
  }
}

@media (max-width: 420px) {
  .home-projects-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  .google-rating-inner {
    gap: 14px !important;
    padding: 0 8px;
  }
  .gr-stat-num {
    font-size: 1.4rem !important;
  }
  .gr-divider {
    width: 100% !important;
    height: 1px !important;
    background: rgba(255,255,255,.08) !important;
  }
}

@media (max-width: 480px) {
  #careerModal > div {
    padding: 0 !important;
  }
  #careerModal > div > div {
    border-radius: 16px !important;
  }
  #careerModal > div > div > div:first-child {
    padding: 22px 20px 16px !important;
    border-radius: 16px 16px 0 0 !important;
  }
  #careerModal > div > div > div:last-child {
    padding: 18px 20px 22px !important;
  }
}

.skip-link:focus {
  top: 0 !important;
  clip: auto !important;
  overflow: visible !important;
  width: auto !important;
  height: auto !important;
  z-index: 99999 !important;
}

@media (min-width: 901px) {
  .nav-toggle {
    display: none !important;
  }
}

/* FIX: Ensure Coimbatore, Tamil Nadu displays fully on top bar */
.top-location {
  white-space: normal !important;
  flex-wrap: wrap !important;
  max-width: 200px !important;
  word-break: break-word !important;
}

@media (max-width: 1200px) {
  .top-location {
    max-width: 160px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 900px) {
  .top-location {
    display: none !important;
  }
}

#dic-offer-popup {
  position: fixed !important;
  z-index: 99500 !important;
}
