/* ═══════════════════════════════════════════════════════════
   CodifyBD Cart System — Floating Cart, Drawer, Checkout
   ═══════════════════════════════════════════════════════════ */

/* ── Floating Cart Button (FAB) ── */
.cart-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 997;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--ink, #0d0d14);
  color: var(--white, #fff);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(13, 13, 20, 0.25);
}
.cart-fab:hover { background: var(--red, #d94f2c); transform: scale(1.05); }
.cart-fab svg { width: 20px; height: 20px; }
.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  background: var(--red, #d94f2c);
  color: #fff;
  font-family: var(--ff-b, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--paper, #f7f5f0);
  transition: transform 0.25s;
  pointer-events: none;
}
.cart-badge.bump { animation: cartBump 0.3s ease; }
@keyframes cartBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.cart-badge[data-count="0"] { display: none; }

/* ── Cart Drawer Backdrop ── */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 20, 0.4);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  backdrop-filter: blur(4px);
}
.cart-backdrop.open { opacity: 1; visibility: visible; }

/* ── Cart Drawer ── */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 92vw;
  height: 100vh;
  background: var(--white, #fff);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(13, 13, 20, 0.12);
}
.cart-drawer.open { transform: translateX(0); }

/* Drawer Header */
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, rgba(13,13,20,.10));
  flex-shrink: 0;
}
.cart-drawer-title {
  font-family: var(--ff-d, 'Playfair Display', serif);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink, #0d0d14);
}
.cart-drawer-count {
  font-family: var(--ff-m, 'Fira Code', monospace);
  font-size: 0.72rem;
  color: var(--muted, #7b7672);
  margin-left: 8px;
}
.cart-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border, rgba(13,13,20,.10));
  border-radius: 8px;
  background: none;
  cursor: pointer;
  color: var(--muted, #7b7672);
  transition: all 0.15s;
}
.cart-close-btn:hover { background: var(--cream, #edeae2); color: var(--ink); }

/* Drawer Body */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--muted, #7b7672);
}
.cart-empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; }
.cart-empty-text { font-size: 0.95rem; margin-bottom: 6px; }
.cart-empty-sub { font-size: 0.8rem; opacity: 0.6; }

