/* ========================================== */
/* RESET DASAR & FONT                         */
/* ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background-color: #f8f9fa; /* Warna latar belakang abu-abu sangat muda (hampir putih) */
}

/* ========================================== */
/* NAVBAR HITAM ETALASE                       */
/* ========================================== */
.navbar-etalase {
  background-color: #000000; /* Hitam pekat sesuai gambar */
  display: flex;
  justify-content: space-between; /* Mendorong logo ke kiri, menu ke kanan */
  align-items: center;
  padding: 20px 5%; /* Jarak atas-bawah 20px, sisi kiri-kanan 5% */
  position: sticky; /* Bikin navbar tetap nempel di atas saat di-scroll */
  top: 0;
  z-index: 1000;
}

/* --- Bagian Kiri (Logo) --- */
.logo {
  display: flex;
  align-items: center;
}

/* Kalau kamu pakai teks untuk logo sementara */
.logo h2 {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Kalau kamu pakai gambar untuk logo */
.logo img {
  height: 60px; /* Sesuaikan ukuran logo */
  width: auto;
}

/* --- Bagian Kanan (Menu Link) --- */
.nav-links {
  list-style: none; /* Menghilangkan titik-titik bawaan <ul> */
  display: flex;
  gap: 30px; /* Jarak antar menu */
}

.nav-links a {
  color: #ffffff;
  text-decoration: none; /* Menghilangkan garis bawah link */
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #7cb342; /* Berubah jadi hijau ciri khas Moyang saat disentuh */
}

/* ========================================== */
/* PENGATURAN MENU UNTUK PC (DEFAULT)         */
/* ========================================== */
.menu-toggle {
  display: none; /* Sembunyikan ikon hamburger di layar laptop */
  color: #ffffff;
  font-size: 1.8rem;
  cursor: pointer;
}

.close-btn,
.sidebar-footer,
.nav-links i.fa-chevron-right {
  display: none; /* Sembunyikan tombol X, footer, dan ikon panah di PC */
}

/* ========================================== */
/* PENGATURAN MENU UNTUK HP (MAX 768PX)       */
/* ========================================== */
@media (max-width: 768px) {
  /* 1. Munculkan Tombol Hamburger */
  .menu-toggle {
    display: block;
  }

  /* 2. Ubah Menu Menjadi Sidebar Mengambang */
  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    right: -100%; /* Sembunyikan di luar batas kanan layar */
    width: 75%; /* Mengambil 75% lebar layar HP */
    height: 100vh; /* Tinggi penuh dari atas ke bawah */
    background: linear-gradient(to bottom, #84b179 0%, #b0dc98 100%);
    flex-direction: column;
    justify-content: flex-start;
    padding: 50px 30px;
    transition: right 0.4s ease-in-out; /* Animasi mulus saat bergeser */
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.15); /* Bayangan di kiri sidebar */
    z-index: 1001;
  }

  /* Class ini akan ditambahkan oleh JavaScript untuk memunculkan sidebar */
  .nav-links.active {
    right: 0;
  }

  /* 3. Desain Teks Link dan Panah */
  .nav-links li {
    width: 100%;
    margin-bottom: 25px;
  }

  .nav-links a {
    display: flex;
    justify-content: space-between; /* Memisahkan teks di kiri, panah di kanan */
    width: 100%;
    font-size: 1.1rem;
  }

  .nav-links i.fa-chevron-right {
    display: inline-block;
    font-size: 0.9rem;
    opacity: 0.8;
  }

  /* 4. Tombol Close (X) Mentok Kanan Dalam */
  .close-btn {
    display: flex;
    justify-content: flex-end; /* Memaksa ikon silang mentok ke kanan */
    width: 100%;
    font-size: 1.4rem;
    color: #ffffff;
    cursor: pointer;
    margin-bottom: 40px; /* Jarak ke bawah agar tidak nabrak menu Beranda */
  }

  /* 5. Desain Footer Sidebar (Alamat & Sosmed) */
  .sidebar-footer {
    display: block;
    margin-top: auto;
    text-align: center;
    color: #ffffff;
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .social-icons {
    margin-top: 15px;
    display: flex;
    justify-content: center; /* Memusatkan ikon ke tengah */
    gap: 20px;
  }

  /* PENYELAMAT: Mencegah ikon sosmed menjauh / merenggang */
  .social-icons a {
    display: inline-block !important; /* Membatalkan sifat memanjang dari menu atas */
    width: auto !important; /* Mengembalikan ukurannya menjadi pas di tengah */
    font-size: 1.5rem;
  }
}

/* --- 10. TOMBOL WHATSAPP MELAYANG --- */
.whatsapp-float {
  position: fixed; /* KUNCI UTAMA: Membuat tombol terkunci di layar */
  bottom: 30px; /* Jarak dari bawah layar */
  right: 30px; /* Jarak dari kanan layar */
  width: 60px; /* Lebar lingkaran */
  height: 60px; /* Tinggi lingkaran */
  background-color: #25d366; /* Warna hijau khas logo WhatsApp */
  color: #ffffff; /* Warna icon putih */
  border-radius: 50%; /* Membuatnya bulat sempurna */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Efek bayangan agar terlihat melayang */

  /* Menengahkan icon di dalam lingkaran */
  display: flex;
  align-items: center;
  justify-content: center;

  text-decoration: none;
  z-index: 999; /* Memastikan tombol selalu ada di lapisan paling atas, tidak tertutup elemen lain */
  transition:
    transform 0.3s ease,
    background-color 0.3s ease;
}

/* Mengatur ukuran icon */
.whatsapp-float i {
  font-size: 35px;
}

/* Efek saat disentuh mouse (Hover) */
.whatsapp-float:hover {
  transform: scale(1.1); /* Tombol membesar 10% */
  background-color: #20b858; /* Hijau WhatsApp yang sedikit lebih gelap */
}

/* Penyesuaian untuk layar HP agar tidak terlalu menutupi konten */
@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }

  .whatsapp-float i {
    font-size: 28px;
  }
}

