/* ============================================================
   VARIABLES & RESET
   ============================================================ */
:root {
  --bg:             #faf3ec;
  --surface:        #fffaf5;
  --surface-alt:    #f5ede2;

  --rose:           #d4a09a;
  --rose-hover:     #bd8880;
  --rose-light:     #f3d9d2;
  --rose-badge:     rgba(212, 160, 154, 0.92);

  --green:          #4e6a5b;
  --green-light:    #dde8e2;

  --brown:          #5c3d2e;
  --brown-light:    #8b6b5a;

  --text:           #3d2f2a;
  --text-light:     #7a6258;
  --border:         #e8d8c8;
  --reserved-tint:  #b8aca4;

  --success-bg:     #dde8e2;
  --success-fg:     #3b5b4e;
  --danger-bg:      #f3d9d2;
  --danger-fg:      #c05050;
  --warn-bg:        #fef4e0;
  --warn-fg:        #a07020;

  --shadow-sm:  0 2px 8px rgba(92,61,46,.05), 0 4px 18px rgba(92,61,46,.07);
  --shadow-md:  0 4px 14px rgba(92,61,46,.08), 0 10px 36px rgba(92,61,46,.11);
  --shadow-lg:  0 8px 28px rgba(92,61,46,.10), 0 18px 60px rgba(92,61,46,.15);

  --r-card:   16px;
  --r-modal:  22px;
  --r-btn:    50px;
  --r-input:  10px;

  --font-serif:  'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-sans:   'Nunito', system-ui, sans-serif;

  --gradient-btn:       linear-gradient(135deg, #d4a09a 0%, #4e6a5b 100%);
  --gradient-btn-hover: linear-gradient(135deg, #bd8880 0%, #3a5244 100%);

  --ease: 0.22s ease;
}

/* === Dark mode === */
html[data-theme="dark"] {
  --bg:          #221a1d;
  --surface:     #2d2327;
  --surface-alt: #3a2e30;

  --rose:        #d4a09a;
  --rose-hover:  #bd8880;
  --rose-light:  #3d2a28;
  --rose-badge:  rgba(212, 160, 154, 0.88);

  --green:       #6b9b85;
  --green-light: #1e2d24;

  --brown:       #c0a08a;
  --brown-light: #8b6b5a;

  --text:        #f4e9e3;
  --text-light:  #a0897f;
  --border:      #4a3833;

  --success-bg:  #1d2f24;
  --success-fg:  #6abf80;
  --danger-bg:   #3a2222;
  --danger-fg:   #e08888;
  --warn-bg:     #352910;
  --warn-fg:     #d4a050;

  --shadow-sm:  0 2px 12px rgba(0,0,0,.30);
  --shadow-md:  0 5px 28px rgba(0,0,0,.42);
  --shadow-lg:  0 10px 52px rgba(0,0,0,.52);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(ellipse 80% 40% at 0% 0%,   #f7e3d0 0%, transparent 60%),
    radial-gradient(ellipse 60% 35% at 100% 0%,  #ead8e2 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 50% 110%, #dfe6d4 0%, transparent 60%),
    #f5ece2;
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .35s ease, color .35s ease;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] body {
  background: var(--bg);
}

img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: var(--font-sans); }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }


/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: relative;
  z-index: 100;
  border-bottom: none;
}
.site-header.scrolled {
  position: sticky;
  top: 0;
}

/* === Hero floral === */
.hero-floral {
  position: relative;
  background: transparent;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 48px 20px 56px;
  transition: min-height .3s ease, padding .3s ease;
}

html[data-theme="dark"] .hero-floral { background: var(--bg); }
html[data-theme="dark"] .hero-flora-svg { opacity: .25; }

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-photo-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,.9);
  box-shadow: 0 4px 20px rgba(92,61,46,.18);
  margin-bottom: 14px;
  flex-shrink: 0;
  background: #c8a882;
  background-size: cover;
  background-position: center;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(30px, 8vw, 40px);
  color: #4a3020;
  font-weight: 400;
  letter-spacing: .5px;
  line-height: 1.1;
  margin: 0;
}
html[data-theme="dark"] .hero-title { color: var(--text); }

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 15px;
  color: #9a7060;
  margin: 10px 0 0;
  font-style: italic;
  font-weight: 400;
}
html[data-theme="dark"] .hero-subtitle { color: var(--text-light); }

.hero-divider {
  width: 40px;
  height: 1.5px;
  background: #d4b090;
  margin: 12px auto 0;
  opacity: .7;
}

