:root {
  --primary: #cda45e; /* Gold yang lebih elegan */
  --primary-dark: #a9853e;
  --bg: #0b0b0b; /* Bukan hitam pekat, tapi dark grey very deep */
  --bg-card: #151515;
  --text: #ffffff;
  --text-muted: #888888;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --border: #333;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: none;
  text-decoration: none;
}
*:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden; /* Mencegah scroll horizontal aneh */
}

/* UTILS */
.section-padding {
  padding: 6rem 7% 2rem;
}
.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-family: "Playfair Display", serif;
}
.section-title span {
  color: var(--primary);
}
.section-desc {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

/* NAVBAR FIXED */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 7%;
  background-color: rgba(0, 0, 0, 0.6); /* Lebih transparan */
  backdrop-filter: blur(15px); /* Blur lebih kuat */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: 0.3s;
}

.navbar-logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  font-family: "Playfair Display", serif;
  font-style: italic;
}
.navbar-logo span {
  color: var(--primary);
}

.navbar-nav a {
  color: #fff;
  display: inline-block;
  font-size: 1rem;
  margin: 0 1rem;
  transition: 0.3s;
  position: relative;
}
.navbar-nav a:hover {
  color: var(--primary);
}
.navbar-nav a::after {
  content: "";
  display: block;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  transform: scaleX(0);
  transition: 0.2s linear;
}
.navbar-nav a:hover::after {
  transform: scaleX(0.6);
}

.navbar-nav {
  display: flex; /* Ensure flex behavior on desktop */
  align-items: center;
}

/* --- PERBAIKAN BADGE & TOMBOL --- */
.navbar-extra a {
  color: #fff;
  margin: 0 0.5rem;
  display: inline-flex; /* Agar ikon lebih rapi */
  align-items: center;
}

.navbar-extra a:hover {
  color: var(--primary);
}

/* Tambahkan ini agar Badge tidak 'terbang' */
#shopping-cart-btn {
  position: relative;
}

/* Style Badge Merah */
.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #c0392b; /* Merah lebih modern */
  color: #fff;
  font-size: 0.6rem;
  padding: 3px 6px;
  border-radius: 50%;
  font-weight: bold;
  border: 1px solid var(--bg); /* Border supaya kontras dengan background */
}

#hamburger-menu {
  display: none;
}

/* SHOPPING CART SIDEBAR (FIXED POSITION) */
.shopping-cart {
  position: fixed;
  top: 0;
  right: -100%; /* Default hidden */
  height: 100vh;
  width: 350px;
  background-color: var(--bg-card);
  z-index: 99999;
  padding: 2rem;
  transition: right 0.4s ease-in-out; /* Smooth transition */
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.8);
}

.shopping-cart.active {
  right: 0; /* Slide in */
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.cart-header h3 {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
}
.cart-header i {
  cursor: pointer;
}
.cart-header i:hover {
  color: var(--primary);
}

.cart-body {
  flex: 1;
  overflow-y: auto;
} /* Scrollable area */

.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  padding: 10px;
  margin-bottom: 1rem;
  border-radius: 10px;
  border: 1px solid #333;
}
.cart-item img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}
.item-detail {
  flex: 1;
}
.item-detail h4 {
  font-size: 0.9rem;
  margin-bottom: 5px;
}
.item-price {
  color: var(--primary);
  font-size: 0.85rem;
}
.item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  background: #000;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 20px;
}
.item-controls button {
  background: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
}
.item-total {
  font-weight: bold;
  font-size: 0.9rem;
}

.cart-footer {
  border-top: 1px solid #333;
  padding-top: 1rem;
}
.total-text {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 1rem;
}
.total-text span:nth-child(2) {
  color: var(--primary);
}

.form-container input {
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  background: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 5px;
}
.btn-checkout {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #000;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 5px;
  cursor: pointer;
  transition: 0.3s;
  text-transform: uppercase;
  font-size: 0.9rem;
  border: none;
}
.btn-checkout:hover {
  background: var(--primary-dark);
  box-shadow: 0 0 15px rgba(205, 164, 94, 0.4);
}
.btn-checkout.disabled {
  background-color: #333;
  color: #666;
  cursor: not-allowed;
  box-shadow: none;
}

