/* =========================================================
   DIGIVAULT STORE — Final Version CSS
   - UPDATE: Grid produk di mobile dibuat lebih ringkas (2 kolom).
   - REVISI: Layout Hero diubah menjadi gambar di atas, teks di bawah.
   - FITUR: Tombol Chat WhatsApp ditambahkan.
   - FITUR: Tombol Chat Admin di Header ditambahkan.
   - PERBAIKAN: Modal produk dibuat lebih compact di mobile.
   ========================================================= */
:root {
  --bg: #0a0a0a;
  --bg-2: #141414;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --primary: #e50914;
  --primary-glow: rgba(229, 9, 20, 0.5);
  --card: #1a1a1a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --border: #2a2a2a;
  --radius-sm: 8px;
  --radius-md: 12px;
  --dur: 0.3s;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.modal-open,
body.search-open {
  overflow: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
h1,
h2,
h3 {
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  line-height: 1.2;
}
.dv-container {
  width: min(1200px, 92%);
  margin: 0 auto;
}
.dv-flex {
  display: flex;
  gap: 1rem;
}
.dv-between {
  justify-content: space-between;
}
.dv-center {
  align-items: center;
}

/* --- Components --- */
.btn {
  border: 1px solid var(--border);
  outline: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-2);
  color: var(--text);
  font-weight: 600;
  transition: all var(--dur) var(--ease);
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border-color: #444;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 8px 25px -5px var(--primary-glow);
}
.btn.primary:hover {
  transform: translateY(-3px) scale(1.05);
}
.btn.ghost {
  background: transparent;
}
.btn.xl {
  font-size: 1.1rem;
  padding: 1rem 2rem;
}
.btn.icon-btn {
  padding: 0.6rem;
}
.badge {
  display: inline-grid;
  place-items: center;
  background: #202020;
  border: 1px solid #333;
  padding: 0 0.45rem;
  border-radius: 99px;
  font-size: 0.75rem;
  min-width: 20px;
  height: 20px;
}

/* --- Header --- */
.dv-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 60;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: all 0.4s ease;
}
.dv-header.scrolled {
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom-color: var(--border);
}
.dv-header .dv-container {
  padding: 1.2rem 0;
}
.dv-logo img.logo-img {
  height: clamp(30px, 8vw, 50px);
  width: auto;
}
.dv-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Hero --- */
.dv-hero-visual {
  position: relative;
  min-height: 65vh;
  background: #000;
  overflow: hidden;
}
.hero-slides {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  animation: kenBurns 20s linear infinite alternate;
}
.hero-slide.active {
  opacity: 1;
}
@keyframes kenBurns {
  from {
    transform: scale(1.05);
  }
  to {
    transform: scale(1.2);
  }
}
.dv-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.4) 0%,
    rgba(10, 10, 10, 0) 50%,
    rgba(10, 10, 10, 1) 100%
  );
}
.dv-hero-text {
  text-align: center;
  padding: 2rem 0 4rem;
  animation: fadeIn 1s var(--ease) 0.5s both;
  margin-top: -50px;
  position: relative;
  z-index: 5;
}
.hero-greeting {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--muted);
  margin: 1rem 0 2rem;
}

/* --- General Section Styling --- */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
}
.section-header h2 {
  font-size: clamp(2rem, 5vw, 2.8rem);
}
.section-header p {
  font-size: 1.1rem;
}

