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

:root {
  --brand: #e8401c;
  --brand-dark: #c0321a;
  --dark: #111827;
  --mid: #374151;
  --muted: #6b7280;
  --light: #f3f4f6;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--dark);
  background: var(--white);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Demo Disclaimer Banner ────────────────────────────────── */
.demo-banner {
  background: #fff3cd;
  color: #6b4c00;
  border-bottom: 2px solid #f0c040;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.85rem;
}

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
}
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border-color: var(--dark);
  color: var(--dark);
}
.btn-outline:hover { background: var(--dark); color: var(--white); }

.full-width { width: 100%; text-align: center; }

/* ─── Header ───────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.5px;
}
.logo-icon { color: var(--brand); font-size: 1.1rem; }
.logo-text { color: var(--dark); }

.nav { display: flex; gap: 32px; }
.nav a {
  text-decoration: none;
  color: var(--mid);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition);
}
.nav a:hover { color: var(--brand); }

.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark);
  padding: 4px;
  transition: color var(--transition);
}
.cart-btn:hover { color: var(--brand); }

.cart-count {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--brand);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ─── Hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #111827 0%, #1f2937 50%, #111827 100%);
  color: var(--white);
  padding: 100px 0;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: '';
  position: absolute;
  right: -100px; top: -100px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,64,28,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner { max-width: 640px; }
.hero-tag {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--brand);
  margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 1.1rem;
  color: #9ca3af;
  margin-bottom: 36px;
  max-width: 480px;
}

/* ─── Products Section ─────────────────────────────────────── */
.products-section { padding: 80px 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}
.section-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

/* ─── Product Card ─────────────────────────────────────────── */
.card {
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid #e5e7eb;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }

.card-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 72%;
  overflow: hidden;
  background: var(--light);
}
.card-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-img-wrap img { transform: scale(1.05); }

.card-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--white);
  color: var(--mid);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 14px;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark);
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}
.stars { color: #f59e0b; }

.add-to-cart {
  width: 100%;
  padding: 11px;
  background: var(--dark);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.add-to-cart:hover { background: var(--brand); transform: translateY(-1px); }
.add-to-cart:active { transform: translateY(0); }

/* ─── Cart Drawer ──────────────────────────────────────────── */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
}
.cart-overlay.open { display: block; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 380px;
  height: 100vh;
  background: var(--white);
  box-shadow: -4px 0 40px rgba(0,0,0,0.12);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--light);
}
.cart-header h3 { font-size: 1.2rem; font-weight: 700; }

.close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  transition: color var(--transition);
}
.close-btn:hover { color: var(--dark); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}
.cart-empty { color: var(--muted); text-align: center; padding: 40px 0; }

.cart-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--light);
}
.cart-item img {
  width: 64px; height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.cart-item-price { font-size: 0.85rem; color: var(--brand); font-weight: 700; }

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.qty-btn {
  background: var(--light);
  border: none;
  width: 26px; height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.qty-btn:hover { background: #d1d5db; }
.qty-display { font-size: 0.9rem; font-weight: 600; min-width: 20px; text-align: center; }

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--light);
}
.cart-total {
  font-size: 1rem;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
}
.cart-total strong { font-size: 1.2rem; }

/* ─── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: white;
  padding: 12px 24px;
  border-radius: 40px;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 300;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Footer ───────────────────────────────────────────────── */
.footer {
  background: var(--dark);
  color: #9ca3af;
  padding: 36px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer .logo { color: var(--white); font-size: 1.1rem; }
.footer p { font-size: 0.85rem; }

/* ─── Skeleton Loader ──────────────────────────────────────── */
.skeleton-card {
  border-radius: var(--radius);
  border: 1px solid #e5e7eb;
  overflow: hidden;
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-img { height: 220px; }
.skeleton-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.skeleton-line { height: 14px; border-radius: 6px; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-btn { height: 40px; border-radius: 8px; margin-top: 8px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.card-img-wrap { display: block; text-decoration: none; }
.card-title-link { text-decoration: none; color: inherit; }
.card-title-link:hover .card-title { color: #e8401c; }

/* ─── Simulate Bot Attack Button ───────────────────────────── */
.simulate-btn {
  background: #e8401c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
  transition: background 0.2s;
}
.simulate-btn:hover { background: #c93516; }

.raw-scrape-btn {
  background: #4b5563;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
  transition: background 0.2s;
}
.raw-scrape-btn:hover { background: #374151; }

/* ─── Bot Attack Panel ──────────────────────────────────────── */
.bot-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 900;
}
.bot-overlay.open { display: block; }
.bot-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(680px, 95vw);
  max-height: 80vh;
  background: #0f172a;
  border: 1px solid #e8401c;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(232, 64, 28, 0.3);
  z-index: 950;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  overflow: hidden;
}
.bot-panel.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.bot-panel__header {
  padding: 16px 20px 12px;
  background: rgba(232, 64, 28, 0.12);
  border-bottom: 1px solid rgba(232, 64, 28, 0.3);
  flex-shrink: 0;
}
.bot-panel__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.bot-panel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #475569;
  flex-shrink: 0;
  transition: background 0.3s;
}
.bot-panel__dot.active {
  background: #e8401c;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 64, 28, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(232, 64, 28, 0); }
}
.bot-panel__title {
  color: #e8401c;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex: 1;
}
.bot-panel__close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.bot-panel__close:hover { color: #fff; }
.bot-panel__meta {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: #94a3b8;
  font-family: monospace;
}
.bot-panel__meta code { color: #e2e8f0; background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 4px; }
.bot-panel__body { display: flex; flex-direction: column; overflow: hidden; flex: 1; }
.bot-panel__tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.bot-panel__tab {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.bot-panel__tab--active { color: #e8401c; border-bottom-color: #e8401c; }
.bot-panel__content { padding: 16px 20px; overflow-y: auto; flex: 1; }
.bot-panel__rendered { color: #e2e8f0; line-height: 1.7; font-size: 14px; }
.bot-panel__rendered h1, .bot-panel__rendered h2, .bot-panel__rendered h3 { color: #f8fafc; margin: 12px 0 6px; }
.bot-panel__rendered ul { padding-left: 20px; }
.bot-panel__rendered code { background: #1e293b; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.bot-panel__rendered pre { background: #1e293b; padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 12px; }
.bot-panel__raw { background: #1e293b; border-radius: 8px; padding: 14px; font-family: monospace; font-size: 12px; color: #94a3b8; white-space: pre-wrap; word-break: break-word; }
.bot-panel__status { padding: 0 20px 14px; font-size: 13px; color: #94a3b8; font-family: monospace; flex-shrink: 0; }

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .container { padding: 0 16px; }

  /* Header */
  .nav { display: none; }
  .header-inner { height: auto; min-height: 56px; padding: 8px 0; }
  .logo { font-size: 1rem; }
  .logo-text { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn-label { display: none; }
  .simulate-btn { padding: 8px 10px; font-size: 18px; line-height: 1; margin-right: 6px; }
  .raw-scrape-btn { padding: 8px 10px; font-size: 18px; margin-right: 6px; }

  /* Hero */
  .hero { padding: 56px 0; }
  .hero-sub { font-size: 0.95rem; }

  /* Products */
  .products-section { padding: 48px 0; }
  .product-grid { grid-template-columns: 1fr; gap: 20px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* Cart */
  .cart-drawer { width: 100%; }

  /* Bot panel */
  .bot-panel__meta { flex-direction: column; gap: 4px; }

  /* Toast */
  .toast { width: calc(100% - 48px); white-space: normal; text-align: center; }
}
