/*
 * St. Dupont Gift Registry — Frontend & Admin Styles
 * Premium boutique aesthetic: warm ivory, charcoal, gold accents.
 * ──────────────────────────────────────────────────────────────
 * Customise these CSS variables to match your exact brand colours:
 */
:root {
  --sgr-bg:             #f9f7f4;
  --sgr-bg-card:        #ffffff;
  --sgr-border:         #e8e4dd;
  --sgr-border-focus:   #c9b99a;
  --sgr-text:           #1a1a1a;
  --sgr-text-muted:     #6b6b6b;
  --sgr-gold:           #c9b99a;
  --sgr-gold-dark:      #a89070;
  --sgr-charcoal:       #1a1a1a;
  --sgr-charcoal-hover: #333333;
  --sgr-success:        #065f46;
  --sgr-success-bg:     #d1fae5;
  --sgr-error:          #991b1b;
  --sgr-error-bg:       #fee2e2;
  --sgr-warning-bg:     #fef3c7;
  --sgr-warning:        #92400e;
  --sgr-radius:         4px;
  --sgr-radius-lg:      8px;
  --sgr-shadow:         0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --sgr-font-serif:     Georgia, 'Times New Roman', Times, serif;
  --sgr-font-sans:      'Helvetica Neue', Arial, Helvetica, sans-serif;
  --sgr-transition:     0.2s ease;
}

/* ── Reset / base ─────────────────────────────────────────────────────────── */
.sgr-wrap * { box-sizing: border-box; }

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.sgr-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  color: var(--sgr-text);
  font-family: var(--sgr-font-sans);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.sgr-hero {
  text-align: center;
  margin-bottom: 56px;
}
.sgr-hero__eyebrow {
  font-family: var(--sgr-font-sans);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--sgr-gold-dark);
  margin-bottom: 12px;
}
.sgr-hero__title {
  font-family: var(--sgr-font-serif);
  font-size: clamp(28px, 5vw, 40px);
  font-weight: normal;
  margin: 0 0 16px;
  letter-spacing: 1px;
  color: var(--sgr-charcoal);
}
.sgr-hero__subtitle {
  font-size: 15px;
  line-height: 1.65;
  color: var(--sgr-text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ── Form sections ────────────────────────────────────────────────────────── */
.sgr-section {
  background: var(--sgr-bg-card);
  border: 1px solid var(--sgr-border);
  border-radius: var(--sgr-radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--sgr-shadow);
}
.sgr-section__header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 28px;
}
.sgr-section__number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--sgr-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sgr-font-sans);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--sgr-gold-dark);
  margin-top: 2px;
}
.sgr-section__title {
  font-family: var(--sgr-font-serif);
  font-size: 20px;
  font-weight: normal;
  margin: 0 0 6px;
  color: var(--sgr-charcoal);
}
.sgr-section__desc {
  font-size: 13px;
  color: var(--sgr-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Fields ───────────────────────────────────────────────────────────────── */
.sgr-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 540px) {
  .sgr-field-row { grid-template-columns: 1fr; }
}
.sgr-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.sgr-field:last-child { margin-bottom: 0; }
.sgr-label {
  font-size: 12px;
  font-family: var(--sgr-font-sans);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--sgr-charcoal);
}
.sgr-required { color: var(--sgr-gold-dark); }
.sgr-input {
  font-family: var(--sgr-font-sans);
  font-size: 15px;
  color: var(--sgr-text);
  background: var(--sgr-bg);
  border: 1px solid var(--sgr-border);
  border-radius: var(--sgr-radius);
  padding: 11px 14px;
  transition: border-color var(--sgr-transition), box-shadow var(--sgr-transition);
  width: 100%;
  outline: none;
}
.sgr-input:focus {
  border-color: var(--sgr-border-focus);
  box-shadow: 0 0 0 3px rgba(201,185,154,.18);
}
.sgr-input::placeholder { color: #bbb; }
.sgr-input.sgr-input--error { border-color: var(--sgr-error); }

/* ── Product search ───────────────────────────────────────────────────────── */
.sgr-product-search-wrap { position: relative; }
.sgr-product-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--sgr-border);
  border-radius: var(--sgr-radius);
  box-shadow: var(--sgr-shadow);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
}
.sgr-product-option {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--sgr-border);
  transition: background var(--sgr-transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sgr-product-option:last-child { border-bottom: none; }
.sgr-product-option:hover { background: var(--sgr-bg); }
.sgr-product-option__name { font-weight: 500; color: var(--sgr-text); }
.sgr-product-option__price { font-size: 13px; color: var(--sgr-text-muted); }
.sgr-product-dropdown__loading { padding: 16px; text-align: center; color: var(--sgr-text-muted); font-size: 13px; }

.sgr-product-selected {
  margin-top: 8px;
  background: var(--sgr-bg);
  border: 1px solid var(--sgr-border);
  border-radius: var(--sgr-radius);
  padding: 12px 16px;
}
.sgr-product-selected__inner { display: flex; justify-content: space-between; align-items: center; }
.sgr-product-selected__info { display: flex; flex-direction: column; gap: 2px; }
.sgr-product-selected__name { font-size: 14px; font-weight: 600; color: var(--sgr-text); }
.sgr-product-selected__price { font-size: 13px; color: var(--sgr-text-muted); }
.sgr-product-selected__clear {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--sgr-text-muted);
  padding: 0 4px;
  transition: color var(--sgr-transition);
}
.sgr-product-selected__clear:hover { color: var(--sgr-error); }

