:root {
  --primary: #b6895b;
  --primary-hover: #8c6a46;
  --bg: #010101;
  --card-bg: rgba(26, 26, 26, 0.8);
  --text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
  border: none;
  text-decoration: none;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--bg);
  color: #fff;
  overflow-x: hidden; /* Mencegah scroll samping */
}

/* --- NAVBAR (Glassmorphism) --- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem 7%;
  /* padding: 1.4rem 2 rem; */
  background-color: rgba(1, 1, 1, 0.6); /* Transparan */
  backdrop-filter: blur(10px); /* Efek blur kaca */
  border-bottom: 1px solid rgba(182, 137, 91, 0.3);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  transition: 0.3s;
}

.navbar .navbar-nav {
  margin-left: auto;
  margin-right: 1rem;
}

.navbar .navbar-logo {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  font-style: italic;
}

.navbar .navbar-logo span {
  color: var(--primary);
}

.navbar .navbar-nav a {
  color: #fff;
  display: inline-block;
  font-size: 1.2rem;
  margin: 0 1rem;
  transition: 0.3s;
  position: relative;
}

.navbar .navbar-nav a::after {
  content: "";
  display: block;
  padding-bottom: 0.5rem;
  border-bottom: 0.1rem solid var(--primary);
  transform: scaleX(0);
  transition: 0.2s linear;
}

.navbar .navbar-nav a:hover::after {
  transform: scaleX(0.8);
}

.navbar .navbar-nav a:hover {
  color: var(--primary);
}

.navbar-extra a {
  color: #fff;
  margin: 0 0.5rem;
}

.navbar-extra a:hover {
  color: var(--primary);
}

#hamburger-menu {
  display: none;
  color: #fff;
  cursor: pointer;
}

/* --- HERO SECTION --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  /* Pastikan gambar ada di folder img/kopi.jpeg */
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    url("image/kopi.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero .content {
  padding: 1.4rem 7%;
  max-width: 60rem;
  animation: fadeInUp 1s ease;
}

.hero .content h1 {
  font-size: 4.5em;
  color: #fff;
  text-shadow: var(--text-shadow);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero .content h1 span {
  color: var(--primary);
}

.hero .content p {
  font-size: 1.6rem;
  margin-top: 1rem;
  line-height: 1.6;
  font-weight: 300;
  text-shadow: var(--text-shadow);
  margin-bottom: 2rem;
}

.cta-btn {
  display: inline-block;
  background-color: var(--primary);
  color: #fff;
  padding: 1rem 3rem;
  border-radius: 0.5rem;
  font-size: 1.4rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(182, 137, 91, 0.4);
  transition: 0.3s;
}

.cta-btn:hover {
  background-color: var(--primary-hover);
  transform: scale(1.05);
}

/* --- SECTIONS GENERAL --- */
.about,
.products,
.checkout-container {
  padding: 8rem 7% 1.4rem;
}

h2 {
  text-align: center;
  font-size: 2.6rem;
  margin-bottom: 3rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

h2 span {
  color: var(--primary);
}

/* --- PRODUCT CARD & GRID --- */
.products-container {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(280px, 350px)
  ); /* Batasi max lebar */
  gap: 2rem;
  justify-content: center;
}

.product-card {
  background-color: rgba(20, 20, 20, 0.8);
  border: 1px solid #333;
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: 0.3s ease;
  position: relative;
  height: 100%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.product-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(182, 137, 91, 0.4);
}

.product-image-box {
  width: 100%;
  height: 250px;
  overflow: hidden;
  position: relative;
}

.product-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

.product-card:hover .product-image-box img {
  transform: scale(1.1);
}

.card-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--primary);
  color: #000;
  font-weight: bold;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  z-index: 10;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.product-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.product-content p {
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: bold;
  margin-top: auto;
  margin-bottom: 1rem;
}

