:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-accent: #f59e0b;
  --color-accent-dark: #d97706;
  --color-pink: #ec4899;
  --color-green: #10b981;
  --color-bg: #ffffff;
  --color-surface: #f8fafc;
  --color-surface-2: #f1f5f9;
  --color-text: #0f172a;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
  --font-main: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
  --max-width: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 999;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--color-primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--color-primary-dark); text-decoration: underline; }

/* ===== HEADER ===== */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.logo:hover { text-decoration: none; color: var(--color-primary); }
.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-primary), var(--color-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}
.main-nav a {
  margin-left: 1.75rem;
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.15s;
}
.main-nav a:hover { color: var(--color-primary); text-decoration: none; }
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-text);
  margin: 5px 0;
  border-radius: 2px;
  transition: 0.2s;
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumbs li + li::before { content: "\203A"; margin: 0 0.5rem; color: var(--color-border); }
.breadcrumbs a { color: var(--color-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs span[aria-current="page"] { color: var(--color-text); font-weight: 600; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #fce7f3 50%, #fef3c7 100%);
  padding: 4rem 1.25rem;
  text-align: center;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 2.75rem;
  margin: 0 0 1rem;
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--color-primary), var(--color-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lead {
  font-size: 1.2rem;
  color: var(--color-muted);
  max-width: 680px;
  margin: 0 auto 2rem;
}
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,0.35); }
.btn-secondary { background: #fff; color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: var(--color-surface); }
.btn-ghost { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-ghost:hover { background: var(--color-primary-light); }
.btn-block { display: flex; width: 100%; margin-bottom: 0.6rem; }
.btn-lg { padding: 0.9rem 2rem; font-size: 1.1rem; }

/* ===== SECTIONS ===== */
.section { padding: 2.5rem 1.25rem; }
.section-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.85rem;
  font-family: var(--font-display);
  font-weight: 700;
}

/* ===== CATEGORY CARDS ===== */
.card-grid, .subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.category-card, .subject-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: var(--color-text);
}
.category-card:hover, .subject-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: var(--color-text);
  border-color: var(--color-primary-light);
}
.category-card h3, .subject-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  font-family: var(--font-display);
}
.category-card p, .subject-card p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}
.card-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
}
.card-image img { max-height: 100%; max-width: 100%; object-fit: contain; }

/* ===== THUMBNAIL GRID ===== */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}
.thumb-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.6rem;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.thumb-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--color-text);
}
.thumb-card img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  background: #fff;
  aspect-ratio: 1;
  object-fit: contain;
}
.thumb-title {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

/* ===== VARIATIONS GRID ===== */
.variations-section {
  margin-top: 2.5rem;
}
.variations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.variation-card {
  background: #fff;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-align: center;
}
.variation-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}
.variation-card.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.variation-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
}
.variation-label {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
}
.variation-card.active .variation-label {
  color: var(--color-primary);
}

/* ===== FEATURE GRID ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.feature {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
}
.feature h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}
.feature p { margin: 0; color: var(--color-muted); font-size: 0.95rem; }
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* ===== PAGE ARTICLE ===== */
.page-article { padding: 1.5rem 0; }
.page-article h1 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  margin-bottom: 1.5rem;
  font-weight: 800;
}
.page-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}
.page-image-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.page-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.page-actions {
  position: sticky;
  top: 84px;
}
.page-actions .btn { margin-bottom: 0.6rem; }
.print-instructions {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 1rem 0;
  padding: 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-accent);
}
.share { margin-top: 1.5rem; }
.share h3 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--color-muted); font-weight: 700; }
.share-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, color 0.15s;
}
.share-btn:hover { transform: scale(1.1); text-decoration: none; }
.share-btn.pinterest { color: #bd081c; border-color: #f9d2d7; }
.share-btn.pinterest:hover { background: #bd081c; color: #fff; }
.share-btn.facebook { color: #1877f2; border-color: #d2e4fc; }
.share-btn.facebook:hover { background: #1877f2; color: #fff; }
.share-btn.x { color: #000; border-color: #e2e8f0; }
.share-btn.x:hover { background: #000; color: #fff; }
.share-btn.whatsapp { color: #25d366; border-color: #d3f6e1; }
.share-btn.whatsapp:hover { background: #25d366; color: #fff; }
.share-btn.email { color: var(--color-primary); border-color: var(--color-primary-light); }
.share-btn.email:hover { background: var(--color-primary); color: #fff; }
.share-btn.copy.copied { background: var(--color-green); color: #fff; border-color: var(--color-green); }
.share-btn svg { width: 18px; height: 18px; }

/* ===== PAGE DESCRIPTION ===== */
.page-description {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius);
}
.page-description h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 0.75rem;
}
.page-description p { margin: 0; color: var(--color-muted); }

/* ===== RELATED ===== */
.related-section { margin-top: 2.5rem; }
.related-section h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}

/* ===== UPSELL BANNER ===== */
.upsell-banner {
  margin-top: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fce7f3 100%);
  border-radius: var(--radius);
  text-align: center;
}
.upsell-banner h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 0.75rem;
  color: var(--color-text);
}
.upsell-banner p {
  color: var(--color-muted);
  margin: 0 0 1.25rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.upsell-note {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 1rem;
  opacity: 0.8;
}

/* ===== LEGAL PAGES ===== */
.legal-page { max-width: 800px; margin: 2rem auto; padding: 0 1.25rem; }
.legal-page h1 { font-family: var(--font-display); font-size: 2rem; }
.legal-body h2 { font-size: 1.25rem; margin-top: 1.5rem; }
.legal-body p { color: var(--color-muted); }

/* ===== 404 PAGE ===== */
.error-page { text-align: center; padding: 3rem 1.25rem; }
.error-page h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}
.error-page h2 {
  font-family: var(--font-display);
  margin-top: 2.5rem;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-top: 2rem;
}
.site-footer a { margin: 0 0.3rem; color: var(--color-muted); }
.site-footer a:hover { color: var(--color-primary); }
.footer-inner { max-width: var(--max-width); margin: 0 auto; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .nav-open .main-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-md);
  }
  .nav-open .main-nav a { margin: 0.5rem 0; }
  .menu-toggle { display: block; }
  .hero { padding: 2.5rem 1.25rem; }
  .hero h1 { font-size: 1.85rem; }
  .lead { font-size: 1.05rem; }
  .page-layout { grid-template-columns: 1fr; }
  .page-actions { position: static; }
  .card-grid, .subject-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .section-title { font-size: 1.5rem; }
}
