/* ========================================================================
   FILE: files/css/paystack.css
   PURPOSE: Styles for Paystack Payment System, Cart Drawer, and Auto-Calculation
   ======================================================================== */

/* ---------- Header Cart Button ---------- */
.header-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--forest, #14352d);
  border: 1px solid var(--line, #e4e6df);
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-body, inherit);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: all var(--motion-fast, 0.2s) ease;
  position: relative;
  text-decoration: none;
}
.header-cart-btn:hover {
  background: var(--eleve-cream, #f7f5ed);
  border-color: var(--eleve-primary, #0d735c);
  color: var(--eleve-primary, #0d735c);
  transform: translateY(-1px);
}
.header-cart-btn svg {
  stroke: currentColor;
}
.cart-badge {
  background: var(--eleve-primary, #0d735c);
  color: #ffffff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  line-height: 1;
}

/* ---------- Floating Cart Button (Moved Just Above Back To Top) ---------- */
.floating-cart-btn {
  position: fixed;
  bottom: 82px;
  right: 24px;
  z-index: 990;
  background: var(--eleve-primary, #0d735c);
  color: #ffffff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -5px rgba(13, 115, 92, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}
.floating-cart-btn:hover {
  transform: scale(1.08) translateY(-2px);
  background: var(--eleve-primary-dark, #085544);
  color: #ffffff;
}
.floating-cart-btn .cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #d32f2f;
  color: #ffffff;
  border: 2px solid #ffffff;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  padding: 0 4px;
}

/* ---------- Back to Top Floating Button ---------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--eleve-primary, #0d735c);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 25px -5px rgba(13, 115, 92, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 989;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--eleve-primary-dark, #085544);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 28px -5px rgba(13, 115, 92, 0.55);
}
.back-to-top:focus-visible, .floating-cart-btn:focus-visible {
  outline: 3px solid #8bb23f;
  outline-offset: 3px;
}

@media (max-width: 540px) {
  .back-to-top {
    bottom: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
  }
  .floating-cart-btn {
    bottom: 72px;
    right: 18px;
    width: 44px;
    height: 44px;
  }
}

/* ---------- Auto-Calculation Price Box ---------- */
.calc-box {
  background: #f4f8f5;
  border: 1px solid #cbe6d6;
  border-radius: 12px;
  padding: 14px 18px;
  margin: 16px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.calc-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--ink-soft, #4a5652);
}
.calc-line.total-line {
  border-top: 1px dashed #b8d9c5;
  padding-top: 8px;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--forest, #14352d);
}
.calc-total-val {
  font-family: var(--font-display, inherit);
  font-size: 20px;
  font-weight: 800;
  color: var(--eleve-primary, #0d735c);
}

/* ---------- Quick Quantity Presets ---------- */
.qty-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.qty-preset-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-mute, #7a857f);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.qty-chip {
  background: #ffffff;
  border: 1px solid var(--line, #e4e6df);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--forest, #14352d);
  cursor: pointer;
  transition: all 0.15s ease;
}
.qty-chip:hover, .qty-chip.active {
  background: var(--eleve-primary, #0d735c);
  border-color: var(--eleve-primary, #0d735c);
  color: #ffffff;
}

/* ---------- Buy Row & Paystack Buttons ---------- */
.buy-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.btn-paystack {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #09a5db; /* Paystack Blue */
  background: linear-gradient(135deg, #0ba4db 0%, #087fa8 100%);
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: 0.2px;
  padding: 14px 24px;
  cursor: pointer;
  box-shadow: 0 8px 20px -6px rgba(11, 164, 219, 0.45);
  transition: all var(--motion-fast, 0.2s) var(--ease-bounce, ease);
  min-height: 50px;
}
.btn-paystack:hover {
  background: linear-gradient(135deg, #0893c5 0%, #066d91 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(11, 164, 219, 0.55);
}
.btn-paystack svg {
  flex-shrink: 0;
}
.btn-add-cart-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  color: var(--eleve-primary, #0d735c);
  border: 2px solid var(--eleve-primary, #0d735c);
  border-radius: 999px;
  font-weight: 700;
  font-size: 13.5px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all var(--motion-fast, 0.2s) ease;
}
.btn-add-cart-outline:hover {
  background: var(--eleve-primary, #0d735c);
  color: #ffffff;
}

/* ---------- Cart Drawer ---------- */
.cart-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.cart-drawer.open {
  display: flex;
}
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 19, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1001;
}
.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100%);
  background: #ffffff;
  z-index: 1002;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  animation: slideDrawer 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slideDrawer {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.cart-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--line, #e4e6df);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--eleve-cream, #f7f5ed);
}
.cart-header h2 {
  font-family: var(--font-display, inherit);
  font-size: 20px;
  font-weight: 800;
  color: var(--forest, #14352d);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-close-btn {
  background: none;
  border: 0;
  font-size: 24px;
  color: var(--ink-soft, #4a5652);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.cart-close-btn:hover {
  color: #d32f2f;
}
.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}
.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft, #4a5652);
}
.cart-empty-icon {
  font-size: 48px;
  margin-bottom: 14px;
  display: block;
}
.cart-empty p {
  margin-bottom: 20px;
  font-size: 15px;
}
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cart-item-card {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 16px;
  padding: 16px;
  background: var(--eleve-cream, #f7f5ed);
  border-radius: 14px;
  border: 1px solid var(--line-soft, #eef0e8);
  position: relative;
}
.cart-item-img {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  border: 1px solid var(--line, #e4e6df);
}
.cart-item-info h4 {
  font-family: var(--font-display, inherit);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--forest, #14352d);
  margin: 0 0 4px;
  padding-right: 24px;
}
.cart-item-unit-price {
  font-size: 13px;
  color: var(--ink-soft, #4a5652);
  margin-bottom: 10px;
}
.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-item-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line, #e4e6df);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}
.cart-item-stepper button {
  background: #ffffff;
  border: 0;
  width: 30px;
  height: 30px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: var(--forest, #14352d);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item-stepper button:hover {
  background: #eef2ec;
}
.cart-item-stepper span {
  width: 32px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink, #0b1413);
}
.cart-item-subtotal {
  font-family: var(--font-display, inherit);
  font-size: 15px;
  font-weight: 800;
  color: var(--eleve-primary, #0d735c);
}
.cart-item-remove {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: 0;
  color: var(--ink-mute, #aeb9b5);
  font-size: 18px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}
.cart-item-remove:hover {
  color: #d32f2f;
}
.cart-footer {
  padding: 24px 28px;
  border-top: 1px solid var(--line, #e4e6df);
  background: #ffffff;
}
.cart-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--ink-soft, #4a5652);
  margin-bottom: 8px;
}
.cart-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--forest, #14352d);
  padding: 12px 0 16px;
  border-top: 1px solid var(--line, #e4e6df);
}
.cart-total-amount {
  font-family: var(--font-display, inherit);
  font-size: 22px;
  color: var(--eleve-primary, #0d735c);
}
.cart-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-clear-cart {
  background: none;
  border: 0;
  color: var(--ink-mute, #7a857f);
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  text-align: center;
  padding: 4px;
}
.btn-clear-cart:hover {
  color: #d32f2f;
}

/* ---------- Paystack Checkout Modal ---------- */
.checkout-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.checkout-modal.open {
  display: flex;
}
.checkout-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 19, 0.7);
  backdrop-filter: blur(4px);
}
.checkout-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3);
  z-index: 1051;
  padding: 32px 36px;
  animation: zoomIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.checkout-header {
  margin-bottom: 24px;
  position: relative;
}
.checkout-header h3 {
  font-family: var(--font-display, inherit);
  font-size: 22px;
  font-weight: 800;
  color: var(--forest, #14352d);
  margin: 0 0 6px;
}
.checkout-header p {
  color: var(--ink-soft, #4a5652);
  font-size: 13.5px;
  margin: 0;
}
.checkout-close {
  position: absolute;
  top: -4px;
  right: -4px;
  background: none;
  border: 0;
  font-size: 26px;
  color: var(--ink-mute, #aeb9b5);
  cursor: pointer;
  line-height: 1;
}
.checkout-close:hover {
  color: #d32f2f;
}
.checkout-order-summary {
  background: var(--eleve-cream, #f7f5ed);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  border: 1px solid var(--line-soft, #eef0e8);
}
.checkout-summary-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-mute, #7a857f);
  margin-bottom: 10px;
}
.checkout-summary-items {
  max-height: 140px;
  overflow-y: auto;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--ink, #0b1413);
}
.checkout-summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--line, #e4e6df);
  padding-top: 10px;
  font-weight: 800;
  font-size: 16px;
  color: var(--forest, #14352d);
}
.checkout-form .form-group {
  margin-bottom: 16px;
}
.checkout-form label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--forest, #14352d);
  margin-bottom: 6px;
}
.checkout-form input, .checkout-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line, #e4e6df);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  background: #ffffff;
  color: var(--ink, #0b1413);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.checkout-form input:focus, .checkout-form textarea:focus {
  border-color: var(--eleve-primary, #0d735c);
  box-shadow: 0 0 0 3px rgba(13, 115, 92, 0.12);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
  .checkout-dialog { padding: 24px 18px; width: min(100%, 94vw); }
  .checkout-form input, .checkout-form textarea { font-size: 16px; }
}
.paystack-trust-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-mute, #7a857f);
}
