:root {
  --bg: #F7F4EF;
  --surface: #FFFFFF;
  --surface-alt: #EFEAE1;
  --ink: #141413;
  --ink-muted: #5C5A55;
  --accent: #D92B2B;
  --accent-hover: #B81F1F;
  --border: #E2DDD3;
  --skeleton-base: #E6E0D6;
  --skeleton-highlight: #F2EEE7;
  --radius: 4px;
  --shadow-sm: 0 2px 8px rgba(20, 20, 19, 0.05);
  --shadow-md: 0 10px 28px rgba(20, 20, 19, 0.09);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg: #121211;
  --surface: #1B1B19;
  --surface-alt: #252421;
  --ink: #F2EFE9;
  --ink-muted: #A39E93;
  --accent: #E63939;
  --accent-hover: #FF4D4D;
  --border: #2E2D29;
  --skeleton-base: #22211E;
  --skeleton-highlight: #2D2C28;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .header {
  background-color: rgba(18, 18, 17, 0.9);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* Announcement Bar */
.announcement-bar {
  background-color: var(--ink);
  color: var(--bg);
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  padding: 0.45rem 1rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(247, 244, 239, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.logo-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.logo-stamp.small {
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
}

.logo-wordmark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.logo-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.7rem;
  color: var(--ink-muted);
  pointer-events: none;
}

.search-input {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem 0.45rem 2.1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink);
  width: 200px;
  transition: border-color 0.2s ease, width 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--ink);
  width: 240px;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 260px;
  background-color: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
  animation: fadeSlideUp 0.18s ease forwards;
}

.search-suggestion-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font-family: var(--font-body);
  color: var(--ink);
  transition: background-color 0.15s ease;
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item:focus-visible {
  background-color: var(--surface-alt);
  outline: none;
}

.suggestion-title {
  font-size: 0.86rem;
  font-weight: 700;
}

.suggestion-meta {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.icon-btn {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--ink);
  background-color: var(--surface-alt);
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: var(--accent);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Main */
.main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 4.5rem;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem;
  background-color: var(--surface);
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  margin-bottom: 2.75rem;
  animation: fadeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.hero-desc {
  color: var(--ink-muted);
  font-size: 1.02rem;
  max-width: 54ch;
  margin-bottom: 1.5rem;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--ink);
  color: #ffffff;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 0.7rem 1.35rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-primary:hover {
  background-color: var(--accent);
  border-color: var(--accent);
}

.btn-primary.full-width {
  width: 100%;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--ink);
  background-color: var(--surface-alt);
}

/* Manga Panel Spotlight */
.manga-panel-card {
  background-color: var(--ink);
  color: var(--bg);
  padding: 1.65rem;
  border: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.panel-tag {
  background-color: var(--accent);
  color: #ffffff;
  padding: 0.2rem 0.5rem;
  font-weight: 700;
}

.panel-vol {
  color: #b8b2a6;
}

.panel-title-jp {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.panel-meta {
  font-size: 0.9rem;
  color: #d1cbc0;
}

.panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.85rem;
}

.panel-price {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

/* Catalog Controls */
.catalog-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.filter-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  background-color: var(--surface-alt);
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.filter-pill {
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.filter-pill:hover {
  color: var(--ink);
  background-color: rgba(255, 255, 255, 0.7);
}

.filter-pill.active {
  background-color: var(--ink);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(20, 20, 19, 0.18);
}

.catalog-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Grid de productos */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 1.5rem;
}

/* Tarjeta de producto */
.product-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.2s ease;
}

.product-card.fade-in {
  animation: fadeSlideUp 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--stagger, 0) * 45ms);
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
  box-shadow: var(--shadow-md);
}

.product-card:hover .product-image {
  transform: scale(1.04);
}

.product-image {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-cover-wrap {
  position: relative;
  background-color: var(--surface-alt);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-genre-tag {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  background-color: rgba(20, 20, 19, 0.88);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}

.product-body {
  padding: 1.05rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-author {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}

.product-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.45rem;
}

.product-desc {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.product-price {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.add-to-cart-btn {
  padding: 0.5rem 0.85rem;
  background-color: var(--ink);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.add-to-cart-btn:hover {
  background-color: var(--accent);
}

/* Skeleton Loader */
.skeleton-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  padding-bottom: 1.05rem;
}

.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-highlight) 50%,
    var(--skeleton-base) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  margin-bottom: 1rem;
}

.skeleton-line {
  height: 13px;
  border-radius: 3px;
  margin: 0 1.05rem 0.6rem;
}

.skeleton-line.title {
  width: 72%;
  height: 18px;
}

.skeleton-line.price {
  width: 35%;
}

.skeleton-line.desc {
  width: 88%;
}

.skeleton-btn {
  height: 36px;
  margin: 0.85rem 1.05rem 0;
  border-radius: var(--radius);
}

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

.fade-in {
  animation: fadeIn 0.35s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll-sentinel {
  height: 24px;
  margin-top: 2rem;
}

.end-message {
  text-align: center;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 1.5rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background-color: var(--surface);
  padding: 2rem 1.5rem;
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand p,
.footer-copy {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* Cart Drawer & Modal */
.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(20, 20, 19, 0.5);
  z-index: 200;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  background-color: var(--surface);
  border-left: 1px solid var(--ink);
  z-index: 210;
  display: flex;
  flex-direction: column;
}

.drawer-header,
.modal-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h2,
.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-empty {
  color: var(--ink-muted);
  font-size: 0.92rem;
  text-align: center;
  margin-top: 2rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.cart-item-info strong {
  display: block;
  font-size: 0.92rem;
}

.cart-item-info span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 3px;
  cursor: pointer;
  font-weight: 700;
}

.drawer-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  background-color: var(--bg);
}

.drawer-subtotal {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  font-size: 1rem;
}

.drawer-subtotal strong {
  font-family: var(--font-mono);
}

.modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background-color: var(--surface);
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  width: min(400px, 100%);
}

.modal-form {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.form-field input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--ink);
  color: #ffffff;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  z-index: 300;
  box-shadow: var(--shadow-md);
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 1.75rem;
  }

  .nav {
    display: none;
  }

  .search-input {
    width: 145px;
  }

  .search-input:focus {
    width: 175px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