.hero-byline {
  font-size: 11px;
  color: #c4a090;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin: 8px 0 0;
  font-weight: 600;
}
html[data-theme="dark"] .hero-byline { color: var(--text-light); }

/* === scrolled compact === */
.site-header.scrolled .hero-floral {
  min-height: auto;
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header.scrolled .hero-photo-circle,
.site-header.scrolled .hero-subtitle,
.site-header.scrolled .hero-divider,
.site-header.scrolled .hero-byline { display: none; }
.site-header.scrolled .hero-title { font-size: 1.21rem; }
.site-header.scrolled .hero-flora-svg { opacity: .15; }
.site-header.scrolled .menu-toggle {
  top: 50%;
  transform: translateY(-50%);
}

/* === Menu burger === */
.menu-toggle {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ease);
  opacity: .75;
  z-index: 102;
  backdrop-filter: blur(8px);
}
.menu-toggle:hover {
  opacity: 1;
  background: var(--surface);
  border-color: var(--rose);
  color: var(--rose);
  box-shadow: var(--shadow-sm);
}

/* Overlay fond assombri */
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(50,30,25,.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.menu-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.header-menu {
  position: fixed;
  top: 1rem;
  right: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  z-index: 101;
  opacity: 0;
  transform: translateY(-8px) scale(.95);
  pointer-events: none;
  visibility: hidden;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  min-width: 230px;
}
.header-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1.1rem;
  background: none;
  border: none;
  border-radius: .75rem;
  font-family: var(--font-sans);
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease);
  text-align: left;
}
.menu-item:hover {
  background: var(--rose-light);
  color: var(--rose-hover);
}

.menu-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--text-light);
}
.menu-item:hover .menu-icon { color: var(--rose-hover); }

.menu-item-text {
  display: flex;
  flex-direction: column;
}
.menu-item-sub {
  font-size: .75rem;
  font-weight: 400;
  color: var(--text-light);
  margin-top: 1px;
}

/* Toggle switch */
.toggle-track {
  margin-left: auto;
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background .25s ease;
  flex-shrink: 0;
}
.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  transition: transform .25s ease;
}
html[data-theme="dark"] .toggle-track {
  background: var(--rose);
}
html[data-theme="dark"] .toggle-knob {
  transform: translateX(18px);
}


/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}
main { flex: 1; }

.guest-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.section-intro {
  text-align: center;
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.8;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem 1rem 0 0;
  padding: 1.2rem 1.4rem 1rem;
  margin-bottom: 0;
  box-shadow: none;
}

/* Intro + progress : carte wrapper */
.intro-progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.intro-progress-card .section-intro {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 1.2rem 1.4rem .9rem;
  margin: 0;
  box-shadow: none;
}

.intro-progress-card .progress-section {
  background: var(--surface-alt);
  border: none;
  border-radius: .75rem;
  box-shadow: none;
  margin: 0 1rem 1.2rem;
  padding: .9rem 1.2rem 1rem;
}


/* ============================================================
   PROGRESS SECTION
   ============================================================ */
.progress-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 1rem 1.4rem 1.25rem;
  margin: 0 0 1.25rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
html[data-theme="dark"] .progress-section { background: var(--surface-alt); }

.progress-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  color: #9a7060;
  margin-bottom: .75rem;
}
html[data-theme="dark"] .progress-text { color: var(--text-light); }

.progress-bar {
  height: 10px;
  width: 100%;
  background: var(--rose-light);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--rose) 0%, var(--rose-hover) 100%);
  border-radius: inherit;
  transition: width 1s ease-in-out;
}


/* ============================================================
   SEARCH & FILTER CONTROLS
   ============================================================ */
.search-controls {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.search-controls-row {
  display: flex;
  gap: .75rem;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: .6rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-input);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .95rem;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.search-input:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(212,160,154,.15);
}
.search-input::placeholder { color: var(--text-light); }

.sort-select {
  padding: .6rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-input);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .9rem;
  cursor: pointer;
  transition: border-color var(--ease);
  width: 138px;
}
.sort-select:focus { outline: none; border-color: var(--rose); }


/* ============================================================
   CATEGORY TABS â€” single scrollable row
   ============================================================ */
.category-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: nowrap;            /* <-- single line */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;        /* Firefox â€” hide scrollbar */
  padding-bottom: 2px;
  margin-bottom: 1.8rem;
  /* subtle fade on right to suggest more items */
  mask-image: linear-gradient(90deg, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, black 85%, transparent 100%);
}
.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
  padding: .5rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-btn);
  background: var(--surface);
  color: var(--text-light);
  font-family: var(--font-sans);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.category-tab:hover { border-color: var(--rose); color: var(--rose); }
