/* ============================================================
   Theo's Baby Shower — Baby Bear Theme
   Mobile-first. Minimum supported width: 375px (iPhone SE)
   ============================================================ */

/* ── Google Fonts ───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;800&family=Nunito:wght@400;600;700&display=swap');

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  --bg:        #FFF8F0;
  --gold:      #F4A827;
  --gold-dark: #D48B10;
  --brown:     #8B5E3C;
  --brown-light: #C4956A;
  --text:      #3D2B1F;
  --green:     #6BAA6A;
  --green-dark:#4E8A4E;
  --white:     #FFFFFF;
  --whatsapp:  #25D366;
  --whatsapp-dark: #1ebe59;
  --blue-accent: #89C4F4;
  --shadow-sm: 0 2px 8px rgba(61, 43, 31, 0.08);
  --shadow-md: 0 4px 16px rgba(61, 43, 31, 0.12);
  --shadow-lg: 0 8px 32px rgba(61, 43, 31, 0.16);
  --radius:    14px;
  --radius-sm: 8px;
}

/* ── Reset / Base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: url('assets/bg-pattern.svg');
  background-repeat: repeat;
  background-size: 80px 80px;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brown);
  text-decoration: underline;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Baloo 2', 'Segoe UI', cursive;
  line-height: 1.25;
  color: var(--brown);
}

h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 4vw, 1.9rem); font-weight: 600; }
h3 { font-size: clamp(1rem,   3vw, 1.2rem); font-weight: 600; }

/* ── Layout Wrappers ────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

main {
  padding: 24px 0 48px;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, var(--gold) 0%, #FBB740 60%, #F4A827 100%);
  color: var(--white);
  text-align: center;
  padding: 36px 20px 32px;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('assets/bg-pattern.svg');
  background-size: 60px 60px;
  opacity: 0.18;
  pointer-events: none;
}

.bear-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.25));
}

.site-header h1 {
  color: var(--white);
  text-shadow: 0 2px 6px rgba(61, 43, 31, 0.3);
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--white);
  opacity: 0.95;
  max-width: 500px;
  margin: 0 auto;
  font-weight: 600;
}

/* Baby blue ribbon accent line */
.header-ribbon {
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, transparent, var(--blue-accent), transparent);
  margin-top: 20px;
  opacity: 0.75;
}

/* ── Page heading (non-header pages) ───────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--gold) 0%, #FBB740 60%, #F4A827 100%);
  text-align: center;
  padding: 28px 20px 24px;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('assets/bg-pattern.svg');
  background-size: 60px 60px;
  opacity: 0.15;
  pointer-events: none;
}

.page-header .bear-logo {
  width: 60px;
  height: 60px;
}

.page-header h1 {
  color: var(--white);
  text-shadow: 0 2px 5px rgba(61, 43, 31, 0.3);
  margin-bottom: 8px;
}

.page-header .subtitle {
  font-size: 1rem;
  color: var(--white);
}

/* ── Section / Card ─────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px 20px;
  margin-bottom: 24px;
}

section {
  margin-bottom: 8px;
}

/* Paw print section divider */
.paw-divider {
  text-align: center;
  font-size: 1.4rem;
  color: var(--gold);
  opacity: 0.7;
  margin: 8px 0 20px;
  letter-spacing: 0.4em;
  user-select: none;
}

/* ── Event Details ──────────────────────────────────────────── */
.event-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.event-detail-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
}

.event-detail-item .label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brown-light);
  margin-bottom: 3px;
}

.event-detail-item .value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.event-detail-item.full-width {
  grid-column: 1 / -1;
}

