/* ============================================================
   LitQuest - Biblioteca Online
   Estilos Principais
   ============================================================ */

:root {
  --primary: #1a1a2e;
  --secondary: #16213e;
  --accent: #e94560;
  --accent2: #f5a623;
  --gold: #d4af37;
  --text: #333333;
  --text-light: #6b7280;
  --bg: #f9fafb;
  --white: #ffffff;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
  --font: 'Inter', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

input,
select,
textarea,
button {
  min-width: 0;
  font: inherit;
}

.nav-container,
.hero-container,
.section-container,
.footer-container,
.order-container,
.modal,
.auth-box,
.filter-bar,
.book-detail-grid,
.order-form-wrapper,
.footer-grid,
.books-grid,
.categories-grid,
.plans-grid,
.physical-cta-grid,
.physical-cta-features {
  min-width: 0;
}

h1,
h2,
h3,
h4,
p,
span,
a,
button,
label,
.book-title,
.book-author,
.section-title,
.section-subtitle,
.plan-name,
.info-list li {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ============================================================
   HEADER / NAVBAR
   ============================================================ */
.navbar {
  background: var(--primary);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 1rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.nav-logo span {
  color: var(--accent);
}

.nav-logo i {
  color: var(--gold);
  font-size: 1.6rem;
}

.nav-search {
  flex: 1;
  max-width: 400px;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  padding: 0 1rem;
  gap: 0.5rem;
  transition: var(--transition);
  min-width: 0;
}

.nav-search:focus-within {
  background: rgba(255,255,255,0.15);
  border-color: var(--accent);
}

.nav-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 0.9rem;
  width: 100%;
  padding: 0.6rem 0;
}

.nav-search input::placeholder {
  color: rgba(255,255,255,0.5);
}

.nav-search i {
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.nav-link {
  color: rgba(255,255,255,0.8);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.btn-nav-login {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.btn-nav-login:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-nav-cta {
  background: var(--accent);
  border: none;
  color: var(--white);
  padding: 0.55rem 1.2rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.btn-nav-cta:hover {
  background: #c73652;
  transform: translateY(-1px);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  padding: 5px;
  flex-shrink: 0;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, #0f3460 100%);
  color: var(--white);
  padding: 5rem 2rem 6rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(233, 69, 96, 0.15);
  border: 1px solid rgba(233, 69, 96, 0.3);
  color: #ff6b6b;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 2.5rem;
  max-width: 500px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 0.9rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.btn-primary:hover {
  background: #c73652;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 69, 96, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.3);
  padding: 0.9rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat .number {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold);
}

.hero-stat .label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-books {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  transform: perspective(1000px) rotateY(-8deg);
}

.hero-book-card {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  transition: var(--transition);
}

.hero-book-card:hover {
  transform: translateY(-5px) scale(1.02);
}

.hero-book-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

/* ============================================================
   GENERAL SECTIONS
   ============================================================ */
.section {
  padding: 4rem 2rem;
}

.section-container {
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
}

.section-subtitle {
  color: var(--text-light);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================================
   CATEGORIES
   ============================================================ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.category-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cat-color, #6366f1) 15%, transparent);
  opacity: 0;
  transition: var(--transition);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.category-card:hover::before {
  opacity: 0.05;
}

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.4rem;
  color: var(--white);
}

.category-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.category-card .count {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* ============================================================
   BOOKS GRID
   ============================================================ */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.book-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  min-width: 0;
}

.book-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.book-cover {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #f3f4f6;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.book-card:hover .book-cover img {
  transform: scale(1.08);
}

.book-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.badge-free {
  background: var(--success);
  color: white;
}

.badge-paid {
  background: var(--accent);
  color: white;
}

.badge-sub {
  background: var(--gold);
  color: var(--primary);
}

.badge-featured {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--gold);
  color: var(--primary);
  padding: 0.25rem 0.5rem;
  border-radius: 50px;
  font-size: 0.65rem;
  font-weight: 700;
  z-index: 2;
}

.book-actions-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,26,46,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  opacity: 0;
  transition: var(--transition);
  padding: 1rem;
}

.book-card:hover .book-actions-overlay {
  opacity: 1;
}

.btn-overlay {
  background: var(--white);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--primary);
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-overlay:hover {
  background: var(--accent);
  color: var(--white);
  transform: scale(1.1);
}

.book-info {
  padding: 1rem;
}

.book-category-tag {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.book-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.book-author {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.book-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.book-price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
}

.book-price.free {
  color: var(--success);
}

.btn-book-action {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-book-action:hover {
  background: var(--accent);
}

.btn-book-action.free-btn {
  background: var(--success);
}

.btn-book-action.free-btn:hover {
  background: #059669;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  margin-right: 0.5rem;
}

.filter-btn {
  padding: 0.45rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-light);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.filter-select {
  padding: 0.45rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
  font-family: var(--font);
  min-width: 140px;
}

.filter-search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.45rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  font-family: var(--font);
  transition: var(--transition);
}

.filter-search-input:focus {
  border-color: var(--accent);
}

/* ============================================================
   PLANS / PRICING
   ============================================================ */
.plans-bg {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.plan-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  color: var(--white);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.plan-card:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,0.08);
}

.plan-card.featured-plan {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.05);
}

.plan-popular-badge {
  position: absolute;
  top: 16px;
  right: -30px;
  background: var(--gold);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 2.5rem;
  transform: rotate(45deg);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.plan-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.plan-price {
  margin-bottom: 1.5rem;
}

.plan-price .amount {
  font-size: 3rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.plan-price .period {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-left: 0.25rem;
}

.plan-features {
  margin-bottom: 2rem;
}

.plan-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.plan-feature:last-child {
  border-bottom: none;
}

.plan-feature i {
  color: var(--success);
  font-size: 0.85rem;
  width: 16px;
  flex-shrink: 0;
}

.plan-feature.disabled {
  opacity: 0.4;
}

.plan-feature.disabled i {
  color: var(--danger);
}

.btn-plan {
  width: 100%;
  padding: 0.9rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-plan-free {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-plan-free:hover {
  background: rgba(255,255,255,0.2);
}

.btn-plan-premium {
  background: var(--gold);
  color: var(--primary);
}

.btn-plan-premium:hover {
  background: #c9a227;
  transform: scale(1.02);
}

/* ============================================================
   PHYSICAL ORDER FORM
   ============================================================ */
.order-section {
  background: var(--white);
}

.order-container {
  max-width: 900px;
  margin: 0 auto;
}

.order-form-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.form-group {
  margin-bottom: 1.25rem;
  min-width: 0;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-submit {
  width: 100%;
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 1rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-submit:hover {
  background: #c73652;
  transform: translateY(-2px);
}

.order-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.order-info-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.order-info-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.order-info-card h4 i {
  color: var(--accent);
  flex-shrink: 0;
}

.info-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list li i {
  color: var(--success);
  margin-top: 2px;
  width: 16px;
  flex-shrink: 0;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  transform: scale(0.9);
  transition: var(--transition);
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
  gap: 1rem;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-light);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-body {
  padding: 2rem;
}

.book-detail-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

.book-detail-cover {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.book-detail-cover img {
  width: 100%;
  height: 360px;
  object-fit: cover;
}

.book-detail-info h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.book-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-light);
}

.meta-item i {
  color: var(--accent);
  flex-shrink: 0;
}

.book-detail-description {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.book-detail-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.book-detail-price.free-price {
  color: var(--success);
}

.btn-get-book {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  margin-right: 1rem;
  margin-bottom: 0.75rem;
}

.btn-get-free {
  background: var(--success);
  color: var(--white);
}

.btn-get-free:hover {
  background: #059669;
}

.btn-get-paid {
  background: var(--accent);
  color: var(--white);
}

.btn-get-paid:hover {
  background: #c73652;
}

.btn-favorite {
  background: none;
  border: 2px solid var(--border);
  color: var(--text-light);
  padding: 0.9rem 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.btn-favorite:hover,
.btn-favorite.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   AUTH FORMS
   ============================================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  padding: 1rem;
}

.auth-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.auth-box {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  overflow: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  position: relative;
}

.auth-overlay.active .auth-box {
  transform: translateY(0);
}

.auth-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 2rem;
  text-align: center;
  color: var(--white);
}

.auth-header .logo {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.auth-header .logo span {
  color: var(--accent);
}

.auth-header p {
  font-size: 0.85rem;
  opacity: 0.7;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  background: none;
  border-right: 1px solid var(--border);
}

.auth-tab:last-child {
  border-right: none;
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-form {
  padding: 2rem;
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-footer {
  padding: 1rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
}

.auth-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: calc(100vw - 2rem);
}

.toast {
  background: var(--primary);
  color: var(--white);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  animation: slideInToast 0.3s ease;
  max-width: 350px;
  font-size: 0.88rem;
  width: 100%;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.warning {
  background: var(--warning);
  color: var(--primary);
}

@keyframes slideInToast {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  padding: 4rem 2rem 2rem;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand .logo span {
  color: var(--accent);
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.8;
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.social-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.social-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  transition: var(--transition);
}

.footer-col ul li a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom a {
  color: rgba(255,255,255,0.5);
  transition: var(--transition);
}

.footer-bottom a:hover {
  color: var(--accent);
}

/* ============================================================
   LOADER
   ============================================================ */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-light);
  gap: 0.75rem;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.physical-cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.physical-cta-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-light);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .nav-container,
  .hero-container,
  .section-container,
  .footer-container {
    max-width: 100%;
  }

  .hero-container {
    gap: 3rem;
  }
}

@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-visual {
    display: none;
  }

  .hero {
    text-align: center;
  }

  .hero p {
    margin: 0 auto 2.5rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .book-detail-grid {
    grid-template-columns: 1fr;
  }

  .book-detail-cover {
    max-width: 320px;
  }

  .book-detail-cover img {
    height: 250px;
  }

  .physical-cta-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .order-form-wrapper {
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
  }

  .nav-container {
    height: 70px;
  }

  .nav-search {
    display: none;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--primary);
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-link,
  .btn-nav-login,
  .btn-nav-cta {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
  }

  .hamburger {
    display: flex;
  }

  .section {
    padding: 3rem 1rem;
  }

  .hero {
    padding: 3rem 1rem 4rem;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }

  .order-form-wrapper {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    padding: 1rem;
  }

  .filter-label {
    width: 100%;
    margin-right: 0;
  }

  .filter-search-input,
  .filter-select {
    width: 100%;
    min-width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .modal {
    max-width: 100%;
    border-radius: 12px;
  }

  .modal-header {
    padding: 1rem 1.25rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .physical-cta-features {
    grid-template-columns: 1fr 1fr;
  }

  .auth-form {
    padding: 1.5rem;
  }

  .auth-footer {
    padding: 1rem 1.5rem;
  }
}

@media (max-width: 576px) {
  .hero h1 {
    font-size: 1.9rem;
  }

  .hero p {
    font-size: 1rem;
    line-height: 1.7;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .hero-stats {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-book-action {
    width: 100%;
    text-align: center;
  }

  .book-actions-overlay {
    gap: 0.5rem;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-btn {
    width: 100%;
  }

  .plan-card {
    padding: 2rem 1.25rem;
  }

  .plan-price .amount {
    font-size: 2.4rem;
  }

  .order-info-card {
    padding: 1.25rem;
  }

  .modal-header h2 {
    font-size: 1.05rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .book-detail-info h1 {
    font-size: 1.3rem;
  }

  .book-detail-price {
    font-size: 1.6rem;
  }

  .btn-get-book,
  .btn-favorite {
    width: 100%;
    margin-right: 0;
  }

  .auth-header {
    padding: 1.5rem 1rem;
  }

  .auth-tabs {
    flex-direction: row;
  }

  .auth-tab {
    padding: 0.85rem 0.75rem;
    font-size: 0.85rem;
  }

  .auth-form {
    padding: 1.25rem 1rem;
  }

  .auth-footer {
    padding: 1rem;
  }

  .footer {
    padding: 3rem 1rem 2rem;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .nav-logo {
    font-size: 1.25rem;
  }

  .nav-logo i {
    font-size: 1.35rem;
  }

  .books-grid {
    grid-template-columns: 1fr 1fr;
  }

  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .physical-cta-features {
    grid-template-columns: 1fr;
  }

  .footer-brand .logo {
    font-size: 1.3rem;
  }

  .empty-state {
    padding: 3rem 1rem;
  }
}

@media (max-width: 360px) {
  .navbar {
    padding: 0 0.75rem;
  }

  .section {
    padding: 2.5rem 0.75rem;
  }

  .hero {
    padding: 2.5rem 0.75rem 3rem;
  }

  .books-grid {
    grid-template-columns: 1fr;
  }

  .categories-grid {
    grid-template-columns: 1fr 1fr;
  }

  .btn-primary,
  .btn-secondary,
  .btn-submit,
  .btn-plan,
  .btn-get-book,
  .btn-favorite {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .modal-header,
  .modal-body {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}

@media (min-width: 1440px) {
  .hero,
  .section,
  .footer {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}
.pdf-app {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.pdf-toolbar {
  height: 60px;
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pdf-toolbar button {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
}

.pdf-toolbar button:hover {
  background: var(--accent);
}

.pdf-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.pdf-page {
  background: white;
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
}

/* Modo escuro */
.dark-mode {
  background: #111 !important;
}

.dark-mode .pdf-page {
  filter: invert(1) hue-rotate(180deg);
}

/* RESPONSIVO */
@media (max-width: 768px) {
  .pdf-toolbar {
    height: auto;
    padding: 0.5rem;
  }

  .pdf-container {
    padding: 0.5rem;
  }
}

#pdfModal .modal {
  display: flex;
  flex-direction: column;
}

#pdfModal .modal-body {
  flex: 1;
}
/* ============================================================
   INTERNAL READER
   ============================================================ */
body.reader-open {
  overflow: hidden;
}

.reader-overlay {
  background: rgba(7, 13, 27, 0.82);
  backdrop-filter: blur(10px);
  align-items: stretch;
  padding: 0.75rem;
}

.reader-modal {
  width: min(1500px, 100%);
  max-width: 100%;
  max-height: 100%;
  height: calc(100vh - 1.5rem);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top right, rgba(233, 69, 96, 0.12), transparent 22%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 30px 80px rgba(0,0,0,0.32);
}

.reader-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.35rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(18px);
}

.reader-header-main {
  min-width: 0;
}

.reader-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(233, 69, 96, 0.12);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.reader-header h2 {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.reader-header p {
  color: var(--text-light);
  font-size: 0.9rem;
}

.reader-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reader-progress-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-light);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
}

.reader-icon-btn,
.reader-tool-btn,
.reader-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 42px;
  padding: 0 1rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  background: rgba(255,255,255,0.9);
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}

.reader-icon-btn {
  width: 42px;
  padding: 0;
}

.reader-icon-btn:hover,
.reader-tool-btn:hover,
.reader-theme-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(233, 69, 96, 0.35);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.reader-close {
  background: rgba(255,255,255,0.9);
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.35rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(248,250,252,0.92);
  flex-wrap: wrap;
}

.reader-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.reader-zoom-label {
  min-width: 62px;
  text-align: center;
  font-weight: 800;
  color: var(--primary);
}

.reader-shortcuts {
  color: var(--text-light);
  font-size: 0.82rem;
  gap: 0.9rem 1rem;
}

.reader-shortcuts kbd {
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.75rem;
  font-family: var(--font);
}

.reader-progress-track {
  height: 4px;
  background: rgba(148, 163, 184, 0.18);
}

.reader-progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.25s ease;
}

.reader-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background:
    radial-gradient(circle at left top, rgba(212, 175, 55, 0.08), transparent 18%),
    linear-gradient(180deg, #edf2f7 0%, #e2e8f0 100%);
}

.reader-loading,
.reader-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.reader-loading.active {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: rgba(237, 242, 247, 0.78);
  backdrop-filter: blur(6px);
  font-weight: 600;
  color: var(--primary);
}

.reader-frame-shell,
.reader-pdf-shell,
.reader-text-shell {
  position: absolute;
  inset: 0;
  display: none;
}

.reader-frame-shell.active,
.reader-pdf-shell.active,
.reader-text-shell.active,
.reader-fallback.active {
  display: block;
}

.reader-frame-shell {
  padding: 1rem;
}

#readerFrame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  transform-origin: top center;
  transition: transform 0.25s ease;
}

.reader-text-shell {
  padding: 1rem;
}

.reader-scroll {
  height: 100%;
  overflow: auto;
  padding: clamp(0.5rem, 2vw, 1rem);
}

.reader-article {
  max-width: 860px;
  margin: 0 auto;
  background: rgba(255,255,255,0.96);
  color: var(--text);
  border-radius: 24px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  padding: clamp(1.5rem, 3vw, 3.5rem);
  font-size: 18px;
  line-height: 1.95;
  transition: var(--transition);
}

.reader-article h3 {
  font-size: 1.2em;
  color: var(--primary);
  margin: 1.2em 0 0.75em;
}

.reader-article h3:first-child {
  margin-top: 0;
}

.reader-article p + p {
  margin-top: 1rem;
}

.reader-fallback.active {
  display: flex;
  padding: 1.5rem;
}

.reader-fallback-card {
  max-width: 560px;
  width: 100%;
  text-align: center;
  background: rgba(255,255,255,0.96);
  border-radius: 24px;
  padding: 2.2rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.reader-fallback-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--accent);
  background: rgba(233, 69, 96, 0.12);
}

.reader-fallback-card h3 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.reader-fallback-card p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.reader-fallback-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.reader-primary-link,
.reader-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
}

.reader-primary-link {
  background: var(--accent);
  color: #fff;
}

.reader-secondary-link {
  background: rgba(15, 23, 42, 0.06);
  color: var(--primary);
}

#readerModal[data-theme="sepia"] .reader-modal {
  background:
    radial-gradient(circle at top right, rgba(245, 166, 35, 0.15), transparent 22%),
    linear-gradient(180deg, #f6efe2 0%, #eadfcf 100%);
}

#readerModal[data-theme="sepia"] .reader-header,
#readerModal[data-theme="sepia"] .reader-toolbar,
#readerModal[data-theme="sepia"] .reader-loading.active {
  background: rgba(250, 244, 235, 0.88);
}

#readerModal[data-theme="sepia"] .reader-body {
  background: linear-gradient(180deg, #efe6d8 0%, #e6dac7 100%);
}

#readerModal[data-theme="sepia"] .reader-article,
#readerModal[data-theme="sepia"] .reader-fallback-card,
#readerModal[data-theme="sepia"] #readerFrame {
  background: #fbf3e8;
}

#readerModal[data-theme="dark"] .reader-modal {
  background:
    radial-gradient(circle at top right, rgba(233, 69, 96, 0.12), transparent 24%),
    linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

#readerModal[data-theme="dark"] .reader-header,
#readerModal[data-theme="dark"] .reader-toolbar {
  background: rgba(15, 23, 42, 0.84);
  border-color: rgba(255,255,255,0.08);
}

#readerModal[data-theme="dark"] .reader-header h2,
#readerModal[data-theme="dark"] .reader-zoom-label,
#readerModal[data-theme="dark"] .reader-tool-btn,
#readerModal[data-theme="dark"] .reader-theme-btn,
#readerModal[data-theme="dark"] .reader-icon-btn,
#readerModal[data-theme="dark"] .reader-secondary-link {
  color: #e5e7eb;
}

#readerModal[data-theme="dark"] .reader-header p,
#readerModal[data-theme="dark"] .reader-progress-label,
#readerModal[data-theme="dark"] .reader-shortcuts {
  color: rgba(229, 231, 235, 0.75);
}

#readerModal[data-theme="dark"] .reader-tool-btn,
#readerModal[data-theme="dark"] .reader-theme-btn,
#readerModal[data-theme="dark"] .reader-icon-btn,
#readerModal[data-theme="dark"] .reader-secondary-link,
#readerModal[data-theme="dark"] .reader-progress-label,
#readerModal[data-theme="dark"] .reader-shortcuts kbd {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.08);
}

#readerModal[data-theme="dark"] .reader-body {
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
}

#readerModal[data-theme="dark"] .reader-loading.active {
  background: rgba(2, 6, 23, 0.68);
  color: #fff;
}

#readerModal[data-theme="dark"] .reader-article,
#readerModal[data-theme="dark"] .reader-fallback-card,
#readerModal[data-theme="dark"] #readerFrame {
  background: #111827;
  color: #e5e7eb;
}

#readerModal[data-theme="dark"] .reader-article h3,
#readerModal[data-theme="dark"] .reader-fallback-card h3 {
  color: #fff;
}

#readerModal[data-theme="dark"] .reader-fallback-card p {
  color: rgba(229, 231, 235, 0.72);
}

@media (max-width: 980px) {
  .reader-overlay {
    padding: 0;
  }

  .reader-modal {
    height: 100vh;
    border-radius: 0;
  }

  .reader-header,
  .reader-toolbar {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .reader-header {
    flex-direction: column;
    align-items: stretch;
  }

  .reader-header-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .reader-toolbar {
    gap: 0.8rem;
  }

  .reader-toolbar-group {
    width: 100%;
  }

  .reader-shortcuts {
    display: none;
  }

  .reader-progress-label {
    order: -1;
  }

  .reader-fallback-card {
    padding: 1.5rem;
  }
}


.reader-pdf-shell,
.reader-text-shell {
  padding: 1rem;
}

.reader-pdf-shell {
  position: absolute;
  inset: 0;
  display: none;
}

.reader-pdf-scroll {
  height: 100%;
  overflow: auto;
  padding: clamp(0.75rem, 2vw, 1.1rem);
}

.reader-pdf-pages {
  width: fit-content;
  margin: 0 auto;
  transform-origin: top center;
  transition: transform 0.25s ease;
}

.reader-pdf-page {
  margin: 0 auto 1.4rem;
}

.reader-pdf-page-meta {
  margin: 0 0 0.65rem;
  color: var(--text-light);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.reader-pdf-canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

#readerModal[data-theme="dark"] .reader-pdf-page-meta {
  color: rgba(229, 231, 235, 0.74);
}
/* ============================================================
   RESPONSIVE FIXES
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-books {
    transform: none;
  }

  .order-form-wrapper {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {

  .nav-menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hero {
    padding: 3rem 1rem;
  }

  .section {
    padding: 2.5rem 1rem;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }
}

/* Mobile pequeno */
@media (max-width: 480px) {

  .books-grid {
    grid-template-columns: 1fr 1fr;
  }

  .category-card {
    padding: 1rem;
  }

  .hero {
    padding: 2rem 1rem;
  }
}
