/* ═══════════════════════════════════════════════════════
   CART TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════ */

#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-width: 360px;
  width: calc(100vw - 2rem);
}

.cart-toast {
  pointer-events: all;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  overflow: hidden;
  transform: translateY(1rem) scale(0.96);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease;
}
.cart-toast--visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.cart-toast__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
}

.cart-toast__icon {
  width: 2rem;
  height: 2rem;
  background: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cart-toast__check {
  width: 1rem;
  height: 1rem;
  color: #fff;
}

.cart-toast__img-wrap {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
}
.cart-toast__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-toast__body {
  flex: 1;
  min-width: 0;
}
.cart-toast__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6b7280;
  margin-bottom: 0.15rem;
}
.cart-toast__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-toast__meta {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.1rem;
}

.cart-toast__cta {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: #111827;
  border-radius: 0.5rem;
  padding: 0.4rem 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.cart-toast__cta:hover { background: #374151; }

.cart-toast__close {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.cart-toast__close:hover { background: #f3f4f6; color: #374151; }

/* Progress bar */
.cart-toast__progress {
  height: 3px;
  background: #111827;
  animation: toast-progress 4.5s linear forwards;
}
@keyframes toast-progress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ═══════════════════════════════════════════════════════
   CART BADGE BOUNCE
   ═══════════════════════════════════════════════════════ */
@keyframes badge-bounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.badge-bounce {
  animation: badge-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══════════════════════════════════════════════════════
   ADD-TO-CART BUTTON STATES
   ═══════════════════════════════════════════════════════ */
#add-to-cart-btn {
  transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
#add-to-cart-btn:active:not(:disabled) {
  transform: scale(0.97);
}
#add-to-cart-btn.btn-success {
  background-color: #16a34a !important;
  box-shadow: 0 4px 20px rgba(22,163,74,0.3) !important;
}
#add-to-cart-btn:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 0.7s linear infinite; }

/* ═══════════════════════════════════════════════════════
   CHECKOUT STEPPER
   ═══════════════════════════════════════════════════════ */
.checkout-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2.5rem;
}
.checkout-step {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0;
}
.checkout-step:last-child { flex: none; }

.step-circle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
  background: #fff;
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
  position: relative;
  z-index: 1;
}
.step-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #9ca3af;
  margin-top: 0.4rem;
  white-space: nowrap;
  transition: color 0.3s;
}
.step-connector {
  flex: 1;
  height: 2px;
  background: #e5e7eb;
  margin: 0 0.25rem;
  margin-bottom: 1.4rem;
  transition: background 0.3s;
  position: relative;
  overflow: hidden;
}
.step-connector::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: #111827;
  transition: width 0.5s ease;
}
.step-connector.completed::after { width: 100%; }

/* Active step */
.checkout-step.active .step-circle {
  border-color: #111827;
  background: #111827;
  color: #fff;
}
.checkout-step.active .step-label { color: #111827; }

/* Completed step */
.checkout-step.completed .step-circle {
  border-color: #111827;
  background: #111827;
  color: #fff;
}
.checkout-step.completed .step-label { color: #6b7280; }

/* ── Step panels ─────────────────────────────────────── */
.checkout-panel { display: none; }
.checkout-panel.panel-active { display: block; }

/* Panel enter animation */
@keyframes panel-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.checkout-panel.panel-active {
  animation: panel-in 0.3s ease forwards;
}

/* ── Input focus styles ──────────────────────────────── */
.checkout-input {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.checkout-input:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}
.checkout-input.input-error {
  border-color: #ef4444;
}
.checkout-input.input-error:focus {
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.field-error {
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 0.25rem;
  display: none;
}
.field-error.visible { display: block; }

/* ── Payment card selector ───────────────────────────── */
.payment-method-card {
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.payment-method-card:has(input:checked) {
  border-color: #111827;
  background: #f9fafb;
}
.payment-method-card input[type="radio"] {
  accent-color: #111827;
  width: 1.1rem;
  height: 1.1rem;
}

/* ── Shipping option selector ────────────────────────── */
.shipping-option {
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.shipping-option:has(input:checked) {
  border-color: #111827;
  background: #f9fafb;
}

/* ── Review order items ──────────────────────────────── */
.review-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.review-item:last-child { border-bottom: none; }
.review-item img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: cover;
  border-radius: 0.5rem;
  background: #f3f4f6;
}

/* ── Place order button ──────────────────────────────── */
#place-order-btn {
  position: relative;
  overflow: hidden;
}
#place-order-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0s;
}
#place-order-btn:hover::after {
  transform: translateX(100%);
  transition: transform 0.6s ease;
}

/* Mobile toast adjustments */
@media (max-width: 480px) {
  #toast-container {
    bottom: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
    max-width: 100%;
    width: auto;
  }
  .cart-toast__cta { display: none; }
}
