/* =========================
   Floating Cart
========================= */

.floating-cart {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  display: none;
}

.floating-cart.show {
  display: block;
}

.floating-cart-button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: #8C6A4A;
  color: #FFF8EA;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(62, 47, 34, 0.22);
}

.floating-cart-button strong {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #FFF8EA;
  color: #8C6A4A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.floating-cart-icon {
  font-size: 18px;
}

/* =========================
   Cart Drawer
========================= */

.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(62, 47, 34, 0.35);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cart-drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  background: #fffaf2;
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -18px 0 42px rgba(62, 47, 34, 0.18);
  display: flex;
  flex-direction: column;
}

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

.cart-drawer-header {
  padding: 28px;
  border-bottom: 1px solid rgba(92, 70, 52, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cart-drawer-header h2 {
  margin: 4px 0 0;
  color: #3f2f24;
}

.cart-drawer-close {
  border: none;
  background: transparent;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: #5c4634;
}

.cart-drawer-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.drawer-cart-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px dashed rgba(92, 70, 52, 0.18);
}

.drawer-cart-image {
  width: 82px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: #f3eadb;
}

.drawer-cart-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-cart-info h3 {
  margin: 0 0 4px;
  color: #3f2f24;
  font-size: 17px;
}

.drawer-cart-info p {
  margin: 0 0 6px;
  color: #8C6A4A;
  font-weight: 800;
}

.drawer-cart-info strong {
  color: #5c4634;
}

.drawer-qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.drawer-qty button {
  width: 30px;
  height: 30px;
  border: 1px solid #5c4634;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: #5c4634;
}

.drawer-qty span {
  font-weight: 900;
}

.drawer-cart-subtotal {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-cart-subtotal strong {
  color: #3f2f24;
}

.drawer-cart-subtotal button {
  border: none;
  background: transparent;
  color: #9A7A58;
  text-decoration: underline;
  cursor: pointer;
}

.cart-drawer-footer {
  padding: 22px;
  border-top: 1px solid rgba(92, 70, 52, 0.12);
}

.drawer-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 900;
  color: #3f2f24;
}

.drawer-checkout-btn {
  display: block;
  text-align: center;
  background: #8C6A4A;
  color: #FFF8EA;
  padding: 15px;
  border-radius: 14px;
  font-weight: 900;
  text-decoration: none;
  margin-bottom: 12px;
}

.drawer-cart-link {
  display: block;
  text-align: center;
  color: #5c4634;
  font-weight: 800;
  text-decoration: none;
}

.drawer-empty {
  text-align: center;
  padding: 60px 20px;
}

.drawer-empty h3 {
  color: #3f2f24;
}

.drawer-empty p {
  color: #6f5a46;
}

.drawer-empty a {
  color: #8C6A4A;
  font-weight: 900;
}

/* =========================
   Cart Toast
========================= */

.cart-toast {
  position: fixed;
  right: 24px;
  bottom: 92px;
  background: #3E2F22;
  color: #FFF8EA;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 800;
  z-index: 1000;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cart-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   Product List Buy Row
========================= */

.product-buy-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.product-list-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(92, 70, 52, 0.2);
  border-radius: 999px;
  padding: 6px 10px;
}

.product-list-qty button {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: #5c4634;
  font-size: 18px;
  cursor: pointer;
}

.product-list-qty span {
  min-width: 20px;
  text-align: center;
  font-weight: 900;
}

.product-add-btn {
  flex: 1;
  border: none;
  border-radius: 999px;
  background: #8C6A4A;
  color: #FFF8EA;
  font-weight: 900;
  cursor: pointer;
  padding: 10px 18px;
}

.product-add-btn:hover {
  background: #4d5c32;
}

/* =========================
   Mobile
========================= */

@media (max-width: 900px) {
  .floating-cart {
    right: 16px;
    bottom: 16px;
  }

  .floating-cart-button {
    padding: 13px 16px;
  }

  .cart-toast {
    right: 16px;
    bottom: 82px;
    max-width: calc(100% - 32px);
  }

  .product-list-qty {
    justify-content: center;
  }

  .product-add-btn {
    width: 100%;
    padding: 12px;
  }
}

@media (max-width: 430px) {
  .product-buy-row {
    flex-direction: column;
  }
}
