/* Ironing Hero — shared cart styles
   Requires CSS variables: --blue, --blue-dark, --gray-50, --gray-200, --gray-500, --gray-700, --gray-900, --orange, --radius
   If your page does not define them, the fallbacks below kick in. */
:root {
  --ih-blue: var(--blue, #1a56db);
  --ih-blue-dark: var(--blue-dark, #1341b0);
  --ih-orange: var(--orange, #c2410c);
  --ih-gray-50: var(--gray-50, #f9fafb);
  --ih-gray-200: var(--gray-200, #e5e7eb);
  --ih-gray-500: var(--gray-500, #6b7280);
  --ih-gray-700: var(--gray-700, #374151);
  --ih-gray-900: var(--gray-900, #111827);
}

.cart-fab {
  position: fixed; bottom: 24px; left: 24px; z-index: 999;
  background: var(--ih-blue); color: #fff;
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; box-shadow: 0 4px 20px rgba(37, 99, 235, .5);
  border: none; cursor: pointer; transition: transform .2s;
}
.cart-fab:hover { transform: scale(1.1); }
.cart-fab .cart-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--ih-orange); color: #fff;
  min-width: 22px; height: 22px; border-radius: 11px;
  font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.cart-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
  z-index: 1000; opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }
.cart-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 420px;
  background: #fff; z-index: 1001;
  transform: translateX(100%); transition: transform .3s ease;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 30px rgba(0, 0, 0, .15);
}
.cart-panel.open { transform: translateX(0); }
.cart-header {
  padding: 18px 22px; border-bottom: 1px solid var(--ih-gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.cart-header h3 { font-size: 1.1rem; font-weight: 800; margin: 0; }
.cart-close {
  background: var(--ih-gray-50); border: none; border-radius: 50%;
  width: 36px; height: 36px; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--ih-gray-500);
}
.cart-close:hover { background: var(--ih-gray-200); }
.cart-body { flex: 1; overflow-y: auto; padding: 16px 22px; }
.cart-empty { text-align: center; color: var(--ih-gray-500); padding: 48px 16px; font-size: .9rem; }
.cart-empty i { font-size: 2.5rem; color: var(--ih-gray-200); margin-bottom: 12px; display: block; }
.cart-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--ih-gray-200);
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: .9rem; margin-bottom: 4px; line-height: 1.3; }
.cart-item-unit { font-size: .76rem; color: var(--ih-gray-500); }
.cart-item-controls { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--ih-gray-200); background: #fff;
  font-weight: 700; cursor: pointer; color: var(--ih-gray-700);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
}
.qty-btn:hover { background: var(--ih-gray-50); border-color: var(--ih-blue); color: var(--ih-blue); }
.qty-val { min-width: 28px; text-align: center; font-weight: 700; font-size: .9rem; }
.cart-item-right { text-align: right; min-width: 80px; }
.cart-item-price { font-weight: 700; font-size: .9rem; color: var(--ih-blue); }
.cart-item-remove {
  background: none; border: none; color: var(--ih-gray-500);
  cursor: pointer; font-size: .78rem; margin-top: 6px; padding: 0;
}
.cart-item-remove:hover { color: #dc2626; }
.cart-footer {
  padding: 18px 22px; border-top: 1px solid var(--ih-gray-200);
  background: var(--ih-gray-50);
}
.cart-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px; font-size: .95rem;
}
.cart-total strong { font-size: 1.3rem; color: var(--ih-gray-900); }
.cart-note { font-size: .72rem; color: var(--ih-gray-500); margin-bottom: 12px; line-height: 1.4; }
.cart-checkout {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px;
  background: #25d366; color: #fff;
  border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  text-decoration: none; transition: background .2s;
}
.cart-checkout:hover { background: #1ebe5d; }
.cart-checkout:disabled { background: var(--ih-gray-200); color: var(--ih-gray-500); cursor: not-allowed; }
.cart-clear {
  display: block; width: 100%; margin-top: 8px;
  background: none; border: none; color: var(--ih-gray-500);
  cursor: pointer; font-size: .8rem; padding: 6px;
}
.cart-clear:hover { color: #dc2626; }
.option-row[data-cart-add], tr[data-cart-add] { cursor: pointer; }
.cart-toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ih-gray-900); color: #fff;
  padding: 10px 18px; border-radius: 30px;
  font-size: .85rem; font-weight: 600;
  z-index: 1002; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.cart-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Add-to-cart pulse animation */
@keyframes cart-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.cart-fab.pulse { animation: cart-pulse .35s ease; }

@media (max-width: 768px) {
  .cart-fab { bottom: 92px; }
  .cart-toast { bottom: 160px; }
}
