/* ===================================================
 * KEREN SNACK — Shopping Cart System Styles
 * =================================================== */

/* --- Cart Page Navbar Styles --- */
body.page-cart .nav {
  background: rgba(253,246,238,0.98) !important;
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid rgba(30,19,10,0.06);
  box-shadow: 0 2px 20px rgba(30,19,10,0.08);
}
body.page-cart .nav-links a {
  color: var(--ink-soft);
}
body.page-cart .nav-links a:hover {
  color: var(--ink);
}
body.page-cart .nav-toggle span {
  background: var(--ink);
}
body.page-cart .nav-drawer {
  background: rgba(253,246,238,0.98) !important;
  border-top: 1px solid rgba(30,19,10,0.06) !important;
}
body.page-cart .nav-drawer a {
  color: var(--ink-soft) !important;
  border-bottom: 1px solid rgba(30,19,10,0.06) !important;
}
body.page-cart .nav-drawer a:hover {
  color: var(--ink) !important;
}
body.page-cart .nav-drawer .nav-cta {
  background: var(--ink) !important;
  color: #fff !important;
}

/* --- Hide WA float if Floating Cart exists on the page --- */
body:has(.floating-cart) .wa-float {
  display: none !important;
}

/* --- Floating Cart Button --- */
.floating-cart {
  position: fixed;
  bottom: calc(26px + env(safe-area-inset-bottom));
  right: calc(26px + env(safe-area-inset-right));
  background: var(--red);
  color: var(--white);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(217, 43, 43, 0.4);
  z-index: 99;
  text-decoration: none;
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease, background 0.2s;
}

.floating-cart:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 30px rgba(217, 43, 43, 0.6);
  background: var(--red-dark);
  color: var(--white);
}

.floating-cart svg {
  width: 26px;
  height: 26px;
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--ink);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(15%, -15%);
  border: 2px solid var(--white);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-cart.bump .cart-badge {
  animation: bump 0.4s ease-out;
}

@keyframes bump {
  0% { transform: translate(15%, -15%) scale(1); }
  50% { transform: translate(15%, -15%) scale(1.4); }
  100% { transform: translate(15%, -15%) scale(1); }
}

/* --- Cart Page Layout & Styling --- */
.cart-hero-section {
  padding: 130px 0 35px;
  background: var(--cream);
  border-bottom: 1px solid var(--cream-2);
}

.cart-title {
  font-family: 'Fraunces', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--red-dark);
  margin-bottom: 10px;
  line-height: 1.2;
}

.cart-main-wrap {
  padding: 40px 24px 80px;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Items Container Box */
.cart-items-box {
  background: var(--white);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1.5px solid var(--cream-2);
}

@media (max-width: 480px) {
  .cart-items-box {
    padding: 16px;
  }
}

/* Empty State */
.cart-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-soft);
}

.cart-empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  color: var(--ink-muted);
  opacity: 0.5;
}

.cart-empty h3 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.cart-empty p {
  font-size: 14.5px;
  margin-bottom: 24px;
}

.btn-continue-shopping {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: var(--white) !important;
  font-family: 'Baloo 2', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 30px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(217, 43, 43, 0.3);
  transition: all 0.25s var(--ease);
}

.btn-continue-shopping:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(217, 43, 43, 0.4);
}

/* Cart Item Row */
.cart-item {
  display: flex;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1.5px solid var(--cream);
  gap: 16px;
  animation: fadeIn 0.35s var(--ease) forwards;
}

.cart-item:last-child {
  border-bottom: none;
}

@media (max-width: 520px) {
  .cart-item {
    flex-wrap: wrap;
  }
  .cart-item-actions {
    margin-left: auto;
  }
}

.cart-item-img {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--cream);
  padding: 4px;
  border: 1px solid var(--cream-2);
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
  min-width: 130px;
}

.cart-item-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.3;
}

.cart-item-price {
  font-weight: 700;
  color: var(--red-dark);
  font-size: 14.5px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--parchment);
  padding: 4px 6px;
  border-radius: 20px;
  border: 1px solid var(--cream-3);
}

.qty-btn {
  background: var(--white);
  border: 1px solid var(--cream-2);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s var(--ease);
}

.qty-btn:hover {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.qty-input {
  width: 32px;
  text-align: center;
  border: none;
  background: transparent;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-left: 4px;
}

.remove-btn:hover {
  color: var(--red);
  background: rgba(217, 43, 43, 0.1);
}

/* Summary Box */
.cart-summary-box {
  background: var(--white);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1.5px solid var(--cream-2);
  position: sticky;
  top: 100px;
}

.cart-summary-heading {
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--cream-2);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14.5px;
  color: var(--ink-mid);
}

.summary-divider {
  height: 1px;
  border-top: 1.5px dashed var(--cream-3);
  margin: 16px 0;
}

.summary-line.total {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
}

.total-price {
  color: var(--red-dark);
  font-size: 1.35rem;
}

.checkout-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: #25D366;
  color: var(--white) !important;
  font-family: 'Baloo 2', sans-serif;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  margin-top: 20px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.checkout-wa-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.5);
  background: #20BD5A;
}

.checkout-wa-btn:disabled,
.checkout-wa-btn[disabled] {
  background: #D5D5D5 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none !important;
  opacity: 0.7;
  pointer-events: none;
}

.continue-shopping-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: color 0.2s;
}

.continue-shopping-link:hover {
  color: var(--red);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--ink);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 14px;
  font-weight: 600;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  color: #25D366;
  display: flex;
}

/* Product Card Button (+ Keranjang) */
.p-add-to-cart {
  background: var(--ink);
  color: var(--white) !important;
  font-family: 'Baloo 2', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.2s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.p-add-to-cart:hover {
  background: var(--amber);
  color: var(--ink) !important;
  transform: scale(1.04);
}

/* Fix Product Card Footer Overlap on Mobile */
.p-foot {
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 420px) {
  .p-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px 14px;
  }
  .p-foot .p-price {
    text-align: center;
    font-size: 14.5px;
  }
  .p-foot .p-add-to-cart {
    width: 100%;
    padding: 8px 12px;
    justify-content: center;
  }
}

/* UX Improvements for Cart */
.qty-btn-trash {
  color: var(--red) !important;
}
.qty-btn-trash:hover {
  background: rgba(230, 57, 70, 0.1) !important;
}
.qty-btn-trash svg {
  stroke: var(--red) !important;
}

.clear-cart-text-btn {
  background: transparent;
  color: var(--red);
  border: none;
  font-family: 'Baloo 2', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}
.clear-cart-text-btn:hover {
  background: rgba(230, 57, 70, 0.08);
}