/* ── Contributors ─────────────────────────────────────────────────────────── */
.sgr-contributors { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.sgr-contributor {
  background: var(--sgr-bg);
  border: 1px solid var(--sgr-border);
  border-radius: var(--sgr-radius);
  padding: 20px;
  position: relative;
  transition: border-color var(--sgr-transition);
}
.sgr-contributor:hover { border-color: var(--sgr-gold); }
.sgr-contributor__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.sgr-contributor__label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--sgr-gold-dark);
}
.sgr-contributor__remove {
  background: none;
  border: 1px solid var(--sgr-border);
  border-radius: var(--sgr-radius);
  font-size: 12px;
  color: var(--sgr-text-muted);
  cursor: pointer;
  padding: 4px 10px;
  font-family: var(--sgr-font-sans);
  transition: all var(--sgr-transition);
}
.sgr-contributor__remove:hover { border-color: var(--sgr-error); color: var(--sgr-error); }

/* ── Split preview ────────────────────────────────────────────────────────── */
.sgr-split-preview {
  background: linear-gradient(135deg, var(--sgr-charcoal) 0%, #2d2d2d 100%);
  border-radius: var(--sgr-radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.sgr-split-preview__inner { display: flex; justify-content: space-between; align-items: center; }
.sgr-split-preview__label { font-size: 13px; color: rgba(255,255,255,.7); font-family: var(--sgr-font-sans); }
.sgr-split-preview__amount { font-size: 22px; font-family: var(--sgr-font-serif); color: var(--sgr-gold); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.sgr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sgr-font-sans);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: var(--sgr-radius);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--sgr-transition);
  border: none;
  padding: 14px 28px;
}
.sgr-btn--primary {
  background: var(--sgr-charcoal);
  color: #fff;
}
.sgr-btn--primary:hover { background: var(--sgr-charcoal-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.sgr-btn--primary:active { transform: none; }
.sgr-btn--primary:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.sgr-btn--outline {
  background: transparent;
  border: 1px solid var(--sgr-border);
  color: var(--sgr-text-muted);
}
.sgr-btn--outline:hover { border-color: var(--sgr-gold); color: var(--sgr-charcoal); }

/* ── Submit ───────────────────────────────────────────────────────────────── */
.sgr-submit-wrap { text-align: center; margin-top: 32px; }
.sgr-submit-note { font-size: 12px; color: var(--sgr-text-muted); margin-top: 12px; }

/* ── Spinner ──────────────────────────────────────────────────────────────── */
@keyframes sgr-spin { to { transform: rotate(360deg); } }
.sgr-spinner {
  animation: sgr-spin 0.8s linear infinite;
  display: inline-block;
}

/* ── Notices ──────────────────────────────────────────────────────────────── */
.sgr-notice {
  border-radius: var(--sgr-radius);
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}
.sgr-notice--error { background: var(--sgr-error-bg); color: var(--sgr-error); border-left: 3px solid var(--sgr-error); }
.sgr-notice--success { background: var(--sgr-success-bg); color: var(--sgr-success); border-left: 3px solid var(--sgr-success); }
.sgr-notice--info { background: var(--sgr-warning-bg); color: var(--sgr-warning); border-left: 3px solid #d97706; }
.sgr-notice p { margin: 0; }

/* ── Success page ─────────────────────────────────────────────────────────── */
.sgr-success { text-align: center; padding-top: 60px; }
.sgr-success__icon { font-size: 56px; margin-bottom: 24px; }
.sgr-success__title { font-family: var(--sgr-font-serif); font-size: 32px; font-weight: normal; margin: 0 0 16px; }
.sgr-success__message { font-size: 15px; line-height: 1.65; color: var(--sgr-text-muted); max-width: 480px; margin: 0 auto 40px; }
.sgr-success__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
  text-align: left;
}
.sgr-success__step {
  background: var(--sgr-bg-card);
  border: 1px solid var(--sgr-border);
  border-radius: var(--sgr-radius-lg);
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.sgr-success__step-icon { font-size: 24px; line-height: 1; }
.sgr-success__step-text { display: flex; flex-direction: column; gap: 4px; }
.sgr-success__step-text strong { font-size: 14px; color: var(--sgr-text); }
.sgr-success__step-text span { font-size: 13px; color: var(--sgr-text-muted); line-height: 1.4; }

/* ── Contributor landing page ─────────────────────────────────────────────── */
.sgr-pay-landing { text-align: center; padding-top: 60px; }
.sgr-pay-landing__icon { font-size: 56px; margin-bottom: 24px; }
.sgr-pay-landing__title { font-family: var(--sgr-font-serif); font-size: 28px; font-weight: normal; margin: 0 0 12px; }
.sgr-pay-landing__for { font-size: 14px; color: var(--sgr-text-muted); margin: 0 0 6px; }
.sgr-pay-landing__product { font-size: 18px; font-family: var(--sgr-font-serif); margin: 0 0 16px; }
.sgr-pay-landing__amount { font-size: 22px; font-family: var(--sgr-font-serif); color: var(--sgr-charcoal); margin: 0 0 24px; }
.sgr-pay-landing__redirect { font-size: 13px; color: var(--sgr-text-muted); margin-bottom: 16px; }
.sgr-spinner-wrap { display: flex; justify-content: center; color: var(--sgr-gold); }

/* ── WC order-pay SGR customisations ──────────────────────────────────────── */
.sgr-pay-header {
  background: var(--sgr-bg);
  border: 1px solid var(--sgr-border);
  border-radius: var(--sgr-radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  text-align: center;
}
.sgr-pay-gift-icon { font-size: 40px; margin-bottom: 12px; }
.sgr-pay-gift-name { font-size: 15px; color: var(--sgr-text); margin: 0 0 6px; }
.sgr-pay-for { font-size: 13px; color: var(--sgr-text-muted); margin: 0 0 10px; }
.sgr-pay-amount { font-size: 24px; font-family: var(--sgr-font-serif); color: var(--sgr-charcoal); margin: 0; }
.sgr-pay-card-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sgr-text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sgr-pay-card-label::before,
.sgr-pay-card-label::after { content: ''; flex: 1; height: 1px; background: var(--sgr-border); }
.sgr-pay-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--sgr-text-muted);
  margin-top: 16px;
}

/* ── Thank-you page ───────────────────────────────────────────────────────── */
.sgr-thankyou { text-align: center; padding: 32px; background: var(--sgr-bg); border-radius: var(--sgr-radius-lg); border: 1px solid var(--sgr-border); margin-top: 24px; }
.sgr-thankyou__icon { font-size: 48px; margin-bottom: 16px; }
.sgr-thankyou__title { font-family: var(--sgr-font-serif); font-size: 26px; font-weight: normal; margin: 0 0 12px; }
.sgr-thankyou__product { font-size: 15px; margin: 0 0 6px; }
.sgr-thankyou__for { font-size: 14px; color: var(--sgr-text-muted); margin: 0 0 16px; }
.sgr-thankyou__progress { font-size: 14px; color: var(--sgr-text-muted); margin: 0 0 8px; }
.sgr-thankyou__funded { font-size: 15px; color: var(--sgr-success); font-weight: 600; margin: 0; }

/* ── Admin styles ─────────────────────────────────────────────────────────── */
.sgr-admin-table .sgr-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--sgr-font-sans);
}
.sgr-progress {
  height: 6px;
  background: #e8e4dd;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.sgr-progress-bar { height: 100%; background: var(--sgr-gold); border-radius: 3px; transition: width 0.4s ease; }
.sgr-admin-detail-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.sgr-admin-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px 24px;
}
.sgr-admin-card h3 { margin-top: 0; font-size: 16px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.sgr-admin-card--wide { grid-column: 1 / -1; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .sgr-section { padding: 20px 16px; }
  .sgr-section__header { gap: 14px; }
  .sgr-split-preview__amount { font-size: 18px; }
  .sgr-hero { margin-bottom: 32px; }
  .sgr-success__steps { grid-template-columns: 1fr; }
}
