/* ===== Ben Shop - Fastlane Demo Styles ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-light: #dbeafe;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
}

/* ===== Layout ===== */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ===== Header ===== */
.store-header {
  text-align: center;
  margin-bottom: 32px;
}

.store-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0;
  color: var(--brand);
}

.store-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== Product Grid ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.product-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-light);
}

.product-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}

.product-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.4;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
}

.product-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ===== Checkout Container ===== */
.checkout-container {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 800px) {
  .checkout-container {
    grid-template-columns: 1fr;
  }
}

/* ===== Form Panel ===== */
.form-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.form-panel h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--text);
}

/* ===== Order Summary Panel ===== */
.order-summary {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 24px;
}

.order-summary h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.order-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-item-dot {
  font-size: 18px;
}

.order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--text);
  font-size: 16px;
  font-weight: 700;
}

.order-total-amount {
  color: var(--brand);
  font-size: 22px;
}

/* ===== Form Elements ===== */
form { margin: 0; }

fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group {
  position: relative;
}

input:not([type='checkbox']) {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 12px 6px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--card-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:not([type='checkbox'])::placeholder { color: transparent; }

input:not([type='checkbox']):focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.label {
  position: absolute;
  left: 12px;
  top: 14px;
  font-size: 15px;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.15s ease;
  background: var(--card-bg);
  padding: 0 4px;
}

input:focus + .label,
input:not(:placeholder-shown) + .label {
  top: 4px;
  font-size: 11px;
  color: var(--brand);
}

input.input-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px #fef2f2;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.checkbox-row label {
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== Sections ===== */
.section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-step {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.summary {
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 0;
  white-space: pre-line;
  line-height: 1.6;
}

.section.pinned .summary { display: none; }
.section.pinned fieldset { display: block; }
.section.pinned .section-submit { display: none; }

.section.active .summary { display: none; }
.section:not(.active):not(.pinned) fieldset { display: none; }
.section:not(.active):not(.pinned) .section-submit { display: none; }

.edit-button {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.edit-button:hover { background: var(--brand-light); }

/* ===== Buttons ===== */
.btn-primary {
  width: 100%;
  height: 48px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover:enabled { background: var(--brand-dark); }
.btn-primary:active:enabled { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-checkout {
  margin-top: 24px;
  height: 52px;
  font-size: 17px;
  border-radius: 100px;
  background: #0f172a;
}

.btn-checkout:hover:enabled { background: #1e293b; }

/* ===== Watermark ===== */
#watermark-container {
  min-height: 24px;
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

/* ===== Payment Component ===== */
#payment-component {
  min-height: 120px;
}

/* ===== Success Overlay ===== */
.success-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.success-overlay.show { display: flex; }

.success-modal {
  background: white;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.success-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.success-modal h2 {
  font-size: 22px;
  margin: 0 0 8px;
}

.success-modal p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.5;
}
