/* ================================================================
   Ternaria Biosciences — Cart Widget Styles  (cart.css v1.0)
   Pairs with cart.js. Included on all 6 product pages.
================================================================ */

/* ── Nav cart toggle button ───────────────────────────────────── */
#tnCart-toggle {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  margin-left: 0.75rem;
  flex-shrink: 0;
}
#tnCart-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* Item count badge */
#tnCart-badge {
  position: absolute;
  top: 1px; right: 1px;
  min-width: 17px; height: 17px;
  background: #e8701f;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 9px;
  display: none;          /* shown via JS when count > 0 */
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ── Overlay ──────────────────────────────────────────────────── */
#tnCart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.38);
  z-index: 900;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#tnCart-overlay.visible { display: block; }

/* ── Drawer ───────────────────────────────────────────────────── */
#tnCart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 400px;
  max-width: 96vw;
  background: #fff;
  z-index: 901;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -6px 0 40px rgba(33,58,93,0.14);
}
#tnCart-drawer.open { transform: translateX(0); }

/* Header */
.tnCart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 70px;           /* matches nav height */
  border-bottom: 1px solid #dcedf5;
  background: #213a5d;
  flex-shrink: 0;
}
.tnCart-header h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: #fff;
  margin: 0;
}
.tnCart-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.2s, background 0.2s;
}
.tnCart-close:hover { color: #fff; background: rgba(255,255,255,0.12); }

/* Empty state */
.tnCart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  text-align: center;
  color: #6b8694;
}
.tnCart-empty p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
  color: #1a2e3d;
  font-weight: 500;
}
.tnCart-empty-sub {
  margin-top: 0.4rem !important;
  font-size: 0.82rem !important;
  color: #a0b4be !important;
  font-weight: 400 !important;
}

/* Items list */
.tnCart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}
.tnCart-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f0f7fb;
}
.tnCart-item:last-child { border-bottom: none; }

.tnCart-item-info { flex: 1; min-width: 0; }
.tnCart-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a2e3d;
  line-height: 1.4;
  margin-bottom: 0.2rem;
}
.tnCart-item-meta {
  font-size: 0.75rem;
  color: #6b8694;
  margin-bottom: 0.3rem;
  letter-spacing: 0.01em;
}
.tnCart-item-price {
  font-size: 0.88rem;
  color: #287890;
  font-weight: 600;
}

.tnCart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.tnCart-qty-btn {
  width: 27px; height: 27px;
  background: #f7fbfd;
  border: 1px solid #dcedf5;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: #213a5d;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.tnCart-qty-btn:hover { background: #eef8fc; border-color: #3b93ac; }
.tnCart-qty {
  min-width: 22px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a2e3d;
}
.tnCart-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #b0c4ce;
  font-size: 0.75rem;
  padding: 0.3rem 0.2rem;
  margin-left: 0.1rem;
  line-height: 1;
  transition: color 0.2s;
}
.tnCart-remove:hover { color: #c0392b; }

/* Footer */
.tnCart-footer {
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1px solid #dcedf5;
  background: #f7fbfd;
  flex-shrink: 0;
}
.tnCart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1a2e3d;
  margin-bottom: 0.4rem;
}
.tnCart-footer-note {
  font-size: 0.75rem;
  color: #6b8694;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.tnCart-checkout-btn {
  width: 100%;
  padding: 0.9rem 1rem;
  background: #287890;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: 0.01em;
}
.tnCart-checkout-btn:hover { background: #213a5d; transform: translateY(-1px); }
.tnCart-checkout-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.tnCart-clear-btn {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: #6b8694;
  border: none;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: color 0.2s;
}
.tnCart-clear-btn:hover { color: #c0392b; }

/* ── Price column in order tables ─────────────────────────────── */
table.order-table th.price-col {
  text-align: right;
}
table.order-table td.price-col {
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}
.price-display {
  display: block;
  font-weight: 700;
  color: #1a2e3d;
  font-size: 1rem;
}
.price-unit {
  display: block;
  font-size: 0.7rem;
  color: #6b8694;
  margin-top: 0.05rem;
  letter-spacing: 0.02em;
}

/* ── Add-to-Cart button in order tables ───────────────────────── */
.add-to-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #287890;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  padding: 0.52rem 1.1rem;
  border-radius: 8px;
  transition: background 0.2s, transform 0.15s;
  font-family: 'Inter', system-ui, sans-serif;
  white-space: nowrap;
}
.add-to-cart-btn:hover { background: #213a5d; transform: translateY(-1px); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  #tnCart-drawer { width: 100%; max-width: 100%; }
}
