/* ---------------------------------------------------------------------------
   Confidova Store — design tokens & base
   Clean white canvas, soft shadows, generous radii, smooth motion.
--------------------------------------------------------------------------- */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --ink: #0b0c0f;
  --ink-2: #4a4f57;
  --ink-3: #868c96;
  --line: #ececf0;
  --accent: #0b0c0f;
  --accent-soft: #f0f1f3;
  --brand: #635bff;      /* Stripe purple accent */
  --brand-ink: #4b45d6;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 18, 27, 0.04), 0 4px 16px rgba(16, 18, 27, 0.06);
  --shadow-md: 0 8px 30px rgba(16, 18, 27, 0.10);
  --shadow-lg: 0 24px 60px rgba(16, 18, 27, 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.container { width: min(1160px, 100% - 40px); margin-inline: auto; }

a { color: inherit; text-decoration: none; }

/* ---------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 9px; }
.brand-light { color: var(--ink-3); font-weight: 600; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(99,91,255,0.14); }

.cart-button {
  position: relative; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cart-button:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.cart-button:active { transform: scale(0.96); }
.cart-badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--brand); color: #fff; font-size: 0.72rem; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 2px 6px rgba(99,91,255,0.45);
  animation: pop 0.28s var(--ease);
}
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------------------------------------------------------------------------
   Hero
--------------------------------------------------------------------------- */
.hero { padding: clamp(64px, 12vw, 128px) 0 clamp(48px, 8vw, 96px); text-align: center; }
.hero-eyebrow {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.74rem; font-weight: 700;
  color: var(--brand-ink); margin: 0 0 20px;
}
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1.04; letter-spacing: -0.035em;
  font-weight: 800; margin: 0 0 22px;
}
.hero-sub { max-width: 620px; margin: 0 auto 34px; color: var(--ink-2); font-size: clamp(1rem, 2vw, 1.18rem); }
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 0.98rem;
  padding: 14px 28px; border-radius: 999px; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------------------------------------------------------------------------
   Product grid
--------------------------------------------------------------------------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 28px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); letter-spacing: -0.03em; margin: 0; }
.status-note { color: var(--ink-3); font-size: 0.9rem; margin: 0; }

.product-grid {
  display: grid; gap: 22px; padding-bottom: 90px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  animation: rise 0.5s var(--ease) both;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.card:hover .card-media img { transform: scale(1.06); }
.card-tag {
  position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,0.9); backdrop-filter: blur(6px);
  color: var(--ink-2); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 5px 10px; border-radius: 999px; text-transform: uppercase;
}

.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.card-blurb { color: var(--ink-3); font-size: 0.86rem; margin: 0; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 12px; }
.card-price { font-size: 1.18rem; font-weight: 800; letter-spacing: -0.02em; }

.add-button {
  border: none; cursor: pointer; font-weight: 600; font-size: 0.9rem;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  transition: transform 0.18s var(--ease), background 0.2s var(--ease); white-space: nowrap;
}
.add-button:hover { transform: translateY(-1px); background: #000; }
.add-button:active { transform: scale(0.95); }
.add-button.added { background: #16a34a; }

/* Skeleton loading */
.skeleton { height: 340px; border: 1px solid var(--line);
  background: linear-gradient(100deg, #f2f3f5 30%, #f9fafb 50%, #f2f3f5 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 30px 0; color: var(--ink-3); font-size: 0.85rem; text-align: center; }

/* ---------------------------------------------------------------------------
   Cart drawer
--------------------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(11,12,15,0.42); z-index: 50; opacity: 0; animation: fade 0.28s var(--ease) forwards; }
@keyframes fade { to { opacity: 1; } }

.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(420px, 100vw); z-index: 60;
  background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.42s var(--ease);
}
.cart-drawer.open { transform: translateX(0); }

.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.cart-head h3 { margin: 0; font-size: 1.15rem; letter-spacing: -0.02em; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--accent-soft); color: var(--ink); cursor: pointer; transition: background 0.2s var(--ease); }
.icon-button:hover { background: #e6e7ea; }

.cart-items { flex: 1; overflow-y: auto; padding: 12px 24px; }

.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); animation: rise 0.3s var(--ease) both; }
.cart-item-media { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); }
.cart-item-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: 0.92rem; letter-spacing: -0.01em; }
.cart-item-price { color: var(--ink-3); font-size: 0.84rem; }

.qty { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 3px; width: fit-content; }
.qty button { width: 26px; height: 26px; border: none; background: transparent; color: var(--ink); border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; display: grid; place-items: center; transition: background 0.15s var(--ease); }
.qty button:hover { background: #e6e7ea; }
.qty span { min-width: 22px; text-align: center; font-weight: 600; font-size: 0.9rem; }

.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.cart-item-total { font-weight: 700; font-size: 0.95rem; }
.remove-button { border: none; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 0.78rem; padding: 2px 0; transition: color 0.2s var(--ease); }
.remove-button:hover { color: #dc2626; }

.cart-empty { flex: 1; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink-3); text-align: center; padding: 40px; }
.cart-empty.show { display: flex; }
.cart-empty p { margin: 8px 0 0; font-weight: 600; color: var(--ink); font-size: 1.05rem; }
.cart-empty span { font-size: 0.88rem; }

.cart-foot { border-top: 1px solid var(--line); padding: 20px 24px calc(20px + env(safe-area-inset-bottom)); }
.cart-total-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 1rem; }
.cart-total-row strong { font-size: 1.35rem; letter-spacing: -0.02em; }
.cart-total-note { color: var(--ink-3); font-size: 0.78rem; margin: 4px 0 16px; }

.checkout-button {
  width: 100%; border: none; cursor: pointer; font-weight: 600; font-size: 1rem; color: #fff;
  background: var(--brand); padding: 16px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform 0.18s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
}
.checkout-button:hover:not(:disabled) { background: var(--brand-ink); transform: translateY(-1px); }
.checkout-button:active:not(:disabled) { transform: scale(0.99); }
.checkout-button:disabled { opacity: 0.5; cursor: not-allowed; }

.secure-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink-3); font-size: 0.8rem; margin: 12px 0 0; }
.checkout-error { color: #dc2626; font-size: 0.85rem; text-align: center; margin: 12px 0 0; }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.45); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   Result pages (success / cancel)
--------------------------------------------------------------------------- */
.result-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.result-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-md);
  max-width: 480px; width: 100%; padding: 44px 36px; text-align: center; animation: rise 0.5s var(--ease) both;
}
.result-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 22px; }
.result-icon.ok { background: #e7f8ee; color: #16a34a; }
.result-icon.warn { background: #fdecec; color: #dc2626; }
.result-icon.pending { background: var(--surface-2); color: var(--ink-3); }
.result-card h1 { font-size: 1.7rem; letter-spacing: -0.03em; margin: 0 0 10px; }
.result-card p { color: var(--ink-2); margin: 0 0 8px; }
.order-summary { text-align: left; background: var(--surface-2); border-radius: var(--radius-sm); padding: 16px 18px; margin: 24px 0; }
.order-summary .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.9rem; }
.order-summary .row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-weight: 700; font-size: 1rem; }
.result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.btn-primary, .btn-ghost { padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: transform 0.18s var(--ease); }
.btn-primary { background: var(--ink); color: #fff; border: none; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-primary:hover, .btn-ghost:hover { transform: translateY(-2px); }

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */
@media (max-width: 560px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .card-body { padding: 14px; }
  .add-button { padding: 9px 14px; font-size: 0.82rem; }
  .cart-drawer { width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto; }
}
