/* ============================================================================
   Livre ta Box — POC Design System (Cosmic Modern)
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --primary: #2D1B69;
  --primary-light: #4A2D9B;
  --primary-dark: #1A0F40;
  --secondary: #E8A0D0;
  --secondary-light: #F0C0E0;
  --accent: #FFD700;
  --book-red: #E53E3E;
  --book-blue: #3182CE;
  --book-green: #38A169;
  --book-yellow: #ECC94B;
  --book-purple: #805AD5;
  --success: #22C55E;
  --error: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;
  --gray-50: #FAFAFA; --gray-100: #F5F5F5; --gray-200: #E5E5E5;
  --gray-400: #A3A3A3; --gray-600: #525252; --gray-800: #262626;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--gray-800); line-height: 1.6; background: #fff; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); line-height: 1.2; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }

/* ── Layout ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media(min-width:768px) { .container { padding: 0 24px; } }
@media(min-width:1024px) { .container { padding: 0 32px; } }

/* ── Gradients ── */
.gradient-cosmic { background: linear-gradient(180deg, #1A0F40 0%, #2D1B69 40%, #4A2D9B 70%, #E8A0D0 100%); }
.gradient-primary { background: linear-gradient(135deg, #2D1B69 0%, #4A2D9B 50%, #E8A0D0 100%); }
.glass { background: rgba(255,255,255,0.08); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.15); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-body); font-weight: 600; border: none; cursor: pointer; transition: all 150ms ease; border-radius: 8px; font-size: 16px; padding: 12px 20px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-secondary:hover { background: #EDE9FE; }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: var(--error); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: var(--gray-50); }
.btn-outline-white { background: transparent; color: #fff; border: 2px solid #fff; }
.btn-outline-white:hover { background: rgba(255,255,255,.1); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-lg { padding: 16px 24px; font-size: 16px; }
.btn-xl { padding: 16px 32px; font-size: 18px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ── Cards ── */
.card { background: #fff; border-radius: 12px; border: 1px solid var(--gray-200); box-shadow: 0 1px 3px rgba(0,0,0,.1); overflow: hidden; transition: transform 200ms ease, box-shadow 200ms ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.card-body { padding: 24px; }

/* ── Form ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; color: var(--gray-600); }
.form-input { width: 100%; height: 44px; border: 2px solid var(--gray-200); border-radius: 8px; padding: 12px 16px; font-size: 16px; font-family: var(--font-body); transition: border-color 150ms; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,27,105,.1); }
.form-input.error { border-color: var(--error); background: #FEF2F2; }
textarea.form-input { height: auto; min-height: 100px; resize: vertical; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 9999px; font-size: 12px; font-weight: 500; }
.badge-primary { background: #EDE9FE; color: var(--primary); }
.badge-success { background: #DCFCE7; color: #166534; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-error { background: #FEE2E2; color: #991B1B; }
.badge-pink { background: #FCE7F3; color: #9D174D; }
.badge-info { background: #DBEAFE; color: #1E40AF; }

/* ── Header ── */
.header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--gray-200); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.header .logo { font-family: var(--font-heading); font-weight: 700; font-size: 20px; color: var(--primary); }
.header .logo img { height: 32px; width: auto; vertical-align: middle; margin-right: 6px; border-radius: 6px; object-fit: contain; mix-blend-mode: multiply; }
.header nav { display: flex; gap: 24px; align-items: center; }
.header nav a { color: var(--gray-600); font-weight: 500; font-size: 14px; transition: color 150ms; }
.header nav a:hover { color: var(--primary); }
.header .cart-btn { position: relative; background: none; border: none; cursor: pointer; font-size: 20px; }
.cart-count { position: absolute; top: -6px; right: -8px; background: var(--error); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }

/* ── Hero ── */
.hero { min-height: 90vh; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; position: relative; padding: 64px 16px; }
.hero-card { max-width: 640px; border-radius: 16px; padding: 48px; }
.hero h1 { font-size: 42px; font-weight: 700; }
@media(min-width:768px) { .hero h1 { font-size: 52px; } }
.hero .subtitle { color: var(--secondary-light); font-size: 18px; margin-top: 16px; }
.hero .actions { display: flex; gap: 16px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }

/* ── Sections ── */
.section { padding: 64px 0; }
.section-title { text-align: center; font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.section-subtitle { text-align: center; color: var(--gray-600); font-size: 18px; margin-bottom: 48px; }

/* ── Grid ── */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ── Product Card ── */
.product-card { text-align: center; display: flex; flex-direction: column; }
.product-card .product-image { background: #EDE9FE; padding: 32px; display: flex; align-items: center; justify-content: center; font-size: 64px; min-height: 200px; }
.product-card .card-body { flex: 1; display: flex; flex-direction: column; }
.product-card .product-name { font-family: var(--font-heading); font-size: 22px; font-weight: 600; margin-top: 0; }
.product-card .product-desc { flex: 1; }
.product-card .product-price { font-family: var(--font-heading); font-size: 28px; font-weight: 700; color: var(--primary); margin-top: 12px; }
.product-card .product-price span { font-size: 14px; font-weight: 400; color: var(--gray-400); }
.product-card .product-actions { margin-top: auto; }

/* ── Steps ── */
.steps { display: flex; gap: 32px; flex-wrap: wrap; justify-content: center; }
.step { text-align: center; flex: 1; min-width: 200px; max-width: 260px; }
.step-number { width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--gray-600); }

/* ── Tabs ── */
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); gap: 0; overflow-x: auto; }
.tab { padding: 12px 24px; font-weight: 500; color: var(--gray-600); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; font-family: var(--font-body); font-size: 14px; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-content { display: none; padding: 24px 0; }
.tab-content.active { display: block; }

/* ── Table ── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px; border-bottom: 2px solid var(--gray-200); font-weight: 600; color: var(--gray-600); }
.table td { padding: 12px; border-bottom: 1px solid var(--gray-100); }
.table tr:hover { background: var(--gray-50); }

/* ── Toast ── */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 16px 20px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.15); animation: slideIn .3s ease; min-width: 300px; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }
.toast-success { background: #DCFCE7; border-left: 4px solid var(--success); color: #166534; }
.toast-error { background: #FEE2E2; border-left: 4px solid var(--error); color: #991B1B; }
.toast-info { background: #DBEAFE; border-left: 4px solid var(--info); color: #1E40AF; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Modal ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); z-index: 200; display: none; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: 16px; max-width: 560px; width: 90%; max-height: 90vh; overflow-y: auto; padding: 32px; box-shadow: 0 25px 50px rgba(0,0,0,.25); }

/* ── Cart Panel ── */
.cart-panel { position: fixed; top: 0; right: 0; width: 400px; max-width: 100vw; height: 100vh; background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,.15); z-index: 300; transform: translateX(100%); transition: transform .3s cubic-bezier(.16,1,.3,1); display: flex; flex-direction: column; }
.cart-panel.open { transform: translateX(0); }
.cart-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--gray-200); }
.cart-panel-body { flex: 1; overflow-y: auto; padding: 24px; }
.cart-panel-footer { padding: 20px 24px; border-top: 1px solid var(--gray-200); }
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 299; display: none; }
.cart-overlay.open { display: block; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-price { color: var(--primary); font-weight: 600; }

/* ── Progress Bar ── */
.progress-bar { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width .3s ease; border-radius: 4px; }

/* ── Color codes ── */
.color-dot { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; color: #fff; font-weight: 700; font-size: 16px; }
.color-RED { background: var(--book-red); }
.color-BLUE { background: var(--book-blue); }
.color-GREEN { background: var(--book-green); }
.color-YELLOW { background: var(--book-yellow); }
.color-PURPLE { background: var(--book-purple); }

/* ── Footer ── */
.footer { background: var(--primary-dark); color: #fff; padding: 48px 0 24px; }
.footer a { color: var(--secondary-light); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer h4 { font-size: 16px; margin-bottom: 12px; }
.footer p, .footer li { font-size: 14px; color: rgba(255,255,255,.7); }
.footer ul { list-style: none; }
.footer li { margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 24px; text-align: center; font-size: 13px; color: rgba(255,255,255,.5); }

/* ── Admin Sidebar ── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--primary-dark); color: #fff; padding: 24px 0; flex-shrink: 0; }
.sidebar .logo { padding: 0 20px 24px; font-family: var(--font-heading); font-weight: 700; font-size: 18px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: rgba(255,255,255,.7); font-size: 14px; font-weight: 500; transition: all 150ms; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; border-left: 3px solid var(--secondary); }
.admin-main { flex: 1; background: var(--gray-50); padding: 24px 32px; overflow-y: auto; }

/* ── KPI Cards ── */
.kpi { text-align: center; padding: 24px; }
.kpi-icon { width: 48px; height: 48px; border-radius: 12px; background: #EDE9FE; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 24px; }
.kpi-value { font-family: var(--font-heading); font-size: 28px; font-weight: 700; }
.kpi-label { font-size: 14px; color: var(--gray-400); margin-top: 4px; }
.kpi-trend { font-size: 14px; font-weight: 500; margin-top: 4px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--error); }

/* ── Quiz cards ── */
.quiz-card { background: var(--gray-50); border: 2px solid var(--gray-200); border-radius: 12px; padding: 20px; cursor: pointer; text-align: center; transition: all 150ms; }
.quiz-card:hover { border-color: var(--primary-light); background: #EDE9FE; }
.quiz-card.selected { border: 3px solid var(--primary); background: #EDE9FE; transform: scale(1.02); box-shadow: 0 0 0 4px rgba(45,27,105,.1); }
.quiz-card .emoji { font-size: 32px; margin-bottom: 8px; display: block; }
.quiz-card .label { font-weight: 500; font-size: 14px; }

/* ── Status dots ── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.green { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.blue { background: var(--info); }
.status-dot.red { background: var(--error); }

/* ── Utility ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 14px; }
.text-muted { color: var(--gray-400); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.p-2 { padding: 16px; } .p-3 { padding: 24px; }
.flex { display: flex; } .flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ── Hamburger Menu ── */
.hamburger { display: none; background: none; border: none; cursor: pointer; font-size: 24px; padding: 4px; line-height: 1; }

@media (max-width: 768px) {
  .hamburger { display: block; }
  .header nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 16px 24px; border-bottom: 1px solid var(--gray-200); box-shadow: 0 4px 12px rgba(0,0,0,.1); gap: 12px; z-index: 99; }
  .header nav.mobile-open { display: flex; }
  .header nav a { font-size: 16px; padding: 8px 0; }
  .header .cart-btn { font-size: 22px; }
  .header-inner { position: relative; }

  /* Hero */
  .hero { min-height: 70vh; padding: 48px 16px; }
  .hero h1 { font-size: 28px !important; }
  .hero .subtitle { font-size: 15px; }
  .hero .actions { flex-direction: column; align-items: center; }
  .hero-card { padding: 32px 20px; }

  /* Sections */
  .section-title { font-size: 24px; }
  .section-subtitle { font-size: 15px; }

  /* Grids */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .steps { flex-direction: column; align-items: center; }

  /* Cart panel */
  .cart-panel { width: 100vw; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }

  /* Product cards */
  .product-card .product-image { min-height: 120px; padding: 20px; }

  /* Admin sidebar */
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; padding: 12px 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px; }
  .sidebar nav a { padding: 8px 12px; font-size: 13px; border-left: none !important; border-radius: 8px; }
  .admin-main { padding: 16px; }

  /* Gift section */
  #gift-section .card { padding: 24px 16px !important; }

  /* Modal */
  .modal { width: 95%; padding: 24px 16px; max-height: 85vh; }
}
