/* ============================================================
   Toko Kue — Template Katalog + Keranjang WA
   Palet: merah mawar tua + emas hangat di atas krem lembut
   Tipografi: Fraunces (display) + Work Sans (teks)
   ============================================================ */

:root {
  --primer: #7A2E3B;
  --primer-gelap: #5C2029;
  --aksen: #C9A227;
  --latar: #FBF8F3;
  --gelap: #2B1E17;
  --putih: #FFFFFF;
  --blush: #F3DCE0;
  --radius: 4px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Work Sans', -apple-system, sans-serif;
  color: var(--gelap);
  background: var(--latar);
  line-height: 1.6;
}

h1, h2, h3, .brand {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  margin: 0;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 248, 243, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(43, 30, 23, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.brand {
  font-size: 1.4rem;
  color: var(--primer);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--gelap);
}

.nav-links a:hover { color: var(--primer); }

.cart-button {
  position: relative;
  background: var(--primer);
  color: var(--putih);
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.cart-button:hover { background: var(--primer-gelap); }

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--aksen);
  color: var(--gelap);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ---------- Hero ---------- */
.hero {
  padding: 88px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(201, 162, 39, 0.14), transparent 45%),
    radial-gradient(circle at 82% 75%, rgba(122, 46, 59, 0.10), transparent 45%);
}

.hero-crumb {
  position: absolute;
  border-radius: 50%;
  background: var(--aksen);
  opacity: 0.18;
  animation: mengambang 7s ease-in-out infinite;
}
.hero-crumb:nth-child(1) { width: 14px; height: 14px; top: 22%; left: 12%; animation-delay: 0s; }
.hero-crumb:nth-child(2) { width: 9px; height: 9px; top: 65%; left: 20%; background: var(--primer); animation-delay: 1.4s; }
.hero-crumb:nth-child(3) { width: 11px; height: 11px; top: 30%; right: 14%; animation-delay: 2.6s; }
.hero-crumb:nth-child(4) { width: 7px; height: 7px; top: 70%; right: 22%; background: var(--primer); animation-delay: 3.8s; }

@keyframes mengambang {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-18px) scale(1.15); }
}

.hero h1,
.hero p,
.hero-actions {
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  animation: munculHalus 0.7s ease forwards;
}

.hero h1 { animation-delay: 0.05s; }
.hero p { animation-delay: 0.2s; }
.hero-actions { animation-delay: 0.35s; }

@keyframes munculHalus {
  to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  color: var(--primer);
  max-width: 700px;
  margin: 0 auto 18px;
  line-height: 1.15;
}

.hero p {
  max-width: 520px;
  margin: 0 auto 28px;
  color: #55433a;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn { transition: transform 0.18s ease, background-color 0.18s ease; }
.btn:active { transform: scale(0.96); }

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--primer);
  color: var(--putih);
}
.btn-primary:hover { background: var(--primer-gelap); }

.btn-outline {
  background: transparent;
  border-color: var(--primer);
  color: var(--primer);
}
.btn-outline:hover { background: var(--blush); }

/* ---------- Kategori filter ---------- */
.kategori-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 24px 40px;
}

.kategori-chip {
  border: 1.5px solid rgba(122, 46, 59, 0.25);
  background: var(--putih);
  color: var(--primer);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
}

.kategori-chip.active,
.kategori-chip:hover {
  background: var(--primer);
  color: var(--putih);
  border-color: var(--primer);
}

/* ---------- Produk grid ---------- */
.section { padding: 60px 24px; }

.section-title {
  font-size: 1.9rem;
  color: var(--primer);
  text-align: center;
  margin-bottom: 8px;
}

.section-subtitle {
  text-align: center;
  color: #7a6a60;
  max-width: 480px;
  margin: 0 auto 40px;
}

.produk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.produk-card {
  background: var(--putih);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(43, 30, 23, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.produk-card:hover {
  transform: translateY(-6px);
  border-color: rgba(122, 46, 59, 0.35);
}

.produk-card img {
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.produk-card:hover img { transform: scale(1.05); }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.produk-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.produk-nama { font-size: 1.05rem; font-weight: 600; }

.produk-desk {
  font-size: 0.85rem;
  color: #7a6a60;
  flex: 1;
}

.produk-harga {
  font-family: 'Fraunces', serif;
  color: var(--primer);
  font-size: 1.1rem;
  margin-top: 6px;
}

.produk-tambah {
  margin-top: 10px;
  background: var(--gelap);
  color: var(--putih);
  border: none;
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.produk-tambah:hover { background: var(--primer); }
.produk-tambah:active { transform: scale(0.97); }

.produk-tambah.ditambahkan {
  background: var(--aksen);
  color: var(--gelap);
}

.cart-count {
  transition: transform 0.25s ease;
}

.cart-count.bump {
  animation: bump 0.35s ease;
}

@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero p, .hero-actions, .reveal, .hero-crumb, .cart-count {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- Tentang / Profil ---------- */
.profil {
  background: var(--blush);
}

.profil-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.profil-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin-top: 20px;
  font-size: 0.92rem;
}

.profil-info dt { font-weight: 600; color: var(--primer); }
.profil-info dd { margin: 0; }

.profil-art {
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primer), var(--aksen));
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Footer ---------- */
footer {
  background: var(--gelap);
  color: #f1e6df;
  padding: 40px 24px;
  text-align: center;
  font-size: 0.88rem;
}

footer a { color: var(--aksen); text-decoration: none; }

/* ---------- Keranjang (drawer) ---------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 30, 23, 0.45);
  z-index: 90;
  display: none;
}

.cart-overlay.open { display: block; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 92vw);
  background: var(--putih);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer.open { transform: translateX(0); }

.cart-header {
  padding: 20px;
  border-bottom: 1px solid rgba(43, 30, 23, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--gelap);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(43, 30, 23, 0.06);
}

.cart-item img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  object-fit: cover;
}

.cart-item-info { flex: 1; }

.cart-item-nama { font-size: 0.92rem; font-weight: 600; }

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.qty-controls button {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(43,30,23,0.2);
  background: var(--putih);
  border-radius: var(--radius);
  cursor: pointer;
}

.cart-empty {
  text-align: center;
  color: #9a8a80;
  padding: 60px 20px;
  font-size: 0.9rem;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid rgba(43, 30, 23, 0.1);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  color: var(--primer);
  margin-bottom: 14px;
}

.cart-footer .btn { width: 100%; text-align: center; }

@media (max-width: 720px) {
  .profil-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
