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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #FFF8F0;
  color: #3E2723;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* === Hero === */
.hero {
  background: linear-gradient(135deg, #FFCDD2 0%, #FFF9C4 25%, #C8E6C9 50%, #BBDEFB 75%, #E1BEE7 100%);
  text-align: center;
  padding: 3.5rem 1.5rem 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(255,255,255,0.4) 0%, transparent 60%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #3E2723;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #4E342E;
  margin-top: 0.5rem;
  font-weight: 500;
}

.hero-ages {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.4rem 1.2rem;
  background: rgba(255,255,255,0.7);
  border-radius: 2rem;
  font-size: 0.95rem;
  color: #5D4037;
  font-weight: 500;
}

/* === About Section === */
.about {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
}

.about h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #4E342E;
  margin-bottom: 1rem;
}

.about p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #5D4037;
  margin-bottom: 0.75rem;
}

.about p:last-child {
  margin-bottom: 0;
}

/* === Filters === */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8D6E63;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-buttons {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.3rem 0.7rem;
  border: 2px solid #E0D6CC;
  border-radius: 2rem;
  background: #fff;
  color: #5D4037;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  border-color: #FF7043;
  color: #FF7043;
}

.filter-btn.active {
  background: #FF7043;
  border-color: #FF7043;
  color: #fff;
}

.reset-btn {
  padding: 0.3rem 0.85rem;
  border: none;
  border-radius: 2rem;
  background: transparent;
  color: #FF7043;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.reset-btn:hover {
  background: #FBE9E7;
}

/* === Book Grid === */
.book-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

/* === Book Card === */
.book-card {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.book-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* === Book Cover === */
.book-cover {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.cover-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.book-card:hover .cover-img {
  transform: scale(1.05);
}

.cover-animales { background: linear-gradient(180deg, #E8F5E9 0%, #C8E6C9 100%); }
.cover-objetos  { background: linear-gradient(180deg, #FFF3E0 0%, #FFE0B2 100%); }
.cover-lugares  { background: linear-gradient(180deg, #F3E5F5 0%, #E1BEE7 100%); }
.cover-mar      { background: linear-gradient(180deg, #E3F2FD 0%, #BBDEFB 100%); }
.cover-espacio  { background: linear-gradient(180deg, #EDE7F6 0%, #D1C4E9 100%); }

/* === Card Info === */
.book-info {
  padding: 0.75rem 1rem 1rem;
}

.book-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #3E2723;
  margin-bottom: 0.4rem;
}

.book-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.edad-0-1 { background: #E3F2FD; color: #1565C0; }
.edad-1-2 { background: #BBDEFB; color: #1565C0; }
.edad-2-3 { background: #90CAF9; color: #0D47A1; }

.tema-animales { background: #C8E6C9; color: #2E7D32; }
.tema-objetos  { background: #FFE0B2; color: #E65100; }
.tema-lugares  { background: #E1BEE7; color: #6A1B9A; }

.badge-lang { background: #FCE4EC; color: #C2185B; }

.book-cta {
  display: block;
  padding: 0.5rem 1rem;
  background: #FF7043;
  color: #fff;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 2rem;
  transition: background 0.15s ease;
}

.book-card:hover .book-cta {
  background: #F4511E;
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  background: #F5F0EB;
  border-top: 1px solid #E8E0D8;
}

.footer-url {
  font-size: 0.85rem;
  color: #8D6E63;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* === Site Signature === */
.site-signature {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
  background: rgba(0, 0, 0, 0.02);
  color: #64748b;
  text-decoration: none;
  font-size: 0.75rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.site-signature::before {
  content: "\25C6";
  font-size: 0.625rem;
  color: #3b82f6;
}

.site-signature:hover {
  color: #475569;
  border-color: #cbd5e1;
  background: rgba(0, 0, 0, 0.04);
}

/* === Responsive: Tablet (2 columns) === */
@media (min-width: 600px) {
  .hero {
    padding: 4rem 2rem 3.5rem;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-cover {
    height: 240px;
  }
}

/* === Responsive: Desktop (3-4 columns) === */
@media (min-width: 900px) {
  .hero {
    padding: 5rem 2rem 4rem;
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  .hero-subtitle {
    font-size: 1.3rem;
  }

  .about {
    padding: 3rem 2rem 2.5rem;
  }

  .about h2 {
    font-size: 1.5rem;
  }

  .about p {
    font-size: 1.1rem;
  }

  .book-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .filters {
    gap: 1.25rem;
  }
}

@media (min-width: 1200px) {
  .book-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