/* ========================================== */
/* KARTU DETAIL PRODUK DINAMIS                */
/* ========================================== */
.product-detail-section {
  padding: 60px 5%;
  display: flex;
  justify-content: center;
}

.detail-card {
  background-color: #ebebeb;
  border-radius: 30px;
  padding: 40px 50px;
  width: 100%;
  max-width: 1000px;
}

/* --- Penambahan Header Kategori (Panah & Teks) --- */
.category-header {
  display: flex;
  align-items: center;
  gap: 15px; /* Jarak renggang antara panah dan tulisan */
  margin-bottom: 25px; /* Memberi jarak ke area gambar & info di bawahnya */
}

.back-link {
  color: #000000;
  font-size: 1.4rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.back-link:hover {
  color: #7cb342; /* Berubah hijau saat disentuh */
  transform: translateX(-3px); /* Efek animasi geser sedikit ke kiri saat disentuh */
}

.category-label {
  font-size: 1.5rem;
  color: #000000;
  margin-bottom: 0; /* Margin dipindah ke category-header agar sejajar */
  font-weight: 700;
}

.detail-content {
  display: flex;
  gap: 50px;
}

/* Bagian Gambar Kiri */
.detail-image-box {
  flex: 1;
}

.detail-image-box img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #c4c4c4; /* Warna abu-abu kotak gambar */
  border-radius: 20px;
  object-fit: cover;
  margin-bottom: 15px;
}

.thumbnail-gallery {
  display: flex;
  gap: 15px;
}

.thumb {
  width: 60px;
  height: 60px;
  background-color: #c4c4c4;
  border-radius: 10px;
}

/* Bagian Teks Kanan */
.detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 20px;
}

.detail-info h1 {
  font-size: 2.2rem;
  color: #000000;
  line-height: 1.3;
  margin-bottom: 10px;
}

.detail-info .price {
  font-size: 1.3rem;
  font-weight: 400;
  color: #333333;
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid #d1d1d1; /* Garis pembatas */
}

/* ========================================== */
/* DESAIN KONTROL KUANTITAS                   */
/* ========================================== */
.quantity-wrapper {
  display: flex;
  align-items: center;
  gap: 15px; /* Jarak antara kotak angka dan teks error */
  margin-bottom: 25px; /* Jarak dengan tombol Add to Cart di bawahnya */
}

.quantity-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 120px; /* Lebar kotak */
  background-color: #f0f0f0; /* Abu-abu terang */
  border: 1px solid #d1d1d1; /* Garis pinggir abu-abu (Stroke) */
  border-radius: 50px; /* Bentuk kapsul membulat */
  padding: 5px 10px;
  transition: border-color 0.3s ease; /* Efek transisi saat berubah merah */
}