/* Cart Item */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border, rgba(13,13,20,.10));
}
.cart-item:last-child { border-bottom: none; }
.cart-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.cart-item-icon.domain { background: #eef1ff; }
.cart-item-icon.hosting { background: #edfdf4; }
.cart-item-icon.service { background: #fff1ee; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink, #0d0d14);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-desc {
  font-size: 0.75rem;
  color: var(--muted, #7b7672);
  margin-bottom: 8px;
}
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cart-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border, rgba(13,13,20,.10));
  background: var(--paper, #f7f5f0);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.cart-qty-btn:hover { border-color: var(--red); color: var(--red); }
.cart-qty-val {
  font-family: var(--ff-m, 'Fira Code', monospace);
  font-size: 0.82rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}
.cart-item-price {
  font-family: var(--ff-d, 'Playfair Display', serif);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ink);
  white-space: nowrap;
  text-align: right;
}
.cart-item-remove {
  background: none;
  border: none;
  color: var(--muted, #7b7672);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}
.cart-item-remove:hover { color: #dc2626; }
.cart-item-remove svg { width: 16px; height: 16px; }

/* Drawer Footer */
.cart-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border, rgba(13,13,20,.10));
  flex-shrink: 0;
  background: var(--paper, #f7f5f0);
}
.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.cart-subtotal-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.cart-subtotal-value {
  font-family: var(--ff-d, 'Playfair Display', serif);
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--red, #d94f2c);
}
.cart-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: var(--red, #d94f2c);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.cart-checkout-btn:hover { background: #c24025; }
.cart-checkout-btn svg { width: 18px; height: 18px; }
.cart-continue {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}
.cart-continue:hover { color: var(--ink); }

/* ── Toast Notification ── */
.cart-toast {
  position: fixed;
  bottom: 90px;
  right: 24px;
  background: var(--ink, #0d0d14);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(13,13,20,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-toast.show { opacity: 1; transform: translateY(0); }
.cart-toast .toast-icon { font-size: 1rem; }

/* ── Checkout Page ── */
.checkout-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 120px 24px 80px;
}
.checkout-heading {
  font-family: var(--ff-d, 'Playfair Display', serif);
  font-weight: 900;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  color: var(--ink);
  margin-bottom: 8px;
}
.checkout-sub {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 48px;
}
.checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: flex-start;
}
.checkout-form-section h3,
.checkout-summary-section h3 {
  font-family: var(--ff-d, 'Playfair Display', serif);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 24px;
  color: var(--ink);
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-group label .required { color: var(--red); }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--ff-b, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.9rem;
  border: 1.5px solid var(--border, rgba(13,13,20,.15));
  border-radius: 10px;
  background: var(--white, #fff);
  color: var(--ink);
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--red, #d94f2c);
  box-shadow: 0 0 0 3px rgba(217, 79, 44, 0.1);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Payment Methods */
.payment-methods { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border, rgba(13,13,20,.12));
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.payment-option:hover { border-color: var(--ink); }
.payment-option.selected { border-color: var(--red, #d94f2c); background: var(--red-lt, #fff1ee); }
.payment-option input[type="radio"] { display: none; }
.payment-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border, rgba(13,13,20,.2));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.payment-option.selected .payment-radio { border-color: var(--red); }
.payment-option.selected .payment-radio::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red, #d94f2c);
}
.payment-icon { font-size: 1.4rem; }
.payment-info { flex: 1; }
.payment-name { font-weight: 600; font-size: 0.9rem; }
.payment-desc { font-size: 0.72rem; color: var(--muted); }

/* Order Summary Card */
.order-summary-card {
  background: var(--paper, #f7f5f0);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  position: sticky;
  top: 96px;
}
.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.summary-item:last-child { border-bottom: none; }
.summary-item-name {
  font-size: 0.88rem;
  font-weight: 500;
  flex: 1;
  padding-right: 16px;
}
.summary-item-qty {
  font-family: var(--ff-m, 'Fira Code', monospace);
  font-size: 0.75rem;
  color: var(--muted);
}
.summary-item-price {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
.summary-divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.summary-row.total {
  padding: 12px 0 0;
}
.summary-label { font-size: 0.85rem; color: var(--muted); }
.summary-value { font-weight: 600; font-size: 0.9rem; }
.summary-row.total .summary-label {
  font-family: var(--ff-d, 'Playfair Display', serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.summary-row.total .summary-value {
  font-family: var(--ff-d, 'Playfair Display', serif);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--red, #d94f2c);
}
.checkout-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: var(--red, #d94f2c);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 20px;
}
.checkout-submit-btn:hover { background: #c24025; }
.checkout-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Terms Checkbox */
.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--muted);
}
.terms-check input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--red, #d94f2c);
}
.terms-check a { color: var(--red); text-decoration: none; }

/* ── Order Confirmation ── */
.confirmation-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 120px 24px 80px;
  text-align: center;
}
.confirmation-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #edfdf4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 24px;
}
.confirmation-title {
  font-family: var(--ff-d, 'Playfair Display', serif);
  font-weight: 900;
  font-size: 2rem;
  color: var(--ink);
  margin-bottom: 12px;
}
.confirmation-sub {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 32px;
}
.confirmation-order-id {
  display: inline-block;
  font-family: var(--ff-m, 'Fira Code', monospace);
  font-size: 0.9rem;
  background: var(--cream, #edeae2);
  padding: 10px 20px;
  border-radius: 8px;
  margin-bottom: 32px;
  color: var(--ink);
  font-weight: 600;
}
.confirmation-details {
  background: var(--paper, #f7f5f0);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  text-align: left;
  margin-bottom: 32px;
}
.confirmation-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.confirmation-row:last-child { border: none; }
.confirmation-row-label { color: var(--muted); }
.confirmation-row-value { font-weight: 600; }
.confirmation-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Add to Cart Button (on product cards) ── */
.btn-add-cart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--red, #d94f2c);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-add-cart:hover { background: #c24025; transform: translateY(-1px); }
.btn-add-cart svg { width: 16px; height: 16px; }
.btn-add-cart.added {
  background: #16a34a;
  pointer-events: none;
}

/* ── Cart Page (empty state on checkout.html) ── */
.cart-page-empty {
  text-align: center;
  padding: 60px 20px;
}
.cart-page-empty-icon { font-size: 4rem; opacity: 0.2; margin-bottom: 20px; }
.cart-page-empty h2 {
  font-family: var(--ff-d, 'Playfair Display', serif);
  font-weight: 800;
  font-size: 1.8rem;
  margin-bottom: 12px;
}
.cart-page-empty p { color: var(--muted); margin-bottom: 28px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .cart-drawer { width: 100%; max-width: 100%; }
  .checkout-grid { grid-template-columns: 1fr; }
  .order-summary-card { position: static; }
  .form-row { grid-template-columns: 1fr; }
  .checkout-wrap { padding: 100px 18px 60px; }
  .confirmation-wrap { padding: 100px 18px 60px; }
}
@media (max-width: 480px) {
  .cart-fab { width: 40px; height: 40px; }
  .cart-item { gap: 10px; }
  .cart-item-icon { width: 36px; height: 36px; font-size: 1rem; }
}
