/* ════════════════════════════════════════════════════════
   Margasana Rental Mobil — Stylesheet Global
   Dipakai oleh: index.html, katalog.html, kontak.html, 404.html

   Struktur:
   1. Base
   2. Komponen global (navbar, hamburger, popup WA, WA float,
      back-to-top, bottom nav, tombol, badge, kartu)
   3. Gaya khusus per halaman (Beranda, Katalog, Kontak, 404)
════════════════════════════════════════════════════════ */

/* ══════════════ 1. BASE ══════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; max-width: 100%; overflow-x: hidden; }
body { font-family: 'Plus Jakarta Sans', sans-serif; color: #1a1a2e; max-width: 100%; overflow-x: hidden; }

section, header, footer, nav { max-width: 100vw; overflow-x: hidden; }

/* ══════════════ 2. KOMPONEN GLOBAL ══════════════ */

/* ── Navbar ──
   Dua state: .is-transparent (di atas hero, khusus beranda)
   dan .is-solid (latar putih, dipakai halaman lain / saat scroll). */
#navbar { transition: background 0.3s ease, box-shadow 0.3s ease; }
.nav-link { transition: color 0.2s; }
.nav-link.active-link { color: #009640 !important; position: relative; }
.nav-link.active-link::after {
  content: ''; position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px; background: #009640; border-radius: 2px;
}
#navbar.is-transparent .nav-link       { color: #ffffff; }
#navbar.is-transparent .nav-logo-text  { color: #ffffff; }
#navbar.is-transparent .nav-logo-sub   { color: rgba(255,255,255,0.75); }
#navbar.is-transparent .hamburger-line { background: #ffffff; }
#navbar.is-transparent .status-label   { color: rgba(255,255,255,0.85); }
#navbar.is-solid { background: #ffffff; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
#navbar.is-solid .nav-link             { color: #1a1a2e; }
#navbar.is-solid .nav-link.active-link { color: #009640 !important; }
#navbar.is-solid .nav-logo-text        { color: #009640; }
#navbar.is-solid .nav-logo-sub         { color: #6b7280; }
#navbar.is-solid .hamburger-line       { background: #1a1a2e; }
#navbar.is-solid .status-label         { color: #1a1a2e; }

/* ── Hamburger ── */
.hamburger-line {
  display: block; width: 24px; height: 2px;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
  transform-origin: center;
}
#hamburger.is-open .line-1 { transform: translateY(8px) rotate(45deg); }
#hamburger.is-open .line-2 { opacity: 0; transform: scaleX(0); }
#hamburger.is-open .line-3 { transform: translateY(-8px) rotate(-45deg); }

/* ── WA Popup ── */
#wa-popup-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  align-items: flex-end; justify-content: center;
}
#wa-popup-overlay.is-open { display: flex; }
#wa-popup-modal {
  background: #fff; border-radius: 24px 24px 0 0;
  width: 100%; max-width: 480px;
  padding: 28px 24px 36px;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  position: relative;
}
#wa-popup-overlay.is-open #wa-popup-modal { transform: translateY(0); }

/* ── WA Float pulse ── */
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
  50%       { box-shadow: 0 0 0 10px rgba(37,211,102,0); }
}
#wa-float { animation: wa-pulse 2.5s ease-in-out infinite; }

/* ── Back to top ── */
#back-top { transition: opacity 0.3s ease, transform 0.3s ease; }
#back-top.is-hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }

/* ── Bottom nav mobile ── */
.bottom-nav-link.is-active svg  { color: #009640; }
.bottom-nav-link.is-active span { color: #009640; }

/* ── Button ── */
.btn-primary { transition: background-color 0.2s ease, transform 0.15s ease; }
.btn-primary:hover { transform: scale(1.02); }

/* ── Badge kategori ── */
.badge-premium { background: #f0a500; color: white; }
.badge-daily   { background: #009640; color: white; }
.badge-minibus { background: #475569; color: white; }
.badge-pickup  { background: #92400e; color: white; }

/* ── Ribbon Terlaris ── */
.ribbon-terlaris {
  position: absolute; top: 0; right: 0;
  background: #ef4444; color: white;
  font-size: 10px; font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  padding: 4px 10px;
  border-bottom-left-radius: 8px;
  letter-spacing: 0.03em;
}

/* ── Card Kendaraan ── */
.card-kendaraan {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-kendaraan:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,150,64,0.15);
}

/* ── Section label ── */
.section-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
}

/* ── Swiper & rating ── */
.swiper-pagination-bullet-active { background: #009640 !important; }
.stars { color: #009640; letter-spacing: 2px; }

/* ── Page header (katalog.html & kontak.html) ── */
#page-header {
  background: linear-gradient(135deg, #004d21 0%, #009640 60%, #00b84d 100%);
  padding-top: 80px;
}

/* ══════════════ 3. HALAMAN: BERANDA (index.html) ══════════════ */

/* ── Hero ── */
#hero {
  background:
    linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
    url('../img/hero-bg.jpg')
    center/cover no-repeat;
  min-height: 100vh;
}
@media (max-width: 768px) { #hero { min-height: 90vh; } }

/* ── Ticker ── */
.ticker-outer {
  overflow: hidden;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  /* mask fade kiri-kanan */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 12%, black 88%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 12%, black 88%, transparent 100%);
}
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker 28s linear infinite;
  will-change: transform;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  padding: 0 6px;
}
.ticker-dot {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  padding: 0 2px;
}

/* ── Stat ── */
.stat-number { font-family: 'Sora', sans-serif; font-weight: 800; }

/* ── Stat "Sejak 1986" — spasi fix ── */
.stat-sejak {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  color: #f0a500;
  line-height: 1;
  /* pastikan kata tidak menyatu */
  letter-spacing: 0.01em;
}
.stat-sejak .word-sejak { display: block; font-size: clamp(1.6rem, 4vw, 2.75rem); }
.stat-sejak .word-year  { display: block; font-size: clamp(2rem, 5vw, 3.25rem); }

/* ── Step connector ── */
.step-connector {
  flex: 1; height: 2px;
  background: linear-gradient(90deg, #009640, #e8f5ee);
  margin: 0 12px; align-self: flex-start; margin-top: 36px;
}

/* ── Gallery Masonry ── */
.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 220px);
  gap: 12px;
}
.gallery-item-1 { grid-column: span 2; }
.gallery-item-6 { grid-column: span 2; }

/* ══════════════ 3. HALAMAN: KATALOG (katalog.html) ══════════════ */

/* Kartu di katalog tidak memakai utilitas Tailwind untuk struktur,
   jadi di-scope agar tidak menimpa kartu beranda. */
#desktop-grid .card-kendaraan,
.swiper-katalog-mobile .card-kendaraan {
  background: #fff; border-radius: 16px;
  overflow: hidden; border: 1px solid #f0f0f0;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.card-animate { animation: cardIn 0.25s ease forwards; }

/* ── Filter Bar ── */
.filter-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; font-weight: 600;
  padding: 8px 18px; border-radius: 9999px;
  border: 2px solid #e5e7eb;
  background: #fff; color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
}
.filter-btn:hover                              { border-color: #009640; color: #009640; }
.filter-btn.is-active                          { background: #009640; border-color: #009640; color: #fff; }
.filter-btn.is-active.filter-premium           { background: #f0a500; border-color: #f0a500; color: #fff; }
.filter-btn.is-active.filter-minibus           { background: #475569; border-color: #475569; color: #fff; }
.filter-btn.is-active.filter-pickup            { background: #92400e; border-color: #92400e; color: #fff; }
.filter-btn.filter-premium:not(.is-active):hover { border-color: #f0a500; color: #f0a500; }
.filter-btn.filter-minibus:not(.is-active):hover { border-color: #475569; color: #475569; }
.filter-btn.filter-pickup:not(.is-active):hover  { border-color: #92400e; color: #92400e; }
.filter-scroll { overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }

/* ── Grid baris terakhir desktop ── */
.last-row-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 20px;
}
.last-row-wrap .card-kendaraan {
  width: calc(25% - 10px);
  flex-shrink: 0;
}

#no-result { display: none; }

/* ══════════════ 3. HALAMAN: KONTAK (kontak.html) ══════════════ */

/* ── WITA Dot (kartu Jam Operasional) ── */
.wita-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.wita-dot.is-open   { background: #22c55e; animation: pulse-dot 2s ease-in-out infinite; }
.wita-dot.is-closed { background: #ef4444; }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

/* ── Kontak card hover ── */
.kontak-card { transition: box-shadow 0.25s ease, transform 0.25s ease; }
.kontak-card:hover { box-shadow: 0 8px 24px rgba(0,150,64,0.1); transform: translateY(-2px); }

/* ── Sosmed card ── */
.sosmed-card { transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s; }
.sosmed-card:hover { border-color: #009640; box-shadow: 0 8px 24px rgba(0,150,64,0.1); transform: translateY(-2px); }

/* ── Ketentuan list ── */
.syarat-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; color: #1a1a2e; line-height: 1.5;
  padding: 8px 0; border-bottom: 1px solid rgba(0,150,64,0.1);
}
.syarat-list li:last-child { border-bottom: none; }
.syarat-num {
  width: 22px; height: 22px; border-radius: 6px;
  background: #009640; color: #fff;
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 11px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.syarat-dot {
  width: 22px; height: 22px; border-radius: 6px;
  background: #e8f5ee; color: #009640;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ══════════════ 3. HALAMAN: 404 (404.html) ══════════════ */

/* ── Floating car animation ── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}
.car-float { animation: float 3s ease-in-out infinite; }