/* Tombol Plus Minus */
.btn-qty {
  background: none;
  border: none;
  font-size: 0.9rem;
  color: #000000;
  cursor: pointer;
  width: 25px;
  height: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.btn-qty:hover {
  background-color: #d1d1d1; /* Efek gelap sedikit saat disentuh */
}

/* Angka di tengah */
#current-qty {
  font-weight: 600;
  font-size: 1rem;
  width: 30px;
  text-align: center;
}

/* Teks Error Merah (Defaultnya disembunyikan) */
.error-msg {
  color: #ff4d4d;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0; /* Dibuat transparan */
  visibility: hidden;
  transition: opacity 0.3s ease;
}

/* === MODE ERROR (Akan diaktifkan oleh JavaScript) === */
.quantity-control.error-mode {
  border-color: #ff4d4d; /* Mengubah garis pinggir (stroke) jadi merah */
}

.error-msg.show-error {
  opacity: 1; /* Memunculkan teks error */
  visibility: visible;
}

/* Tombol Aksi */
.action-buttons {
  display: flex;
  gap: 15px;
  margin-bottom: 40px;
}

.btn-add-cart {
  background-color: #61c24e; /* Hijau cerah sesuai gambar */
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-add-cart:hover {
  background-color: #b45309;
  color: #ffffff;
  transform: translateY(-3px); /* Membuat tombol seolah terangkat ke atas */
  box-shadow: 0 6px 12px rgba(180, 83, 9, 0.15); /* Menambah bayangan lembut */
}

.btn-buy-now {
  background-color: #c4c4c4; /* Abu-abu sesuai gambar */
  color: #0056b3; /* Teks biru */
  border: none;
  padding: 12px 35px;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
}

.btn-buy-now:hover {
  background-color: #9b9898; /* Warna sedikit menggelap saat di-hover */
  border-color: #b45309;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(217, 119, 6, 0.25);
}

.disclaimer p {
  font-size: 0.75rem;
  color: #555555;
  margin-bottom: 5px;
}

/* HP RESPONSIVE */
@media (max-width: 768px) {
  .detail-content {
    flex-direction: column; /* Ditumpuk atas-bawah di HP */
    gap: 20px;
  }

  .detail-card {
    padding: 30px 25px;
  }

  .detail-info h1 {
    font-size: 1.8rem;
  }
}

/* ========================================== */
/* DESAIN KERANJANG MELAYANG & SUMMARY        */
/* ========================================== */
.cart-floating-container {
  position: fixed;
  bottom: 100px; /* Di atas tombol WhatsApp melayang jika ada */
  right: 30px;
  z-index: 1000;
}

/* Tombol Biru Bulat */
.cart-btn {
  width: 65px;
  height: 65px;
  background-color: #004fb0; /* Biru pekat */
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: transform 0.2s ease;
}

.cart-btn:hover {
  transform: scale(1.05);
}

/* Notifikasi Angka Merah */
.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #e62129; /* Merah */
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid #ffffff; /* Garis putih biar rapi */
}

/* KARTU SUMMARY (POPUP) */
.cart-popup {
  position: absolute;
  bottom: 85px; /* Muncul tepat di atas tombol keranjang */
  right: 0;
  width: 320px;
  background-color: #000000; /* Body hitam */
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);

  /* Animasi Muncul/Hilang */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.cart-popup.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cart-popup-header {
  background-color: #004fb0; /* Header biru */
  color: white;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-popup-body {
  padding: 15px 20px;
  color: white;
  max-height: 200px;
  overflow-y: auto;
}

/* Item Belanjaan */
.cart-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.9rem;
  border-bottom: 1px solid #333;
  padding-bottom: 5px;
}

.cart-popup-footer {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #000000;
  border-top: 1px solid #333;
}