/* --- Perks Section --- */
.dv-perks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 5rem 0;
}
.perk-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: var(--radius-md);
  text-align: center;
  opacity: 0;
  animation: fadeIn 0.8s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 0.15s);
}
.perk-icon {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 1rem;
  display: block;
}
.perk-card h3 {
  margin-bottom: 0.5rem;
}
.perk-card p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Browse & Catalog --- */
.dv-browse {
  padding: 5rem 0;
}
.dv-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 3rem;
}
.cat-pill {
  padding: 0.6rem 1.2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--dur);
}
.cat-pill.active,
.cat-pill:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
}
.browse-grid,
.top-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* --- Card & Parallax Effect --- */
.card {
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  transition: all 0.4s var(--ease);
  cursor: pointer;
  border: 1px solid var(--border);
  transform-style: preserve-3d;
}
.card .thumb {
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.card-details {
  padding: 1rem 1.2rem;
}
.card h3 {
  font-size: 1.1rem;
}
.card .price {
  font-weight: 700;
  color: var(--primary);
}
.card:hover {
  transform: translateY(-10px) rotateX(var(--rotateX, 0))
    rotateY(var(--rotateY, 0));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border-color: #555;
}
.card:hover .thumb img {
  transform: scale(1.1);
}

/* --- Top Picks Section --- */
.dv-top {
  padding: 5rem 0;
}

/* --- FAQ --- */
.dv-faq {
  padding: 5rem 0;
}
.faq-container {
  max-width: 800px;
  margin: 0 auto;
}
.faq-container details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.faq-container summary {
  font-weight: 600;
  cursor: pointer;
  font-size: 1.1rem;
}

/* --- Footer & Back to Top --- */
.dv-footer {
  padding: 3rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.back-to-top-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--dur) var(--ease);
}
.back-to-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Search Overlay --- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
}
.search-overlay[aria-hidden="false"] {
  display: block;
}
.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.4s both;
}
.search-container {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 15vh auto 0;
  padding: 0 1rem;
  animation: pop 0.4s var(--ease) both;
}
.close-search-btn {
  position: absolute;
  top: -2rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
}
#searchInput {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  color: var(--text);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 600;
  padding: 0.5rem 0;
  outline: none;
  text-align: center;
}
#searchInput:focus {
  border-bottom-color: var(--primary);
}
.search-results-container {
  margin-top: 2rem;
  max-height: 60vh;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur);
}
.search-result-item:hover {
  background: var(--card);
}
.search-result-item img {
  width: 80px;
  height: 45px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* --- Modal & Cart --- */
.dv-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.dv-modal[aria-hidden="false"] {
  display: flex;
}
.dv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.4s both;
}
.dv-modal-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-width: 800px;
  width: 94%;
  animation: pop 0.4s var(--ease) both;
}
@keyframes pop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.dv-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--card);
  border: none;
  color: var(--muted);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: background 0.2s;
}
.dv-modal-close:hover {
  background: #333;
}
.dv-modal-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 2rem;
}
@media (min-width: 600px) {
  .dv-modal-body {
    grid-template-columns: 1fr 1.2fr;
    align-items: center;
  }
}
.modal-image {
  max-width: 250px;
  margin: 0 auto;
  border-radius: var(--radius-md);
}
.modal-content h2 {
  font-size: 1.8rem;
}
.modal-content select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  margin: 1rem 0;
}
.modal-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}
.modal-warranty {
  font-size: 0.9rem;
}
.modal-cta {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}
.cart-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(400px, 100%);
  background: #101010;
  border-left: 1px solid var(--border);
  transform: translateX(105%);
  transition: transform 0.4s var(--ease);
  z-index: 120;
  display: flex;
  flex-direction: column;
}
.cart-drawer[aria-hidden="false"] {
  transform: translateX(0);
}
.cart-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}
.cart-items {
  flex: 1;
  overflow: auto;
  padding: 1rem;
}
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.cart-item img {
  border-radius: var(--radius-sm);
}
.cart-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}
.cart-actions > * {
  flex: 1;
}

/* --- TOMBOL CHAT WHATSAPP --- */
.whatsapp-fab {
  position: fixed;
  bottom: 85px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: all var(--dur) var(--ease);
}
.whatsapp-fab.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.whatsapp-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.4);
}

/* --- MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {
  .dv-container {
    width: 90%;
  }
  .cart-text {
    display: none;
  }

  .chat-admin-text {
    display: none;
  }

  .dv-hero-visual {
    min-height: 45vh;
  }
  .dv-hero-text {
    padding: 1rem 0 3rem;
    margin-top: -30px;
  }
  .hero-greeting {
    font-size: 2rem;
  }
  .hero-sub {
    font-size: 1rem;
  }
  .dv-browse,
  .dv-top,
  .dv-faq {
    padding: 3rem 0;
  }
  .card:hover {
    transform: none;
  }

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

  .card-details {
    padding: 0.75rem;
  }
  .card h3 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
  }
  .card .price {
    font-size: 0.85rem;
  }
  .card .muted {
    display: none;
  }

  .whatsapp-fab {
    width: 55px;
    height: 55px;
    right: 15px;
    bottom: 80px;
  }

  /* ======================================================= */
  /* PERBAIKAN: Optimasi Tampilan Modal di Mobile            */
  /* ======================================================= */
  .dv-modal-body {
    padding: 1.25rem 1rem; /* Kurangi padding horizontal */
    gap: 0.75rem; /* Kurangi jarak antara gambar dan teks */
    text-align: center; /* Pusatkan teks konten */
  }
  .modal-image {
    max-width: 140px; /* Perkecil ukuran gambar */
  }
  .modal-content h2 {
    font-size: 1.3rem; /* Perkecil font judul */
    margin-bottom: 0.25rem; /* Kurangi jarak bawah judul */
  }
  .modal-content .muted {
      font-size: 0.85rem; /* Perkecil font deskripsi */
      line-height: 1.5;
  }
  .modal-content select {
    font-size: 0.9rem;
    margin: 0.75rem 0; /* Kurangi spasi vertikal dropdown */
    padding: 0.6rem; /* Kurangi padding dropdown */
  }
  .modal-price {
    font-size: 1.4rem; /* Perkecil font harga */
  }
  .modal-warranty {
    font-size: 0.8rem; /* Perkecil font garansi */
  }
  .modal-cta {
    margin-top: 1rem; /* Atur jarak atas tombol */
    justify-content: center;
  }
  .modal-cta .btn {
      font-size: 0.9rem;
      padding: 0.6rem 1rem; /* Kurangi padding tombol agar lebih kecil */
  }
}