.category-tab.active {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
  box-shadow: 0 3px 10px rgba(212,160,154,.4);
}


/* ============================================================
   GIFTS GRID
   ============================================================ */
.category-section { margin-bottom: 2.5rem; }

.category-heading {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .8rem;
  padding-bottom: .45rem;
  border-bottom: none;
  background-image: linear-gradient(90deg, var(--border) 0%, transparent 60%);
  background-size: 100% 1px;
  background-position: bottom;
  background-repeat: no-repeat;
  line-height: 1.1;
}

.gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.4rem;
}

.empty-state {
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  padding: 4rem 2rem;
  grid-column: 1 / -1;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}


/* ============================================================
   GIFT CARD
   ============================================================ */
.gift-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease);
  border: 1px solid transparent;
}
.gift-card:not(.is-reserved):hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--rose-light);
}
.gift-card.is-reserved {
  cursor: pointer;
  opacity: .55;
  filter: grayscale(.5);
}
#btnReserve:disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Image */
.card-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--rose-light);
  margin: .5rem .5rem 0;
  border-radius: 12px;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.gift-card:not(.is-reserved):hover .card-img-wrap img {
  transform: scale(1.05);
}

/* Reserved badge */
.reserved-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,.92);
  color: var(--rose-hover);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Card body */
.card-body { padding: 1rem 1.15rem 1.25rem; }

.card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: .35rem;
}

.card-desc {
  font-size: .72rem;
  color: var(--text-light);
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-price {
  display: inline-block;
  margin-top: .55rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--rose-hover);
  letter-spacing: -.01em;
}


/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .65rem 1.6rem;
  border-radius: var(--r-btn);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .02em;
  border: none;
  transition: background var(--ease), color var(--ease),
              transform var(--ease), box-shadow var(--ease);
  white-space: nowrap;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--gradient-btn);
  color: #fff;
}
.btn-primary:hover {
  background: var(--gradient-btn-hover);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(122,100,85,.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  padding: .42rem 1rem;
  border-radius: var(--r-btn);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--rose);
  border: 1.5px solid var(--rose);
  background: transparent;
  transition: background var(--ease), color var(--ease);
  white-space: nowrap;
  font-family: var(--font-sans);
}
.btn-ghost-sm:hover { background: var(--rose-light); }

.btn-block {
  width: 100%;
  margin-top: 1.1rem;
  padding: .88rem;
  font-size: .97rem;
}

.btn-sm {
  padding: .38rem .9rem;
  font-size: .8rem;
  border-radius: var(--r-btn);
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background var(--ease), color var(--ease);
  white-space: nowrap;
}
.btn-edit   { background: #dbeaf5; color: #4070a0; }
.btn-edit:hover   { background: #c8dcea; }
.btn-reset  { background: var(--warn-bg); color: var(--warn-fg); }
.btn-reset:hover  { background: #fde8b0; }
.btn-delete { background: var(--danger-bg); color: var(--danger-fg); }
.btn-delete:hover { background: #f5cac8; }


/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(50,30,25,.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

/* Bottom sheet variant */
.modal-overlay--bottom {
  align-items: flex-end;
  padding: 0;
}
.modal--sheet {
  border-radius: 22px 22px 0 0;
  max-width: 100%;
  max-height: 85vh;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.32,.72,.24,1), opacity .25s ease;
}
.modal-overlay--bottom.open .modal--sheet {
  transform: translateY(0);
}

.detail-category {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--rose);
  margin-bottom: .3rem;
}
.detail-short-desc {
  font-size: .88rem;
  color: var(--text-light);
  margin-bottom: .5rem;
}

.modal--sheet-sm {
  max-height: 90vh;
}

/* Confirm modal header */
.confirm-header {
  display: flex;
  gap: .9rem;
  align-items: center;
  margin-bottom: 1.2rem;
}
.confirm-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--surface-alt);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: .9rem;
  color: var(--text-light);
  overflow: hidden;
}
.confirm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.confirm-gift-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}
.confirm-gift-price {
  font-family: var(--font-serif);
  font-size: .88rem;
  color: var(--rose);
  font-style: italic;
}

/* Form labels */
.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 1rem;
  margin-bottom: .3rem;
}
.form-label-hint {
  font-weight: 400;
  color: var(--text-light);
}

.confirm-success-overlay {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border-radius: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  z-index: 10;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--surface);
  border-radius: var(--r-modal);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(18px) scale(.98);
  transition: transform .25s cubic-bezier(.34,1.4,.64,1), opacity .22s ease;
  opacity: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); opacity: 1; }