/* ── Map Section ────────────────────────────────────────────── */
.map-wrapper {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.map-wrapper iframe {
  width: 100%;
  height: 250px;
  border: 0;
  display: block;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  min-height: 48px;
  min-width: 48px;
  padding: 12px 24px;
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gold);
  color: var(--white);
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.btn-primary:hover { background: var(--gold-dark); box-shadow: var(--shadow-md); }

.btn-directions {
  background: var(--brown);
  color: var(--white);
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.btn-directions:hover { background: #6a4628; box-shadow: var(--shadow-md); }

/* WhatsApp buttons */
.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--whatsapp);
  color: var(--white);
  border-radius: 50px;
  padding: 14px 24px;
  min-height: 52px;
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 12px;
}

.btn-whatsapp:hover { background: var(--whatsapp-dark); box-shadow: var(--shadow-md); color: var(--white); }
.btn-whatsapp:active { transform: scale(0.97); }

/* ── Contact Section ────────────────────────────────────────── */
.contact-intro {
  font-size: 0.95rem;
  color: var(--brown-light);
  margin-bottom: 16px;
  font-weight: 600;
}

/* ── RSVP Section ───────────────────────────────────────────── */
.rsvp-counter-box {
  background: linear-gradient(135deg, var(--gold) 0%, #FBB740 100%);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.rsvp-counter-box .counter-label {
  font-size: 0.9rem;
  color: var(--white);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.rsvp-counter-box .counter-number {
  font-family: 'Baloo 2', cursive;
  font-size: 3rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  text-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.rsvp-counter-box .counter-sublabel {
  font-size: 0.85rem;
  color: var(--white);
  opacity: 0.85;
  margin-top: 2px;
}

.rsvp-form-wrap {
  margin-top: 4px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--brown);
}

.form-group input[type="text"],
.form-group input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 2px solid #E8D5C4;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s;
  min-height: 48px;
}

.form-group input:focus {
  border-color: var(--gold);
}

.rsvp-error {
  color: #C0392B;
  font-size: 0.875rem;
  font-weight: 700;
  min-height: 20px;
  margin-top: 4px;
}

.btn-rsvp {
  background: var(--brown);
  color: var(--white);
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  padding: 14px 24px;
  min-height: 52px;
  width: 100%;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-rsvp:hover:not(:disabled) { background: #6a4628; box-shadow: var(--shadow-md); }
.btn-rsvp:active:not(:disabled) { transform: scale(0.97); }
.btn-rsvp:disabled { opacity: 0.65; cursor: not-allowed; }

.rsvp-thanks {
  background: #EBF7EB;
  border: 2px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-weight: 700;
  color: #2E6B2E;
  text-align: center;
  font-size: 1.05rem;
}

/* ── Wishlist Link Banner ────────────────────────────────────── */
.wishlist-banner {
  text-align: center;
  padding: 4px 0;
}

.btn-wishlist-link {
  display: inline-block;
  font-family: 'Baloo 2', cursive;
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), #FBB740);
  color: var(--white);
  text-decoration: none;
  border-radius: 50px;
  padding: 16px 32px;
  min-height: 56px;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  width: 100%;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.btn-wishlist-link:hover {
  filter: brightness(1.06);
  box-shadow: var(--shadow-lg);
  color: var(--white);
}
.btn-wishlist-link:active { transform: scale(0.97); }

/* ── Back link ──────────────────────────────────────────────── */
.back-link-wrap {
  padding: 14px 16px 0;
}

.back-link {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--brown);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 4px 0;
}

.back-link:hover { text-decoration: underline; }

/* ── Wishlist Grid ───────────────────────────────────────────── */
.wishlist-intro {
  text-align: center;
  margin-bottom: 24px;
}

.wishlist-intro h1 {
  margin-bottom: 8px;
}

.wishlist-intro p {
  font-size: 1rem;
  color: var(--brown-light);
  font-weight: 600;
}

#wishlist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* ── Wish Card ───────────────────────────────────────────────── */
.wish-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.wish-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.wish-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg);
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--text);
}

.card-body .desc {
  font-size: 0.9rem;
  color: #7A6055;
  margin-bottom: 8px;
  flex: 1;
}

.card-body .price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 10px;
}

.btn-view {
  display: inline-block;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brown);
  text-decoration: none;
  border: 2px solid var(--brown);
  border-radius: 50px;
  padding: 8px 18px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
  margin-bottom: 10px;
}

