/* =========================================================
   Nachupong — Enhancements layer
   Preloader, scroll progress, text & motion animations.
   Loaded after global.css and the page stylesheet.
========================================================= */

/* ---------- Base image constraint (WordPress-equivalent) ---------- */
img { max-width: 100%; height: auto; }

/* ---------- Logo image in navbar / footer ---------- */
.logo-img { height: 56px; width: auto; display: block; }
.footer-logo-img { height: 40px; width: auto; display: block; margin-bottom: 6px; background: #fff; padding: 4px 8px; border-radius: 8px; }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 100000;
  background: linear-gradient(135deg, #0f2244 0%, #1a3a6b 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}
.preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-inner { text-align: center; }
.preloader-logo {
  max-height: 64px; max-width: 240px; margin: 0 auto 22px;
  background: #fff; border-radius: 10px; padding: 8px 14px;
  animation: preloader-pop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.preloader-brand {
  font-size: 28px; font-weight: 900; letter-spacing: 4px; color: #fff;
  margin-bottom: 22px; animation: preloader-pop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.preloader-bar {
  width: 180px; height: 3px; margin: 0 auto; border-radius: 3px;
  background: rgba(255,255,255,0.15); overflow: hidden; position: relative;
}
.preloader-bar span {
  position: absolute; left: -40%; top: 0; bottom: 0; width: 40%;
  border-radius: 3px; background: #f5a623;
  animation: preloader-slide 1s ease-in-out infinite;
}
@keyframes preloader-pop { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }
@keyframes preloader-slide { 0% { left: -40%; } 100% { left: 100%; } }

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, #f5a623, #d4891a);
  z-index: 10001; transition: width 0.1s linear;
}

/* ---------- Text reveal (hero titles) ---------- */
.reveal-text .reveal-word {
  display: inline-block; overflow: hidden; vertical-align: bottom;
}
.reveal-text .reveal-word > span {
  display: inline-block; transform: translateY(110%); opacity: 0;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}
.reveal-text.visible .reveal-word > span { transform: translateY(0); opacity: 1; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; bottom: 28px; left: 28px; z-index: 9998;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(15, 34, 68, 0.85); color: #fff; border: none;
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: all 0.35s ease; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: #f5a623; transform: translateY(-3px); }

/* ---------- Navbar scrolled state ---------- */
.navbar.scrolled { box-shadow: 0 4px 24px rgba(15, 34, 68, 0.14); }

/* ---------- Button shine on hover ---------- */
.btn, .nav-cta, .popup-submit, .hbtn, .df-apply-btn, .submit-btn, .apply-btn {
  position: relative; overflow: hidden;
}
.btn::after, .nav-cta::after, .hbtn::after, .df-apply-btn::after, .submit-btn::after, .apply-btn::after {
  content: ''; position: absolute; top: 0; left: -80%;
  width: 50%; height: 100%; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg); transition: left 0.55s ease;
}
.btn:hover::after, .nav-cta:hover::after, .hbtn:hover::after, .df-apply-btn:hover::after,
.submit-btn:hover::after, .apply-btn:hover::after { left: 130%; }

/* ---------- Hero background slow zoom (home) ---------- */
body[data-page="home"] .hero-bg-img { animation: hero-zoom 18s ease-in-out infinite alternate; }
@keyframes hero-zoom { from { transform: scale(1); } to { transform: scale(1.08); } }

/* ---------- Page hero soft float (inner pages) ---------- */
.page-hero::before { animation: hero-pan 24s ease-in-out infinite alternate; }
@keyframes hero-pan { from { transform: scale(1) translateY(0); } to { transform: scale(1.06) translateY(-10px); } }

/* ---------- Card icon micro-motion ---------- */
.about-feat-icon, .why-icon-circle, .mv-icon, .vertical-icon, .qc-icon,
.brand-icon, .cat-icon, .opp-icon, .culture-point-icon, .benefit-icon, .why-icon {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.about-feat-card:hover .about-feat-icon, .why-item:hover .why-icon-circle,
.mv-card:hover .mv-icon, .vertical-item:hover .vertical-icon, .qc-card:hover .qc-icon,
.brand-card:hover .brand-icon, .cat-card:hover .cat-icon, .opp-card:hover .opp-icon,
.culture-point:hover .culture-point-icon, .benefit-item:hover .benefit-icon,
.why-card:hover .why-icon { transform: scale(1.12) rotate(-6deg); }

/* ---------- Small fixes for the unified header ---------- */
body[data-page="home"] .hero { padding-top: 72px; }

/* =========================================================
   HERO IMAGE SLIDER (home)
========================================================= */
body[data-page="home"] .hero-inner { grid-template-columns: 1fr 480px; }
.hero-slider { position: relative; height: 470px; border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5); }
.hero-slider::before {
  content: ''; position: absolute; inset: -3px; border-radius: 16px; z-index: 0;
  background: linear-gradient(135deg, rgba(245,166,35,0.55), transparent 40%, transparent 60%, rgba(43,91,184,0.55));
  pointer-events: none;
}
.hero-slide {
  position: absolute; inset: 0; opacity: 0; visibility: hidden; z-index: 1;
  transition: opacity 0.9s ease, visibility 0.9s ease; display: block; background: #0d2358;
}
.hero-slide.fit-contain { background: #fff; }
.hero-slide img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(1.06); transition: transform 6s ease;
}
.hero-slide.fit-contain img { object-fit: contain; padding: 26px; }
.hero-slide.active { opacity: 1; visibility: visible; z-index: 2; }
.hero-slide.active img { transform: scale(1); }
.hero-slide.has-caption::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 110px;
  background: linear-gradient(to top, rgba(10,30,64,0.72), transparent); pointer-events: none;
}
.hero-slide.fit-contain.has-caption::after { background: linear-gradient(to top, rgba(10,30,64,0.55), transparent); }
.hero-slide-caption {
  position: absolute; left: 18px; bottom: 40px; z-index: 3;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease 0.35s, transform 0.6s ease 0.35s;
}
.hero-slide.active .hero-slide-caption { opacity: 1; transform: translateY(0); }
.hsc-badge {
  background: var(--accent, #f5a623); color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 12px; border-radius: 50px;
}
.hsc-title { color: #fff; font-size: 17px; font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,0.45); }
.hero-slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.85); color: #0f2244; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; opacity: 0;
}
.hero-slider:hover .hero-slider-arrow { opacity: 1; }
.hero-slider-arrow:hover { background: var(--accent, #f5a623); color: #fff; transform: translateY(-50%) scale(1.08); }
.hsa-prev { left: 12px; } .hsa-next { right: 12px; }
.hero-slider-dots {
  position: absolute; left: 0; right: 0; bottom: 12px; z-index: 4;
  display: flex; justify-content: center; gap: 7px;
}
.hs-dot {
  width: 8px; height: 8px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
  background: rgba(255,255,255,0.45); transition: all 0.3s ease;
}
.hs-dot.active { background: var(--accent, #f5a623); width: 22px; border-radius: 5px; }
@media (max-width: 1100px) {
  body[data-page="home"] .hero-inner { grid-template-columns: 1fr 380px; }
  .hero-slider { height: 400px; }
}
@media (max-width: 900px) {
  /* Show the slider on mobile below the hero text (original design hid the image) */
  body[data-page="home"] .hero-inner { grid-template-columns: 1fr; }
  .hero-img-card.hero-slider { display: block; height: 300px; margin-top: 8px; }
  .hero-slider-arrow { opacity: 1; width: 34px; height: 34px; }
  .hero-slide-caption { bottom: 34px; left: 14px; }
  .hsc-title { font-size: 15px; }
}

/* =========================================================
   SML MAHINDRA HOME BANNER
========================================================= */
.sml-banner { padding: 26px 0 56px; background: #fff; }
.sml-banner-inner {
  display: grid; grid-template-columns: 240px 1fr auto; align-items: center; gap: 34px;
  background: linear-gradient(120deg, #0f2244 0%, #1a3a6b 55%, #24509a 100%);
  border-radius: 16px; padding: 34px 40px; position: relative; overflow: hidden;
  box-shadow: 0 16px 48px rgba(15, 34, 68, 0.28);
}
.sml-banner-inner::before {
  content: ''; position: absolute; top: -60px; right: -60px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(245,166,35,0.22), transparent 70%);
}
.sml-banner-inner::after {
  content: ''; position: absolute; bottom: -80px; left: 30%; width: 220px; height: 220px;
  border-radius: 50%; background: radial-gradient(circle, rgba(227,30,36,0.16), transparent 70%);
}
.sml-banner-logo {
  background: #fff; border-radius: 12px; padding: 18px 20px; position: relative; z-index: 1;
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
  animation: sml-pop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sml-banner-logo img { width: 100%; height: auto; display: block; }
@keyframes sml-pop { from { opacity: 0; transform: scale(0.85) rotate(-2deg); } to { opacity: 1; transform: none; } }
.sml-banner-text { position: relative; z-index: 1; }
.sml-banner-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(245,166,35,0.18); border: 1px solid rgba(245,166,35,0.45); color: #f5a623;
  font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  padding: 6px 14px; border-radius: 50px; margin-bottom: 12px;
}
.sml-banner-text h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 900; color: #fff; line-height: 1.2; margin-bottom: 6px; }
.sml-banner-sub { font-size: 13.5px; font-weight: 700; color: #f5a623; margin-bottom: 8px; letter-spacing: 0.4px; }
.sml-banner-desc { font-size: 13px; color: rgba(255,255,255,0.75); line-height: 1.65; max-width: 560px; }
.sml-banner-cta { position: relative; z-index: 1; }
.sml-banner-btn {
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  background: #f5a623; color: #fff; font-size: 13.5px; font-weight: 700;
  padding: 13px 24px; border-radius: 50px; transition: all 0.3s ease;
  position: relative; overflow: hidden;
}
.sml-banner-btn:hover { background: #d4891a; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245,166,35,0.4); }
.sml-banner-btn:hover i { transform: translateX(4px); }
.sml-banner-btn i { transition: transform 0.3s ease; }
@media (max-width: 1024px) {
  .sml-banner-inner { grid-template-columns: 200px 1fr; }
  .sml-banner-cta { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .sml-banner { padding: 10px 0 40px; }
  .sml-banner-inner { grid-template-columns: 1fr; text-align: center; padding: 28px 22px; gap: 20px; }
  .sml-banner-logo { max-width: 220px; margin: 0 auto; }
  .sml-banner-desc { margin: 0 auto; }
  .sml-banner-btn { width: 100%; justify-content: center; }
}

/* =========================================================
   MOBILE POLISH LAYER
========================================================= */

/* Kill any horizontal wiggle caused by slide-in animations */
html, body { overflow-x: hidden; max-width: 100%; }

@media (max-width: 768px) {

  /* --- Compact navbar --- */
  .nav-inner { height: 60px; }
  .logo-img { height: 38px; }
  .mobile-menu { top: 60px; max-height: calc(100vh - 60px); overflow-y: auto; }
  .mobile-menu a { padding: 13px 16px; font-size: 15px; }

  /* --- Home hero: no huge empty space, comfortable height --- */
  body[data-page="home"] .hero { min-height: auto; padding-top: 60px; }
  body[data-page="home"] .hero-inner { padding: 46px 0 52px; }
  .hero-title-top, .hero-title-bottom { font-size: clamp(34px, 11vw, 46px); letter-spacing: -1px; }
  .hero-desc { font-size: 13px; }
  .hbtn { flex: 1 1 calc(50% - 10px); justify-content: center; }

  /* --- Inner page heroes: tighter --- */
  .page-hero { padding: 96px 0 52px; }
  .page-hero h1 { font-size: clamp(28px, 8.5vw, 38px); }
  .page-hero p { font-size: 15px; }

  /* --- Tighter section rhythm --- */
  .section-title { font-size: clamp(23px, 6.5vw, 30px); }
  .about-section { padding: 44px 0 36px; }
  .certs-section, .products-section, .why-dealer-row, .testimonials-section { padding-top: 40px; padding-bottom: 40px; }

  /* --- Smaller, tidier floating buttons --- */
  .float-btns, .float-wrap { bottom: 14px; right: 14px; gap: 8px; }
  .float-btn { width: 46px; height: 46px; font-size: 19px; }
  .float-btn-label, .fb-label { display: none; }
  .back-to-top { width: 40px; height: 40px; font-size: 14px; bottom: 14px; left: 14px; }

  /* --- Popup comfortable on small screens --- */
  .popup-box { padding: 26px 20px; border-radius: 16px; max-height: 92vh; overflow-y: auto; }

  /* --- Cards & lists breathing room --- */
  .service-detail-card { margin-bottom: 40px; }
  .position-item { flex-wrap: wrap; }
  .position-action { width: 100%; }
  .position-action .btn { width: 100%; justify-content: center; }
  .map-overlay-card { position: static; margin-top: 14px; max-width: 100%; }

  /* --- Footer: centered & compact --- */
  .footer { padding-top: 44px; }
  .footer-grid { gap: 28px; padding-bottom: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .footer-bottom-links a { margin: 0 8px; }

  /* --- Preloader logo scaled --- */
  .preloader-logo { max-width: 180px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-btns-row { flex-wrap: wrap; }
  .stats-grid .stat-num { font-size: 34px; }
  .testi-card { padding: 20px; }
  .app-form, .apply-form-box, .contact-form-box, .bulk-form { padding: 22px 16px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .fade-up, .fade-in, .slide-left, .slide-right, .reveal-text .reveal-word > span {
    transition: none !important; transform: none !important; opacity: 1 !important;
  }
  .hero-bg-img, .page-hero::before { animation: none !important; }
}