.modal-sm { max-width: 420px; }
.modal-lg { max-width: 640px; }

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-light);
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease), color var(--ease);
}
.modal-close-btn:hover { background: var(--border); color: var(--text); }

.modal-img-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--r-modal) var(--r-modal) 0 0;
  background: var(--rose-light);
  position: relative;
}
.modal-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.modal-img-wrap.is-reserved img {
  opacity: .55;
  filter: grayscale(.5);
}
.modal-img-wrap .reserved-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.modal-body { padding: 1.6rem 1.7rem 1.8rem; }
.modal-body-centered { text-align: center; }

.modal-gift-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: .7rem;
}

.modal-gift-desc {
  color: var(--text-light);
  font-size: .95rem;
  line-height: 1.75;
  margin-bottom: .5rem;
}

.modal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: .9rem 0;
  margin: 1rem 0 0;
}

.price-badge {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--rose-hover);
  letter-spacing: -.01em;
}

.modal-icon {
  font-size: 2.4rem;
  color: var(--rose);
  margin-bottom: .7rem;
  animation: gentle-pulse 3s ease-in-out infinite;
}

@keyframes gentle-pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.modal-subtitle {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .5rem;
}

.modal-body p {
  color: var(--text-light);
  font-size: .93rem;
  margin-bottom: 1rem;
  line-height: 1.65;
}


/* ============================================================
   FORM
   ============================================================ */
.form-input {
  display: block;
  width: 100%;
  padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-input);
  font-family: var(--font-sans);
  font-size: .95rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  margin-top: .8rem;
}
.form-input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(212,160,154,.15);
}
.form-input.error {
  border-color: var(--danger-fg);
  box-shadow: 0 0 0 3px rgba(192,80,80,.1);
}

.form-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.form-field { display: flex; flex-direction: column; }
.form-field label {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .02em;
  margin-top: 1rem;
}
.form-field .form-input { margin-top: .35rem; }
.full-width { grid-column: 1 / -1; }
.required { color: var(--rose); }

.input-with-btn { display: flex; gap: .5rem; margin-top: .35rem; }
.input-with-btn .form-input { flex: 1; margin-top: 0; }
.input-with-btn .btn-ghost-sm { white-space: nowrap; flex-shrink: 0; }

.field-hint {
  font-size: .82rem;
  color: var(--text-light);
  margin-top: .3rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.fetch-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  border-radius: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1rem;
}
.fetch-overlay.hidden { display: none; }

.fetch-overlay-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.fetch-preview-img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: .5rem;
  border: 1px solid var(--border);
}

.settings-upload-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.settings-upload-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.settings-upload-preview {
  min-width: 100px;
  min-height: 60px;
}
.settings-upload-preview img {
  max-width: 160px;
  max-height: 120px;
  object-fit: contain;
  border-radius: .5rem;
  border: 1px solid var(--border);
}
@media (max-width: 600px) {
  .settings-upload-row { flex-direction: column; }
}

.field-error { color: var(--danger-fg); font-size: .83rem; margin-top: .4rem; }

.btn-row {
  display: flex;
  justify-content: flex-end;
  gap: .7rem;
  margin-top: 1.4rem;
}


/* ============================================================
   ADMIN VIEW
   ============================================================ */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.2rem;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--border);
}

.admin-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--text);
}

.admin-topbar-actions { display: flex; gap: .7rem; flex-wrap: wrap; }

.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.admin-tab {
  padding: .6rem 1.4rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font-sans);
  font-size: .92rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all .22s ease;
}
.admin-tab:hover { color: var(--rose); }
.admin-tab.active { color: var(--rose); border-bottom-color: var(--rose); font-weight: 700; }
.admin-tab-content.hidden { display: none; }

.search-bar { display: flex; gap: .6rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.search-bar .form-input { flex: 1; min-width: 180px; }
.search-bar select.form-input { flex: 0 0 auto; width: auto; }

.suggestion-category { margin-bottom: 1.5rem; }
.suggestion-heading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .6rem;
}
.suggestion-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.suggestion-chip {
  padding: .35rem .85rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  font-size: .85rem;
  color: var(--text);
  cursor: pointer;
  transition: all .2s ease;
  font-family: var(--font-sans);
}
.suggestion-chip:hover { background: var(--rose-light); border-color: var(--rose); color: var(--rose-hover); }