/* Tombol Tambah / Beli */
.btn-add {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-add:hover {
  background: #8c6a46;
  letter-spacing: 1px;
}

.btn-add:active {
  transform: scale(0.95);
}

/* --- CHECKOUT & FORM STYLES --- */
.checkout-wrapper {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start; /* PENTING: Agar ringkasan tidak melar ke bawah */
}

.form-section,
.cart-summary {
  flex: 1;
  min-width: 300px;
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 15px;
  border: 1px solid #333;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Agar Ringkasan Belanja Sticky (Menempel saat scroll) */
/* PERBAIKAN: Tambahkan .checkout-wrapper di depannya */
.checkout-wrapper .cart-summary {
  position: static;
  top: 6rem;
  align-self: flex-start; /* Pastikan dia diam di atas */
}

/* Reset untuk halaman Admin (Jaga-jaga) */
.cart-summary {
  position: static; /* Default (Tidak nempel) */
}
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  background: #0f0f0f;
  border: 1px solid #444;
  color: white;
  border-radius: 5px;
  transition: 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(182, 137, 91, 0.3);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

th,
td {
  padding: 1rem;
  border-bottom: 1px solid #444;
  text-align: left;
}

th {
  color: var(--primary);
}

/* --- TOMBOL QTY & HAPUS (Checkout) --- */
.qty-control {
  background: #000;
  border-radius: 50px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #333;
  justify-content: center;
}

.btn-mini {
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50% !important; /* Bulat sempurna */
  font-size: 1.2rem;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
  line-height: 1;
}

.btn-mini:hover {
  background: #fff;
  color: var(--primary);
}

.qty-control span {
  min-width: 25px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: bold;
}

.btn-trash {
  background: transparent !important;
  color: #c0392b !important;
  border: 1px solid #c0392b !important;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.3s;
  margin-left: 5px;
}

.btn-trash:hover {
  background: #c0392b !important;
  color: white !important;
}

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- CATEGORY FILTER --- */
.category-filter {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.category-filter a {
  padding: 0.8rem 2rem;
  border: 1px solid var(--primary);
  color: #fff;
  border-radius: 2rem;
  font-size: 1.1rem;
  transition: 0.3s;
  background: rgba(0, 0, 0, 0.5);
}

.category-filter a:hover,
.category-filter a.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 10px var(--primary);
}

/* --- FOOTER --- */
footer {
  background-color: var(--primary);
  text-align: center;
  padding: 1rem 0 3rem;
  margin-top: 3rem;
}

footer .links {
  margin-bottom: 1.4rem;
}
footer .links a {
  color: #010101;
  padding: 0.7rem 1rem;
  font-weight: 700;
}
footer .credit p {
  color: #010101;
  font-weight: 700;
}

/* --- MEDIA QUERIES (RESPONSIVE) --- */
@media (max-width: 768px) {
  html {
    font-size: 80%;
  } /* Ini bikin 1rem = 12.8px (Lebih besar & Pas) */

  /* Tambahan: Paksa tombol agar minimal tinggi 44px (Standar jari jempol) */
  .btn-add,
  .cta-btn,
  button,
  input,
  select {
    min-height: 44px;
    font-size: 1.2rem;
  }

  .about,
  .products,
  .checkout-container {
    padding: 6rem 5% 1rem;
  }

  #hamburger-menu {
    display: inline-block;
  }

  .navbar .navbar-nav {
    position: absolute;
    top: 100%;
    right: -100%;
    background-color: rgba(1, 1, 1, 0.95);
    width: 70%;
    height: 100vh;
    transition: 0.3s;
    padding-top: 2rem;
    display: block; /* Override flex */
  }

  .navbar .navbar-nav.active {
    right: 0;
  }
  .navbar .navbar-nav a {
    display: block;
    margin: 2rem;
    font-size: 2rem;
  }

  .hero .content h1 {
    font-size: 3.5em;
  }

  .checkout-wrapper {
    flex-direction: column;
    gap: 1.5rem;
  }

  .form-section,
  .cart-summary {
    min-width: 100%;
  }
}

@media (max-width: 450px) {
  .hero .content h1 {
    font-size: 3em;
  }
}

/* --- SWEETALERT OVERRIDE (Agar di atas Navbar) --- */
.swal2-container {
  z-index: 20000 !important;
}

/* --- TAMBAHAN UNTUK ADMIN PANEL (Agar Rapi) --- */

/* 1. Gaya Tombol Aksi (Edit & Hapus) agar sejajar */
.action-links {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

/* Tombol Edit (Kuning/Oranye) */
.btn-edit {
  background-color: rgba(243, 156, 18, 0.15); /* Background transparan */
  color: #f39c12;
  border: 1px solid #f39c12;
}
.btn-edit:hover {
  background-color: #f39c12;
  color: #fff;
  transform: translateY(-2px);
}

/* Tombol Hapus (Merah) */
.btn-delete-outline {
  background-color: rgba(192, 57, 43, 0.15);
  color: #c0392b;
  border: 1px solid #c0392b;
}
.btn-delete-outline:hover {
  background-color: #c0392b;
  color: #fff;
  transform: translateY(-2px);
}

/* 2. Perbaikan Badge Status (Agar warna muncul) */
/* Pastikan class CSS ini sesuai dengan output PHP (huruf kecil) */
.status-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
