/* WonderPress — Kids Nonfiction Bookstore */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --wp-bg: #fefcf3;
  --wp-bg-alt: #fff8e7;
  --wp-text: #2d1b0e;
  --wp-text-muted: #6b5744;
  --wp-primary: #e85d26;
  --wp-primary-hover: #d04a18;
  --wp-accent: #2ea77a;
  --wp-accent-hover: #248f68;
  --wp-purple: #7c5cbf;
  --wp-blue: #3b82f6;
  --wp-yellow: #f59e0b;
  --wp-pink: #ec4899;
  --wp-card-bg: #ffffff;
  --wp-border: #e8dcc8;
  --wp-shadow: 0 2px 12px rgba(45, 27, 14, 0.08);
  --wp-radius: 16px;
  --wp-font: 'Nunito', 'Inter', -apple-system, sans-serif;
}

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

body {
  font-family: var(--wp-font);
  background: var(--wp-bg);
  color: var(--wp-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--wp-primary); text-decoration: none; }
a:hover { color: var(--wp-primary-hover); }
h1, h2, h3, h4 { font-weight: 800; line-height: 1.25; }

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

/* ── Buttons ──────────────────────────────────────────────── */
.wp-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border: none; border-radius: 50px;
  font-family: var(--wp-font); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.wp-btn-primary { background: var(--wp-primary); color: #fff; }
.wp-btn-primary:hover { background: var(--wp-primary-hover); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(232, 93, 38, 0.3); }
.wp-btn-accent { background: var(--wp-accent); color: #fff; }
.wp-btn-accent:hover { background: var(--wp-accent-hover); color: #fff; transform: translateY(-2px); }
.wp-btn-outline { background: transparent; color: var(--wp-primary); border: 2px solid var(--wp-primary); }
.wp-btn-outline:hover { background: var(--wp-primary); color: #fff; }
.wp-btn-lg { padding: 1rem 2rem; font-size: 1.125rem; }
.wp-btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* ── Navigation ───────────────────────────────────────────── */
.wp-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(254, 252, 243, 0.95); backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--wp-border); padding: 0.75rem 0;
}
.wp-nav-inner { display: flex; align-items: center; justify-content: space-between; }
.wp-logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.5rem; font-weight: 800; color: var(--wp-text); }
.wp-logo:hover { color: var(--wp-text); }
.wp-logo-icon { font-size: 1.75rem; }
.wp-nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.wp-nav-links a { color: var(--wp-text-muted); font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.wp-nav-links a:hover { color: var(--wp-primary); }
.wp-hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.wp-hamburger span { display: block; width: 24px; height: 2px; background: var(--wp-text); margin: 5px 0; border-radius: 2px; transition: 0.3s; }

/* ── Hero ─────────────────────────────────────────────────── */
.wp-hero {
  padding: 4rem 0 3rem; text-align: center;
  background: linear-gradient(180deg, var(--wp-bg-alt) 0%, var(--wp-bg) 100%);
  position: relative; overflow: hidden;
}
.wp-hero::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(232, 93, 38, 0.08); pointer-events: none;
}
.wp-hero::after {
  content: ''; position: absolute; bottom: -60px; left: -30px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(46, 167, 122, 0.08); pointer-events: none;
}
.wp-hero h1 { font-size: 3rem; margin-bottom: 1rem; position: relative; z-index: 1; }
.wp-hero h1 .wp-highlight { color: var(--wp-primary); }
.wp-hero p { font-size: 1.2rem; color: var(--wp-text-muted); max-width: 600px; margin: 0 auto 2rem; position: relative; z-index: 1; }
.wp-hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }
.wp-hero-ages { margin-top: 2rem; display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }
.wp-age-badge {
  padding: 0.4rem 1rem; border-radius: 50px; font-size: 0.85rem; font-weight: 700;
  border: 2px solid var(--wp-border); color: var(--wp-text-muted);
}
.wp-age-badge.active { border-color: var(--wp-primary); color: var(--wp-primary); background: rgba(232, 93, 38, 0.06); }

/* ── Stats ────────────────────────────────────────────────── */
.wp-stats {
  display: flex; justify-content: center; gap: 3rem;
  padding: 2rem 0; border-top: 2px solid var(--wp-border);
  border-bottom: 2px solid var(--wp-border); margin: 0 auto;
  max-width: 700px;
}
.wp-stat { text-align: center; }
.wp-stat-number { font-size: 2rem; font-weight: 800; color: var(--wp-primary); display: block; }
.wp-stat-label { font-size: 0.85rem; color: var(--wp-text-muted); font-weight: 600; }

/* ── Category Cards ───────────────────────────────────────── */
.wp-categories { padding: 3rem 0; }
.wp-section-title { text-align: center; margin-bottom: 2rem; font-size: 2rem; }
.wp-cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; }
.wp-cat-card {
  background: var(--wp-card-bg); border: 2px solid var(--wp-border);
  border-radius: var(--wp-radius); padding: 1.5rem; text-align: center;
  cursor: pointer; transition: all 0.2s; text-decoration: none; color: inherit;
}
.wp-cat-card:hover { border-color: var(--wp-primary); transform: translateY(-3px); box-shadow: var(--wp-shadow); color: inherit; }
.wp-cat-icon { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; }
.wp-cat-name { font-weight: 700; font-size: 1rem; }
.wp-cat-count { font-size: 0.8rem; color: var(--wp-text-muted); margin-top: 0.25rem; }

