/* Embedded Checkout (Direct Post)
   - Matches your cart look/structure
   - Adds compact payment fields under the total
   - Includes the instruction drawer styles
   - Does NOT redefine brand variables (homestyle.css owns them)
*/

:root {
  --shadow-soft: 0 6px 18px rgba(17, 24, 39, 0.08);
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 14px;
}

body {
  font-family: "RN House Sans", RNHouseSansRegular, ui-sans-serif,
               system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
               sans-serif;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Header */
.demo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.demo-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.7);
  box-shadow: var(--shadow-soft);
  color: rgba(60,16,83,.9);
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: none;
}

.link-pill:hover {
  border-color: rgba(60,16,83,.22);
  color: var(--tyl-red);
}

/* Layout */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 12px;
  align-items: start;
}

.cart-grid {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.side {
  display: grid;
  gap: 12px;
}

/* Cards */
.cart-card,
.side-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.06);
  padding: 16px;
}

.card-title,
.side-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 900;
  color: var(--nw-purple);
}

/* Product row */
.cart-card-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items: stretch;
}

.product-media {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(60,16,83,.03);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.product-name {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 900;
  color: var(--nw-purple);
}

.product-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 70ch;
}

.product-price .price {
  font-weight: 900;
  color: var(--nw-purple);
  font-size: 16px;
  text-align: right;
}

.product-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(60,16,83,.04);
  font-size: 12px;
  color: rgba(60,16,83,.9);
}

/* Info rows */
.info-rows { display: grid; gap: 10px; }

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dashed rgba(24,24,31,.10);
  padding-bottom: 8px;
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Summary */
.summary {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.summary-divider {
  height: 1px;
  background: rgba(24,24,31,.10);
  margin: 4px 0;
}

.summary-row.total {
  font-weight: 900;
  color: var(--nw-purple);
}

/* Direct Post form */
.dp-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(24,24,31,.10);
}

.scheme-logos {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.scheme-logos img {
  height: 18px;
  width: auto;
  display: block;
  opacity: 0.95;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 850;
  color: rgba(60,16,83,.95);
}

.dp-form input[type="text"],
.dp-form input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(24,24,31,.12);
  background: rgba(255,255,255,.92);
  font-size: 14px;
  outline: none;
}

.dp-form input[type="text"]:focus,
.dp-form input[type="password"]:focus {
  border-color: rgba(60,16,83,.28);
  box-shadow: 0 0 0 3px rgba(60,16,83,.08);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card-number-wrap { position: relative; }

.card-brand-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 18px;
  width: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}

.field-hint { margin-top: 6px; }

/* Primary CTA (existing styling, hardened with fallbacks) */
button.primary-cta,
a.primary-cta {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  margin-top: 14px;
  border: none;
  border-radius: var(--r-md);
  padding: 14px;
  font-size: 14.5px;
  font-weight: 900;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--nw-purple, #3C1053), var(--tyl-red, #DC1405));
  box-shadow: 0 16px 32px rgba(17, 24, 39, 0.12);
  transition: transform .12s ease, box-shadow .12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button.primary-cta:hover,
a.primary-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(17, 24, 39, 0.16);
}

.pay-note { margin-top: 10px; }

/* ----------------------------
   Drawer (expandable panel)
   ---------------------------- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  z-index: 50;
  display: none;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 92vw);
  background: rgba(255,255,255,.96);
  border-left: 1px solid rgba(24,24,31,.12);
  box-shadow: -24px 0 48px rgba(0,0,0,.18);
  transform: translateX(100%);
  transition: transform .18s ease;
  z-index: 60;
  display: flex;
  flex-direction: column;
}

.drawer.open { transform: translateX(0%); }
.drawer-overlay.open { display: block; }

.drawer-header {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(24,24,31,.10);
}

.drawer-header h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 950;
  color: var(--nw-purple);
}

.drawer-close {
  appearance: none;
  border: 1px solid rgba(60,16,83,.18);
  background: rgba(255,255,255,.9);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  color: rgba(60,16,83,.9);
}

.drawer-close:hover {
  color: var(--tyl-red);
  border-color: rgba(60,16,83,.28);
}

.drawer-body {
  padding: 16px;
  overflow: auto;
}

.steps {
  margin: 0;
  padding-left: 18px;
  color: rgba(27,27,31,.86);
}

.steps li { margin: 8px 0; }

.drawer-panel {
  margin-top: 14px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(60,16,83,.14);
  background: rgba(60,16,83,.04);
  padding: 14px;
}

.drawer-panel p { margin: 0 0 10px; }

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
}

/* Responsive */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .cart-card-row { grid-template-columns: 1fr; }
  .product-top { flex-direction: column; align-items: flex-start; }
  .product-price .price { text-align: left; }
  .demo-header { flex-direction: column; align-items: flex-start; }
  .field-row { grid-template-columns: 1fr; }
}
