/* ── Safari Theme CSS ──────────────────────────────────────────────────────── */

/* Palette:
   --savanna:   #E8A94D  (warm golden)
   --earth:     #8B4513  (saddle brown)
   --clay:      #C4622D  (terracotta)
   --sand:      #F5E6C8  (light sand)
   --forest:    #2D5016  (deep green)
   --leaf:      #5A7A2C  (leaf green)
   --night:     #1A120B  (dark night)
   --dusk:      #3D2B1F  (dusk brown)
   --ivory:     #FBF5E6  (warm white)
   --grey:      #9E9E9E
*/

:root {
  --savanna: #E8A94D;
  --earth: #8B4513;
  --clay: #C4622D;
  --sand: #F5E6C8;
  --forest: #2D5016;
  --leaf: #5A7A2C;
  --night: #1A120B;
  --dusk: #3D2B1F;
  --ivory: #FBF5E6;
  --grey: #9E9E9E;
  --shadow: 0 4px 20px rgba(26, 18, 11, 0.15);
  --radius: 12px;
  --transition: 0.3s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Lato', sans-serif;
  background-color: var(--ivory);
  color: var(--night);
  line-height: 1.6;
}

/* ── Typography ── */

h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', serif;
  line-height: 1.2;
}

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--dusk);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ivory);
}

.logo-icon {
  font-size: 2rem;
  line-height: 1;
}

.logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
}

.logo-text em {
  font-style: italic;
  color: var(--savanna);
  font-weight: 400;
  font-size: 0.85rem;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--sand);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  transition: color var(--transition);
}

.site-nav a:hover {
  color: var(--savanna);
}

/* ── Hero Section ── */

.hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="80" r="3" fill="%235A7A2C" opacity="0.3"/><circle cx="20" cy="85" r="4" fill="%235A7A2C" opacity="0.2"/><circle cx="80" cy="75" r="5" fill="%235A7A2C" opacity="0.25"/></svg>'),
    linear-gradient(160deg, #3D2B1F 0%, #8B4513 40%, #C4622D 70%, #E8A94D 100%);
  background-size: 100px 100px, cover;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23FBF5E6' fill-opacity='1' d='M0,288L48,272C96,256,192,224,288,197.3C384,171,480,149,576,165.3C672,181,768,235,864,250.7C960,267,1056,245,1152,224C1248,203,1344,181,1392,170.7L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") bottom / 100% auto no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 18, 11, 0.3);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 1.5rem 6rem;
  color: var(--ivory);
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.3rem);
  max-width: 600px;
  margin: 0 auto 2rem;
  opacity: 0.92;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: 50px;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--clay), var(--savanna));
  color: var(--ivory);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--earth), var(--clay));
}

.btn-secondary {
  background: transparent;
  color: var(--earth);
  border: 2px solid var(--earth);
}

.btn-gift {
  background: linear-gradient(135deg, var(--forest), var(--leaf));
  color: var(--ivory);
  font-size: 0.85rem;
}

.btn-claimed {
  background: var(--grey);
  color: #fff;
  cursor: not-allowed;
  font-size: 0.85rem;
}

.btn-claimed:hover {
  transform: none;
  box-shadow: none;
}

.hero-cta {
  font-size: 1rem;
  padding: 0.8rem 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ── Container ── */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── About Section ── */

.about-section {
  padding: 4rem 0;
  background: var(--ivory);
}

.about-card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.about-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.about-card h2 {
  font-size: 2rem;
  color: var(--earth);
  margin-bottom: 1rem;
}

.about-card p {
  color: #555;
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
}

.bank-info-box {
  background: var(--sand);
  border-left: 4px solid var(--savanna);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-top: 2rem;
  text-align: left;
}

.bank-info-box h3 {
  color: var(--earth);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.bank-info-box ol {
  padding-left: 1.4rem;
  color: #555;
}

.bank-info-box ol li {
  margin-bottom: 0.5rem;
}

/* ── Gifts Section ── */

.gifts-section {
  padding: 3rem 0 5rem;
  background: linear-gradient(180deg, var(--ivory) 0%, var(--sand) 100%);
}

.section-title {
  text-align: center;
  font-size: 2.2rem;
  color: var(--earth);
  margin-bottom: 2.5rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--savanna);
  margin: 0.6rem auto 0;
  border-radius: 2px;
}

/* Category Tabs */

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.cat-tab {
  padding: 0.45rem 1.1rem;
  border: 2px solid var(--savanna);
  background: transparent;
  border-radius: 50px;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--earth);
  transition: background var(--transition), color var(--transition);
}