.btn-view:hover { background: var(--brown); color: var(--white); }

.card-actions {
  margin-top: auto;
}

/* Claim button */
.btn-claim {
  width: 100%;
  min-height: 48px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  padding: 12px 20px;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn-claim:hover:not(:disabled) { background: var(--green-dark); }
.btn-claim:active:not(:disabled) { transform: scale(0.97); }
.btn-claim:disabled { opacity: 0.6; cursor: not-allowed; }

/* Purchased card state */
.wish-card.purchased {
  border: 2px solid var(--green);
}

.wish-card.purchased img {
  filter: brightness(0.92) saturate(0.8);
}

.claimed-badge {
  background: var(--green);
  color: var(--white);
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

/* Release button */
.btn-release {
  width: 100%;
  min-height: 44px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  background: transparent;
  color: var(--brown-light);
  border: 2px solid #E8D5C4;
  border-radius: 50px;
  cursor: pointer;
  padding: 8px 16px;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-release:hover:not(:disabled) {
  border-color: var(--brown-light);
  color: var(--brown);
  background: var(--bg);
}

.btn-release:disabled { opacity: 0.5; cursor: not-allowed; }

/* Two-step confirm state */
.btn-release-confirm {
  background: #FFF3CD;
  border-color: #F4A827;
  color: #7a4f00;
}

/* API error / loading fallback */
.api-error {
  grid-column: 1 / -1;
  text-align: center;
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 24px;
  box-shadow: var(--shadow-sm);
  font-size: 1rem;
  color: var(--brown-light);
  font-weight: 600;
}

.api-error a {
  color: var(--green);
  font-weight: 700;
}

.empty-list {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--brown-light);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 32px;
}

/* ── Bottom-Sheet Claim Modal ────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-sheet {
  background: var(--white);
  width: 100%;
  max-width: 100%;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: #D9C9BC;
  border-radius: 99px;
  margin: 0 auto 18px;
}

.modal-title {
  font-family: 'Baloo 2', cursive;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--brown-light);
  margin-bottom: 16px;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 2px solid #E8D5C4;
  border-radius: var(--radius-sm);
  outline: none;
  margin-bottom: 16px;
  min-height: 48px;
  transition: border-color 0.2s;
}

.modal-input:focus { border-color: var(--gold); }

.modal-actions {
  display: flex;
  gap: 12px;
}

.btn-modal-cancel {
  flex: 1;
  min-height: 48px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--brown-light);
  border: 2px solid #E8D5C4;
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-modal-cancel:hover { background: #F0E4D8; }

.btn-modal-confirm {
  flex: 2;
  min-height: 48px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-modal-confirm:hover { background: var(--green-dark); }

/* ── Toast Notification ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  white-space: nowrap;
}

.toast-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--brown);
  color: var(--white);
  text-align: center;
  padding: 20px 16px;
  font-size: 0.9rem;
  opacity: 0.95;
}

.site-footer a {
  color: var(--gold);
}

/* ── Nav link bar ───────────────────────────────────────────── */
.nav-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--brown);
}

.nav-bar a {
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-bar a:hover { background: rgba(255,255,255,0.15); }
.nav-bar a.active { background: var(--gold); color: var(--white); }

/* ── Spinner (for in-flight buttons) ────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive Breakpoints ─────────────────────────────────── */

/* 600px — 2-column wishlist grid */
@media (min-width: 600px) {
  #wishlist-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-sheet {
    max-width: 480px;
    border-radius: 16px;
    margin-bottom: 40px;
  }

  .map-wrapper iframe {
    height: 300px;
  }
}

/* 900px — 3-column wishlist grid, wider layouts */
@media (min-width: 900px) {
  #wishlist-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .map-wrapper iframe {
    height: 350px;
  }

  .container {
    padding: 0 24px;
  }

  .event-details-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .event-detail-item.full-width {
    grid-column: auto;
  }
}