.search-results-heading { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 500; color: var(--text); margin-bottom: .8rem; }
.search-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.search-link-card {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .6rem;
  color: var(--text);
  transition: all .22s ease;
  box-shadow: var(--shadow-sm);
}
.search-link-card:hover { border-color: var(--rose); transform: translateY(-1px); }
.search-link-icon { font-size: 1.4rem; }
.search-link-name { flex: 1; font-weight: 600; font-size: .9rem; }
.search-link-arrow { color: var(--rose); font-size: 1.1rem; }
.search-hint { font-size: .85rem; color: var(--text-light); font-style: italic; margin-top: .5rem; }

.settings-heading { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 500; color: var(--text); margin-bottom: .3rem; }
.settings-desc { font-size: .88rem; color: var(--text-light); margin-bottom: 1rem; }
.settings-subheading { font-size: .9rem; font-weight: 700; color: var(--text); margin: 0 0 .5rem; }
.settings-divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.smtp-fields { margin-top: .5rem; }

.admin-list { display: flex; flex-direction: column; gap: .9rem; }

.admin-item {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: auto 84px 1fr auto;
  gap: 1.1rem;
  align-items: center;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--border);
  transition: box-shadow var(--ease);
}
.admin-item:hover { box-shadow: var(--shadow-md); }
.admin-item.is-dragging { opacity: .4; }
.admin-item.drag-over   { border-top: 2px solid var(--rose); }

.admin-category-heading {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  padding-bottom: .4rem;
  border-bottom: 1.5px solid var(--rose-light);
  margin: 1.5rem 0 .75rem;
}
.admin-category-heading:first-child { margin-top: 0; }

.drag-handle { color: var(--text-light); font-size: 1.2rem; cursor: grab; user-select: none; }
.drag-handle:active { cursor: grabbing; }

.admin-item-thumb { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--rose-light); flex-shrink: 0; }
.admin-item-thumb img { width: 100%; height: 100%; object-fit: cover; }

.admin-item-info h4 { font-family: var(--font-serif); font-size: 1rem; font-weight: 500; color: var(--text); margin-bottom: .2rem; line-height: 1.3; }
.admin-item-info .admin-desc { font-size: .83rem; color: var(--text-light); margin-bottom: .35rem; }
.admin-item-info .admin-price { font-family: var(--font-serif); font-size: 1rem; color: var(--rose-hover); font-weight: 500; display: block; margin-bottom: .3rem; }
.admin-message { font-size: .82rem; font-style: italic; color: var(--text-light); margin-top: .3rem; padding: .4rem .6rem; background: var(--surface-alt); border-left: 3px solid var(--rose); border-radius: 0 .3rem .3rem 0; }

.status-pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.status-available { background: var(--success-bg); color: var(--success-fg); }
.status-reserved  { background: var(--rose-light);  color: #9a5050; }

.admin-item-actions { display: flex; flex-direction: column; gap: .45rem; align-items: flex-end; flex-shrink: 0; }

/* Checklist */



/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: var(--text);
  color: #fff;
  padding: .75rem 1.8rem;
  border-radius: 50px;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 4px 24px rgba(0,0,0,.22);
  z-index: 2000;
  opacity: 0;
  transition: transform .38s cubic-bezier(.34,1.5,.64,1), opacity .3s ease;
  max-width: calc(100vw - 2rem);
  text-align: center;
  pointer-events: none;
  font-family: var(--font-sans);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  text-align: center;
  padding: .9rem 1rem;
  background: #3b5b4e;
  color: rgba(255,255,255,.75);
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .05em;
  font-family: var(--font-sans);
}
html[data-theme="dark"] .site-footer { background: #2e4a3e; color: rgba(255,255,255,.6); }


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 680px) {
  .container { padding: 1rem .75rem; }
  .guest-panel { padding: 0; }

  .gifts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .9rem;
  }
  .card-title  { font-size: .95rem; }
  .card-desc   { font-size: .82rem; }

  .admin-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .admin-category-heading { grid-column: 1 / -1; }
  .admin-item { display: flex; flex-direction: column; align-items: stretch; gap: .6rem; padding: .75rem; }
  .drag-handle { display: none; }
  .admin-item-thumb { width: 100%; height: 110px; border-radius: 8px; }
  .admin-item-actions { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; gap: .35rem; }
  .admin-topbar { flex-direction: column; align-items: flex-start; }
  .modal-meta { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .btn-row { flex-direction: column; }
  .btn-row .btn, .btn-row .btn-ghost { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: 1; }
  .bg-pair-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .gifts-grid { grid-template-columns: repeat(2, 1fr); }
}