.btn-checkout {
  background-color: #fbd341; /* Kuning tombol checkout */
  color: #000000;
  border: none;
  padding: 10px 25px;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-checkout:hover {
  opacity: 0.8;
}

.cart-total {
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}

/* MEMPERLEBAR KOTAK POPUP */
.cart-popup {
  /* (kode lama biarkan) */
  width: 360px; /* Lebarkan dari 320px menjadi 360px agar lega */
}

/* MENATA DAFTAR BARANG: [X] -- [Nama Barang] -------- [Qty] */
.cart-item {
  display: flex;
  align-items: center; /* Memastikan icon silang dan teks sejajar lurus */
  margin-bottom: 10px;
  font-size: 0.9rem;
  border-bottom: 1px solid #333;
  padding-bottom: 8px;
}

/* Icon Silang Merah */
.item-remove {
  color: #ff4d4d; /* Warna merah cerah */
  cursor: pointer;
  margin-right: 12px; /* Jarak antara silang dan nama barang */
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.item-remove:hover {
  transform: scale(1.3); /* Membesar sedikit saat disentuh */
}

/* Nama barang mengambil sisa ruang yang ada di tengah */
.item-name {
  flex: 1;
}

/* Icon Tong Sampah (Trash) */
.btn-clear-cart {
  color: #cccccc; /* Abu-abu terang */
  font-size: 1.3rem;
  cursor: pointer;
  transition:
    color 0.2s,
    transform 0.2s;
  margin: 0 10px; /* Jarak kanan-kiri dengan tombol checkout dan total harga */
}

.btn-clear-cart:hover {
  color: #ff4d4d; /* Berubah merah saat disentuh mouse */
  transform: scale(1.1);
}

/* ========================================== */
/* RESPONSIVE KHUSUS KERANJANG MELAYANG (HP)  */
/* ========================================== */
@media (max-width: 768px) {
  .cart-floating-container {
    right: 20px; /* Jarak aman dari pinggir kanan layar */
    bottom: 90px; /* Dinaikkan sedikit agar tidak saling tumpuk dengan tombol WA */
  }

  .cart-popup {
    /* RAHASIA KESIMETRISAN: 
           Ambil 100% lebar layar HP (100vw), lalu kurangi 40px 
           (20px untuk margin kanan + 20px untuk sisa margin kiri) */
    width: calc(100vw - 40px);
    right: 0; /* Kunci agar sisi kanannya sejajar lurus dengan tombol biru */
    bottom: 75px; /* Jarak jatuhnya popup dari tombol biru */
  }

  .cart-btn {
    width: 55px; /* Diperkecil sedikit agar lebih pas untuk ukuran jari di HP */
    height: 55px;
    font-size: 1.4rem;
  }

  /* Sedikit mengecilkan font di dalam keranjang agar tidak sumpek */
  .cart-popup-header,
  .cart-item {
    font-size: 0.85rem;
  }

  .cart-total {
    font-size: 1rem;
  }

  .btn-checkout {
    padding: 8px 18px;
    font-size: 0.85rem;
  }
}

/* --- 9. BAGIAN FOOTER --- */
footer {
  background-color: #000000; /* Latar belakang hitam pekat */
  color: #ffffff;
  padding: 50px 5% 20px 5%; /* Jarak atas 50px, Kiri-Kanan 5%, Bawah 20px */
}

/* Mengatur wadah utama Footer agar kiri dan kanan terpisah */
.footer-content {
  display: flex;
  justify-content: space-between; /* Melempar isi ke ujung kiri dan ujung kanan */
  align-items: center; /* Menyejajarkan posisinya di tengah secara vertikal */
  border-bottom: 1px solid #333333; /* Garis pembatas tipis di atas tulisan copyright */
  padding-bottom: 30px; /* Jarak antara konten atas dengan garis pembatas */
  margin-bottom: 20px; /* Jarak dari garis pembatas ke tulisan copyright */
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* --- DESAIN MENU KIRI --- */
.footer-links ul {
  list-style: disc; /* Memunculkan titik-titik (bullets) bawaan */
  padding-left: 20px; /* Memberi ruang di sebelah kiri agar titiknya tidak tertutup batas layar */
}

.footer-links li {
  margin-bottom: 12px; /* Jarak renggang antar menu */
}

.footer-links a {
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #8bc34a; /* Berubah menjadi hijau khas websitemu saat disentuh mouse */
}

/* --- DESAIN LOGO KANAN --- */
.footer-logo img {
  height: 60px; /* Atur angka ini jika logomu terlihat terlalu besar atau terlalu kecil */
  width: auto;
}

/* --- DESAIN COPYRIGHT --- */
.footer-bottom {
  text-align: center; /* Tulisan tepat di tengah */
}

.footer-bottom p {
  font-size: 0.85rem; /* Ukurannya dibuat sedikit lebih kecil */
  color: #aaaaaa; /* Warnanya sedikit diredupkan (abu-abu) agar tidak menyaingi menu utama */
}

@media (max-width: 768px) {
  /* Mengubah susunan Footer di layar HP */
  .footer-content {
    flex-direction: column; /* Mengubah arah dari menyamping jadi ke bawah */
    gap: 40px; /* Jarak antara menu list dan logo di bawahnya */
    align-items: flex-start; /* Mengembalikan posisi tulisan ke kiri */
  }

  /* Menengahkan logo saat di layar HP */
  .footer-logo {
    align-self: center;
  }
}