/* HERO SECTION */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-image: url("img/kopi3.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 5%, rgba(0, 0, 0, 0.5));
}
.hero-content {
  padding: 0 7%;
  max-width: 60rem;
  z-index: 1;
  position: relative;
}
.hero h1 {
  font-size: 3.5rem;
  font-family: "Playfair Display", serif;
  line-height: 1.2;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}
.hero h1 span {
  color: var(--primary);
}
.hero p {
  font-size: 1.1rem;
  margin: 1rem 0 2rem;
  font-weight: 300;
  color: #ddd;
  max-width: 500px;
  line-height: 1.6;
}
.cta-btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--primary);
  color: #000;
  font-weight: bold;
  border-radius: 30px;
  transition: 0.3s;
}
.cta-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(182, 137, 91, 0.4);
}

/* ABOUT */
.about .row {
  display: flex;
  align-items: center;
  gap: 4rem;
  flex-wrap: wrap;
}
.about .about-img {
  flex: 1 1 25rem;
}
.about .about-img img {
  width: 100%;
  border-radius: 15px;
  box-shadow: -10px 10px 0 var(--primary-dark);
}
.about .content {
  flex: 1 1 30rem;
}
.about .content h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-family: "Playfair Display", serif;
}
.about .content p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: #ccc;
}

/* MENU & PRODUCTS GRID */
.menu-grid,
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  justify-content: center;
}
.menu-card,
.product-card {
  background: var(--bg-card);
  border: 1px solid #333;
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: 0.3s;
  max-width: 400px; /* Prevent full-width stretching */
  margin: 0 auto; /* Center in grid cell */
  width: 100%; /* Ensure it fills up to max-width */
}
.menu-card:hover,
.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}
.menu-img {
  height: 150px;
  object-fit: contain;
  margin-bottom: 1rem;
}
/* PRODUCT CARD & ICONS */
.product-image {
  position: relative;
  overflow: hidden; /* Ensure icons don't spill out */
}
.product-image img {
  height: 200px; /* Increased height for better look */
  width: 100%;
  object-fit: cover;
  transition: 0.3s;
}

/* Icons Overlay */
.product-icons {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 0.8rem;
  z-index: 10;
  opacity: 0;
  transition: 0.3s;
}

.product-card:hover .product-icons {
  opacity: 1;
}
.product-card:hover .product-image img {
  transform: scale(1.1);
  filter: brightness(0.7); /* Darken image to reveal white icons */
}

/* Buttons style inside overlay */
.product-icons a {
  width: 45px;
  height: 45px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  transition: 0.3s;
  border: none;
}
.product-icons a:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
}
.stars {
  color: var(--primary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.stars .star-full {
  fill: var(--primary);
}

/* FILTER BUTTONS */
.filter-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 0.5rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--primary);
  color: #fff;
  border-radius: 20px;
  cursor: pointer;
  transition: 0.3s;
  font-family: inherit;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: #000;
}

.product-image {
  position: relative;
}
.product-category {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.7rem;
  border: 1px solid var(--primary);
}

/* SEARCH FORM */
.search-form {
  position: absolute;
  top: 100%;
  right: 7%;
  width: 25rem;
  height: 3.5rem;
  background: #fff;
  display: flex;
  align-items: center;
  transform: scaleY(0);
  transform-origin: top;
  transition: 0.3s;
  z-index: 900;
}
.search-form.active {
  transform: scaleY(1);
}
.search-form input {
  width: 100%;
  height: 100%;
  padding: 1rem;
  color: #333;
  font-size: 1rem;
}
.search-form label {
  color: #333;
  cursor: pointer;
  padding-right: 1rem;
}

