/* =========================================================
   HPP Legacy – Page-specific styles
   ---------------------------------------------------------
   IMPORTANT:
   - homestyle.css is the single source of truth for
     brand variables (colors, borders, radii).
   - This file MUST NOT redefine brand variables.
   ========================================================= */

/* Only define tokens that are unique to this page */
:root {
  --shadow-soft: 0 6px 18px rgba(17, 24, 39, 0.08);
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 14px;
}

/* Base helpers */
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;
}

.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);
}

/* =========================================================
   Address / 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;
}

/* =========================================================
   Order summary
   ========================================================= */

.summary {
  display: grid;
  gap: 10px;
}

.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);
}

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

/* =========================================================
   Primary CTA (Pay Now) – BULLETPROOF
   ========================================================= */

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;

  /* FALLBACKS ENSURE STYLE NEVER DROPS */
  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);
}

/* =========================================================
   Drawer (instructions 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;
  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;
}

.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;
}

/* =========================================================
   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;
  }
}
