*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --pink-50:  #fff0f6;
  --pink-100: #ffe0ec;
  --pink-200: #ffc2d9;
  --pink-300: #ff9ec4;
  --pink-400: #ff6fae;
  --pink-500: #ff4d94;
  --pink-600: #e63b7f;
  --pink-700: #c22a68;

  --text:     #5a1f3d;
  --muted:    #9a5679;
  --white:    #ffffff;
  --shadow:   0 8px 24px rgba(255, 77, 148, .18);
  --shadow-sm:0 4px 12px rgba(255, 77, 148, .14);
  --radius:   20px;
  --radius-sm:12px;
}

body {
  font-family: "Nunito", "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background:
    radial-gradient(circle at 10% 10%, var(--pink-100) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, #ffe6f2 0%, transparent 45%),
    var(--pink-50);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.book-action {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
}

.book-action input[type="number"] {
  width: 80px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--pink-700);
  background: var(--pink-50);
  border: 2px solid var(--pink-200);
  border-radius: 999px; /* Bikin kotak input jadi bulat panjang */
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
}

.book-action input[type="number"]:focus {
  border-color: var(--pink-400);
  box-shadow: 0 0 0 4px var(--pink-100);
}

.cart-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px dashed var(--pink-200); /* Garis putus-putus */
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.total-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--pink-700);
  display: flex;
  justify-content: space-between;
}

.cart-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-kosongkan {
  background: var(--pink-100);
  color: var(--pink-700);
  box-shadow: 0 6px 0 var(--pink-200), var(--shadow-sm);
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--pink-100);
}

.filter-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-nav a {
  background: var(--pink-100);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--pink-700);
  transition: all 0.2s ease;
}

.filter-nav a:hover, 
.filter-nav a.active {
  background: var(--pink-400);
  color: var(--white);
  text-decoration: none;
  transform: translateY(-2px);
}
a {
  color: var(--pink-600);
  text-decoration: none;
  font-weight: 700;
  transition: color .2s ease;
}
a:hover { color: var(--pink-700); text-decoration: underline wavy var(--pink-300); }

h1, h2, h3 {
  margin-top: 0;
  color: var(--pink-700);
  letter-spacing: .3px;
}
h1 { font-weight: 800; }
h2 { font-weight: 700; }

header {
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  color: var(--white);
  padding: 18px 24px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

header h1::before {
  content: "🌸";
  font-size: 1.1em;
}

.container {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 18px;
}
.container.narrow { max-width: 700px; }
.container.tiny   { max-width: 600px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 680px) {
  .grid-2 { grid-template-columns: 1fr; gap: 18px; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.card { animation: pop-in .35s ease both; }
.card:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3) { animation-delay: .12s; }
.card {
  background: var(--white);
  border: 2px solid var(--pink-100);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, var(--pink-100), transparent 70%);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px) rotate(-.4deg);
  box-shadow: var(--shadow);
  border-color: var(--pink-300);
}

.card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

button,
.btn {
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  color: var(--white);
  box-shadow: 0 6px 0 var(--pink-700), var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
}
button:hover,
.btn:hover { filter: brightness(1.05); }

button:active,
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--pink-700), var(--shadow-sm);
}

.btn-ghost {
  background: var(--pink-100);
  color: var(--pink-700);
  box-shadow: 0 6px 0 var(--pink-200), var(--shadow-sm);
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--pink-400);
  outline-offset: 3px;
  border-radius: 8px;
}

::selection {
  background: var(--pink-200);
  color: var(--pink-700);
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--pink-50); }
::-webkit-scrollbar-thumb {
  background: var(--pink-300);
  border-radius: 999px;
  border: 2px solid var(--pink-50);
}
::-webkit-scrollbar-thumb:hover { background: var(--pink-400); }


.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filters a {
  background: var(--pink-50);
  border: 2px solid var(--pink-200);
  padding: 6px 16px;
  border-radius: 999px; /* Kapsul */
  font-size: 14px;
  color: var(--pink-600);
  text-decoration: none;
  transition: all 0.2s ease;
}

.filters a:hover {
  background: var(--pink-100);
  transform: translateY(-2px);
}

.filters a.active {
  background: var(--pink-500);
  border-color: var(--pink-500);
  color: var(--white);
  box-shadow: 0 4px 0 var(--pink-700);
}

.book {
  display: flex;
  justify-content: space-between;
  align-items: center; 
  padding: 20px 0;
  border-bottom: 2px dashed var(--pink-100);
  gap: 16px;
}

.book:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.book-info h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  color: var(--pink-700);
}

.book-info small {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  background: var(--pink-50);
  padding: 2px 10px;
  border-radius: 999px;
}

.book-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.book-price {
  font-weight: 800;
  color: var(--pink-500);
  font-size: 16px;
}

.add-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.add-form input[type="number"] {
  width: 65px;
  padding: 8px 10px;
  text-align: center;
  font-family: inherit;
  font-weight: 800;
  color: var(--pink-700);
  background: var(--pink-50);
  border: 2px solid var(--pink-200);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.2s ease;
}

.add-form input[type="number"]:focus {
  border-color: var(--pink-400);
  box-shadow: 0 0 0 3px var(--pink-100);
}

button.small {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--pink-700); 
}

button.small:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--pink-700);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

table th {
  text-align: left;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--pink-200);
  color: var(--pink-700);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

table td {
  padding: 14px 0;
  border-bottom: 1px solid var(--pink-100);
  vertical-align: middle;
}

table .num {
  text-align: right;
}

.remove-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pink-100);
  color: var(--pink-600);
  text-decoration: none;
  font-weight: 800;
  transition: all 0.2s ease;
}

.remove-link:hover {
  background: var(--pink-500);
  color: var(--white);
  transform: rotate(90deg);
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px dashed var(--pink-300);
  font-size: 20px;
  font-weight: 800;
  color: var(--pink-700);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.actions .btn {
  flex: 1; /* Tombol membagi rata lebar */
  text-align: center;
  display: inline-block;
}

.btn.danger {
  background: var(--white);
  color: var(--pink-600);
  border: 2px solid var(--pink-300);
  box-shadow: 0 4px 0 var(--pink-200);
}
.btn.danger:hover {
  background: var(--pink-50);
}

.btn.success {
  background: linear-gradient(135deg, #10b981, #059669); /* Hijau mint ceria */
  color: white;
  box-shadow: 0 4px 0 #047857;
}

@media (max-width: 600px) {
  .book {
    flex-direction: column;
    align-items: flex-start;
  }
  .book-actions {
    align-items: flex-start;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    margin-top: 10px;
  }
}