/* CONTACT */
.contact .row {
  display: flex;
  background: var(--bg-card);
  border-radius: 15px;
  overflow: hidden;
  flex-wrap: wrap;
}
.contact .map {
  flex: 1 1 25rem;
  width: 100%;
  height: 100%;
  min-height: 25rem;
  object-fit: cover;
  filter: grayscale(100%) invert(90%);
}
.contact form {
  flex: 1 1 25rem;
  padding: 3rem;
}
.input-group {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid #333;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border-radius: 5px;
}
.input-group input {
  width: 100%;
  background: transparent;
  color: #fff;
  margin-left: 10px;
}
.btn {
  padding: 0.8rem 2rem;
  background: var(--primary);
  color: #000;
  font-weight: bold;
  cursor: pointer;
  border-radius: 5px;
  margin-top: 1rem;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 3rem 0;
  background: var(--bg-card);
  margin-top: 3rem;
}
footer .socials a {
  margin: 0 10px;
  color: #fff;
}
footer .socials a:hover {
  color: var(--primary);
}
footer .links {
  margin: 1.5rem 0;
}
footer .links a {
  margin: 0 10px;
  color: #fff;
  font-size: 0.9rem;
}
footer .links a:hover {
  color: var(--primary);
}

/* ANIMATION CLASSES */
.reveal-text,
.reveal-left,
.reveal-right,
.reveal-bottom {
  opacity: 0;
  transition: 0.8s ease;
}
.reveal-text {
  transform: translateY(20px);
}
.reveal-left {
  transform: translateX(-30px);
}
.reveal-right {
  transform: translateX(30px);
}
.reveal-bottom {
  transform: translateY(30px);
}

.active.reveal-text,
.active.reveal-left,
.active.reveal-right,
.active.reveal-bottom {
  opacity: 1;
  transform: translate(0);
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
  html {
    font-size: 75%;
  }
  #hamburger-menu {
    display: inline-block;
  }

  .navbar-nav {
    position: absolute;
    top: 100%;
    right: -100%;
    background: var(--bg-card); /* Consistent theme */
    width: 70%;
    height: 100vh;
    transition: 0.3s;
    border-left: 1px solid var(--border);
    display: block;
    padding-top: 2rem;
  }
  .navbar-nav.active {
    right: 0;
  }
  .navbar-nav a {
    display: block;
    margin: 1.5rem;
    font-size: 1.2rem;
  }

  .shopping-cart {
    width: 100%;
  } /* Cart full width di HP */
  .hero h1 {
    font-size: 2.5rem;
  }
  .about .row {
    flex-direction: column;
  }
}

/* ========================================= */
/* MODAL BOX (Letakkan DI LUAR Media Query) */
/* ========================================= */
.modal {
  display: flex;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
}

.modal-container {
  background-color: var(--bg-card); /* Pakai variabel warna kartu */
  color: var(--text);
  width: 80%;
  max-width: 800px;
  padding: 3rem;
  border-radius: 10px;
  position: relative;
  display: flex;
  gap: 2rem;
  border: 1px solid #333;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  animation: animateModal 0.4s;
}

.modal-container .close-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #fff;
  background: #000;
  padding: 5px;
  border-radius: 50%;
  display: flex;
}
.modal-container .close-icon:hover {
  color: var(--primary);
}

.modal-content {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  align-items: center;
  gap: 2rem;
}

.modal-content img {
  height: 15rem;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: -5px 5px 10px rgba(0, 0, 0, 0.5);
}

.modal-content .product-content {
  flex: 1;
}

.modal-content h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-family: "Playfair Display", serif;
}

.modal-content p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.product-stars {
  margin-bottom: 1rem;
  color: var(--primary);
}
.product-stars svg {
  fill: currentColor;
  width: 20px;
  height: 20px;
}

.modal-content .product-price {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.btn-modal {
  display: inline-flex;
  align-items: center;
  padding: 0.8rem 2rem;
  background-color: var(--primary);
  color: #000;
  font-weight: bold;
  border-radius: 30px;
  transition: 0.3s;
}
.btn-modal:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 0 15px rgba(182, 137, 91, 0.6);
}

@keyframes animateModal {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsif Modal untuk HP (Baru ini masuk Media Query) */
@media (max-width: 768px) {
  .modal-container {
    width: 90%;
    padding: 2rem;
    flex-direction: column;
    height: auto;
    max-height: 80vh;
    overflow-y: auto;
  }
  .modal-content {
    flex-direction: column;
    text-align: center;
  }
  .modal-content img {
    height: 10rem;
    margin-bottom: 1rem;
  }
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 100px; /* Di bawah navbar */
  right: 20px;
  z-index: 99999;
  background-color: var(--bg-card);
  border: 1px solid var(--primary);
  padding: 1rem 1.5rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
}