/* ── Book Grid ────────────────────────────────────────────── */
.wp-books { padding: 3rem 0; }
.wp-book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.wp-book-card {
  background: var(--wp-card-bg); border: 2px solid var(--wp-border);
  border-radius: var(--wp-radius); overflow: hidden;
  transition: all 0.2s; cursor: pointer; text-decoration: none; color: inherit;
  box-shadow: 0 1px 6px rgba(45, 27, 14, 0.1);
}
.wp-book-card:hover { border-color: var(--wp-primary); transform: translateY(-3px); box-shadow: var(--wp-shadow); color: inherit; }
.wp-book-cover {
  width: 100%; aspect-ratio: 4/7; overflow: hidden;
  background: linear-gradient(90deg, #efe4d4 25%, #f7f0e4 50%, #efe4d4 75%);
  background-size: 800px 100%;
  animation: wp-cover-shimmer 1.5s infinite ease-in-out;
  display: flex; align-items: center; justify-content: center;
}
@keyframes wp-cover-shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.wp-book-cover img { width: 100%; height: 100%; object-fit: cover; }
.wp-book-cover img.loaded { animation: none; }
.wp-book-info { padding: 1rem; }
.wp-book-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.35rem; line-height: 1.3; }
.wp-book-author { font-size: 0.8rem; color: var(--wp-text-muted); margin-bottom: 0.5rem; }
.wp-book-meta { display: flex; align-items: center; justify-content: space-between; }
.wp-book-price { font-weight: 800; color: var(--wp-primary); font-size: 0.95rem; }
.wp-book-badges { display: flex; gap: 0.35rem; }
.wp-badge {
  padding: 0.15rem 0.5rem; border-radius: 50px; font-size: 0.65rem;
  font-weight: 700; text-transform: uppercase;
}
.wp-badge-audio { background: rgba(46, 167, 122, 0.12); color: var(--wp-accent); }
.wp-badge-age { background: rgba(59, 130, 246, 0.1); color: var(--wp-blue); }
.wp-badge-new { background: rgba(232, 93, 38, 0.1); color: var(--wp-primary); }

/* ── Features ─────────────────────────────────────────────── */
.wp-features { padding: 3rem 0; background: var(--wp-bg-alt); }
.wp-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.wp-feature-card {
  background: var(--wp-card-bg); border: 2px solid var(--wp-border);
  border-radius: var(--wp-radius); padding: 1.75rem;
}
.wp-feature-icon { font-size: 2rem; margin-bottom: 0.75rem; display: block; }
.wp-feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.wp-feature-card p { font-size: 0.9rem; color: var(--wp-text-muted); line-height: 1.6; }

/* ── CTA ──────────────────────────────────────────────────── */
.wp-cta {
  padding: 3.5rem 0; text-align: center;
  background: linear-gradient(135deg, #fff8e7 0%, #fef0d5 100%);
  border-top: 2px solid var(--wp-border);
}
.wp-cta h2 { font-size: 2rem; margin-bottom: 0.75rem; }
.wp-cta p { color: var(--wp-text-muted); margin-bottom: 1.5rem; font-size: 1.1rem; }

/* ── Footer ───────────────────────────────────────────────── */
.wp-footer {
  padding: 2rem 0; text-align: center;
  border-top: 2px solid var(--wp-border); color: var(--wp-text-muted);
  font-size: 0.85rem;
}
.wp-footer-links { display: flex; gap: 1.5rem; justify-content: center; margin-top: 0.75rem; list-style: none; }
.wp-footer-links a { color: var(--wp-text-muted); }
.wp-footer-links a:hover { color: var(--wp-primary); }
.wp-footer-brand { margin-top: 0.5rem; font-size: 0.75rem; color: #b8a88a; }

/* ── Loading ──────────────────────────────────────────────── */
.wp-loading { text-align: center; padding: 2rem; color: var(--wp-text-muted); }
.wp-spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--wp-border); border-top-color: var(--wp-primary); border-radius: 50%; animation: wp-spin 0.6s linear infinite; }
@keyframes wp-spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .wp-hero h1 { font-size: 2rem; }
  .wp-hero p { font-size: 1rem; }
  .wp-nav-links { display: none; }
  .wp-hamburger { display: block; }
  .wp-nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 100%; left: 0; right: 0; background: var(--wp-bg);
    padding: 1rem; border-bottom: 2px solid var(--wp-border);
    box-shadow: var(--wp-shadow);
  }
  .wp-stats { gap: 1.5rem; }
  .wp-stat-number { font-size: 1.5rem; }
  .wp-book-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .wp-section-title { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .wp-book-grid { grid-template-columns: 1fr; }
  .wp-hero-actions { flex-direction: column; align-items: center; }
}

/* ── Skip to Content ──────────────────────────────────────── */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: var(--wp-primary);
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 var(--wp-radius) var(--wp-radius);
  text-decoration: none;
  transition: top 0.2s;
}
.skip-to-content:focus {
  top: 0;
}

/* ── Focus Visible ────────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--wp-primary);
  outline-offset: 2px;
}
a:focus-visible {
  outline-color: var(--wp-accent);
  border-radius: 4px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-color: var(--wp-primary);
  border-radius: 4px;
}
.wp-btn:focus-visible,
.wp-btn-outline:focus-visible {
  outline-color: var(--wp-accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(46, 167, 122, 0.2);
}