.cat-tab.active, .cat-tab:hover {
  background: var(--savanna);
  color: var(--ivory);
}

/* Items Grid */

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.8rem;
}

.item-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.item-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(26, 18, 11, 0.2);
}

.item-card.claimed {
  opacity: 0.7;
  cursor: default;
}

.item-card.claimed:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.item-card.hidden {
  display: none;
}

.item-image-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--sand);
}

.item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.item-card:not(.claimed):hover .item-image {
  transform: scale(1.05);
}

.item-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--sand) 0%, #f0d9a8 100%);
}

.claimed-badge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 18, 11, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--savanna);
  font-family: 'Playfair Display', serif;
  letter-spacing: 0.05em;
}

.item-body {
  padding: 1.2rem 1.4rem 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-category-tag {
  display: inline-block;
  background: var(--sand);
  color: var(--earth);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  margin-bottom: 0.6rem;
  align-self: flex-start;
}

.item-name {
  font-size: 1.15rem;
  color: var(--night);
  margin-bottom: 0.5rem;
}

.item-description {
  font-size: 0.9rem;
  color: #666;
  flex: 1;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.item-price {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--clay);
}

/* ── Modal ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 18, 11, 0.7);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  max-width: 460px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modal-in 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--sand);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.modal-close:hover {
  background: var(--savanna);
  color: #fff;
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.modal-box h2 {
  color: var(--earth);
  margin-bottom: 0.5rem;
}

.modal-item-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--night);
  margin-bottom: 0.3rem;
}

.modal-item-price {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--clay);
  margin-bottom: 1rem;
}

.modal-instructions {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.modal-close-btn {
  width: 100%;
  justify-content: center;
  padding: 0.9rem;
  font-size: 1rem;
}

/* ── Flash Messages ── */

.flash-messages {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 1.5rem;
}

.flash {
  padding: 0.9rem 1.3rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.flash-success {
  background: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.flash-error {
  background: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

/* ── Footer ── */

.site-footer {
  background: var(--dusk);
  color: var(--sand);
  text-align: center;
  padding: 2rem 1.5rem;
}

.site-footer p {
  font-size: 0.9rem;
}

.footer-admin-link {
  color: var(--savanna);
  text-decoration: none;
}

.footer-admin-link:hover {
  text-decoration: underline;
}

/* ── Empty State ── */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #888;
}

.empty-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .header-inner {
    padding: 0.7rem 1rem;
  }

  .site-nav {
    gap: 1rem;
  }

  .hero {
    min-height: 360px;
  }

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

  .section-title {
    font-size: 1.8rem;
  }

  .about-section,
  .gifts-section {
    padding: 2.5rem 0;
  }
}

@media (max-width: 480px) {
  .site-nav {
    display: none;
  }

  .items-grid {
    grid-template-columns: 1fr;
  }

  .item-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-gift, .btn-claimed {
    width: 100%;
    justify-content: center;
  }
}

/* ── Item Detail Page ─────────────────────────────────────────────────────── */

.item-detail-container {
  padding: 2.5rem 1.5rem 5rem;
  max-width: 960px;
}

.back-link {
  display: inline-block;
  color: var(--earth);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--clay);
}

.item-detail-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.item-detail-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--sand);
}

.item-detail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-detail-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  background: linear-gradient(135deg, var(--sand) 0%, #f0d9a8 100%);
}

.item-detail-body {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.item-detail-name {
  font-size: 1.8rem;
  color: var(--night);
}

.item-detail-price {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--clay);
  line-height: 1;
}

.item-detail-description {
  color: #555;
  font-size: 1rem;
  line-height: 1.7;
  flex: 1;
}

.item-detail-actions {
  margin-top: auto;
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

.gift-hint {
  font-size: 0.82rem;
  color: #888;
  margin-top: 0.6rem;
}

.claimed-notice {
  font-size: 0.95rem;
  color: #555;
  background: #f8f4ee;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

.claimed-notice a {
  color: var(--clay);
}

@media (max-width: 700px) {
  .item-detail-card {
    grid-template-columns: 1fr;
  }

  .item-detail-image-wrap {
    aspect-ratio: 16 / 9;
  }

  .item-detail-body {
    padding: 1.5rem;
  }
}
