/* "Printed manga page" theme: paper, ink, hard shadows. */
:root {
  --paper: #ebe4d3;
  --ink: #1a1a1a;
  --card: #faf6ec;
  --cover: #2a2a2a;
  --accent: #e63946;
  --sticker: #ffd60a;
  --wa: #25d366;
  --in: #157a3b;      /* darker than pure green for AA contrast on --card */
  --muted: #5c5a55;

  --border: 3px solid var(--ink);
  --border-thin: 2px solid var(--ink);
  --radius: 3px;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.display { font-family: Bangers, Impact, sans-serif; font-weight: 400; letter-spacing: .04em; }

/* Screentone: halftone dots. Override --tone to change dot color. */
.screentone {
  background-image: radial-gradient(var(--tone, var(--ink)) 1px, transparent 1.3px);
  background-size: 7px 7px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border: var(--border); border-radius: var(--radius);
  font-weight: 800; text-decoration: none; cursor: pointer; font: inherit; font-weight: 800;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn-wa { background: var(--wa); color: var(--ink); box-shadow: var(--shadow-sm); }
/* White on --accent is 4.17:1, so CTA text stays "large" (>=18.66px bold) to pass AA at 3:1. */
.btn-cta { background: var(--accent); color: #fff; box-shadow: var(--shadow); font-size: 1.2rem; }
.btn-small { padding: 6px 14px; font-size: .9rem; border-width: 2px; }
.btn-small:hover { box-shadow: 4px 4px 0 var(--ink); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; }
.logo {
  font-family: Bangers, Impact, sans-serif; font-size: 1.9rem; letter-spacing: .04em; line-height: 1;
  color: var(--accent); text-decoration: none; text-shadow: 2px 2px 0 var(--ink);
}
.header-right { display: flex; align-items: center; gap: 16px; }
.header-address { font-size: .85rem; font-weight: 600; color: var(--muted); }

/* Hero: a two-panel manga page */
.hero { padding: 28px 0 8px; }
.hero-panel {
  display: grid; grid-template-columns: 1.15fr 1fr;
  background: var(--card); border: var(--border); box-shadow: var(--shadow);
}
.hero-text { padding: 32px 28px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; border-right: var(--border); min-width: 0; }
.hero-label {
  display: inline-block; background: var(--ink); color: var(--paper);
  padding: 4px 12px; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  transform: rotate(-2deg);
}
.hero-title {
  font-family: Bangers, Impact, sans-serif; font-weight: 400; letter-spacing: .03em;
  font-size: clamp(2.6rem, 6.5vw, 4.6rem); line-height: .95; margin: 0; overflow-wrap: anywhere;
}
.hero-meta { margin: 0; font-weight: 600; color: var(--muted); font-size: 1.05rem; }
.hero-price { font-family: Bangers, Impact, sans-serif; font-weight: 400; color: var(--ink); font-size: 1.7rem; letter-spacing: .03em; }
.hero-art { position: relative; display: flex; align-items: center; justify-content: center; padding: 36px 24px; overflow: hidden; background-color: var(--paper); min-height: 320px; }
.hero-cover {
  all: unset; cursor: pointer; width: min(220px, 60%); aspect-ratio: 2 / 3;
  border: var(--border); box-shadow: var(--shadow); transform: rotate(3deg); transition: transform .15s;
  background: var(--card); overflow: hidden;
}
.hero-cover:hover { transform: rotate(1deg) scale(1.02); }
.hero-cover:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.hero-cover .cover-fallback, .hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.sfx {
  position: absolute; top: 14px; right: 18px;
  font-family: Bangers, Impact, sans-serif; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1;
  color: var(--accent); letter-spacing: .04em; transform: rotate(12deg);
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink);
  pointer-events: none;
}

/* Search */
.search { display: block; padding: 24px 0 4px; }
.search input {
  width: 100%; padding: 14px 16px; font: inherit; font-size: 1rem;
  border: var(--border); border-radius: var(--radius); background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.search input:focus { outline: none; box-shadow: 5px 5px 0 var(--accent); }

/* Category pills */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 16px 4px 12px 0; scrollbar-width: none; }
.tab {
  flex: none; padding: 6px 14px; cursor: pointer; font: inherit; font-weight: 800;
  border: var(--border-thin); border-radius: var(--radius); background: var(--card); color: var(--ink);
}
.tab:hover { background: var(--paper); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tab-count { opacity: .7; font-weight: 600; margin-left: 2px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-bottom: 20px; }
.toolbar select {
  padding: 7px 10px; border: var(--border-thin); border-radius: var(--radius);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600; max-width: 100%;
}
.checkbox { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; }
.checkbox input { accent-color: var(--ink); width: 16px; height: 16px; }
.result-count { margin-left: auto; color: var(--muted); font-size: .9rem; font-weight: 600; }

/* Product grid + cards */
.grid {
  display: grid; gap: 20px; padding: 4px 0 56px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.card {
  background: var(--card); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translate(-2px, -3px) rotate(-1deg); box-shadow: 7px 8px 0 var(--ink); }
.card-button { all: unset; display: flex; flex-direction: column; height: 100%; width: 100%; cursor: pointer; }
.card-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.cover { position: relative; aspect-ratio: 2 / 3; border-bottom: var(--border); background: var(--cover); }
.cover > img, .cover > .cover-fallback { width: 100%; height: 100%; object-fit: cover; }
.card.is-out .cover > img, .card.is-out .cover > .cover-fallback { filter: grayscale(1); opacity: .55; }

/* The one fallback cover: ink + screentone + title */
.cover-fallback {
  --tone: rgb(255 255 255 / .25);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 14px;
  background-color: var(--cover); color: var(--paper);
  background-image: radial-gradient(var(--tone) 1px, transparent 1.3px);
  background-size: 7px 7px;
}
.cover-fallback-title { font-family: Bangers, Impact, sans-serif; font-size: 1.55rem; line-height: 1; letter-spacing: .03em; overflow-wrap: anywhere; }
.cover-fallback-volume { font-family: Bangers, Impact, sans-serif; font-size: 2.6rem; line-height: 1; color: var(--accent); }

/* Stickers and stamps on the cover */
.sticker {
  position: absolute; left: -6px; top: 26px; z-index: 1;
  background: var(--sticker); color: var(--ink); border: var(--border-thin);
  padding: 2px 8px; font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em;
  transform: rotate(-4deg); box-shadow: 2px 2px 0 var(--ink);
}
.stamp {
  position: absolute; top: -10px; right: -10px; z-index: 1;
  background: var(--accent); color: #fff; border: var(--border-thin);
  /* 24px = WCAG "large text", needed for white on --accent */
  padding: 3px 7px; font-family: Bangers, Impact, sans-serif; font-size: 1.5rem; letter-spacing: .04em; line-height: 1;
  transform: rotate(8deg); box-shadow: 2px 2px 0 var(--ink);
}
.sold-out {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) rotate(-8deg);
  background: var(--card); border: var(--border); padding: 4px 10px; white-space: nowrap;
  font-family: Bangers, Impact, sans-serif; font-size: 1.3rem; letter-spacing: .05em;
}

.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag {
  font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  border: 1.5px solid var(--ink); padding: 0 5px; border-radius: 2px;
}
.tag-cond { background: var(--ink); color: var(--paper); }
.card-title { font-size: .95rem; font-weight: 700; margin: 2px 0 0; line-height: 1.25; }
.card-meta { font-size: .8rem; color: var(--muted); margin: 0; }
.card-footer { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; }

.prices { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price { font-family: Bangers, Impact, sans-serif; font-size: 1.55rem; letter-spacing: .03em; line-height: 1; }
.old-price { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stock-text { font-size: .75rem; font-weight: 700; }
.stock-in { color: var(--in); }
.stock-out { color: var(--muted); }

.empty { grid-column: 1 / -1; text-align: center; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty p { margin: 0; font-weight: 600; }

/* Product dialog */
.product-dialog {
  width: min(860px, calc(100% - 32px)); max-height: calc(100% - 32px);
  padding: 0; border: var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--ink); box-shadow: 8px 8px 0 var(--ink); overflow: auto;
}
.product-dialog::backdrop { background: rgb(17 17 17 / .6); }
.dialog-close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px;
  border: var(--border-thin); border-radius: var(--radius); background: var(--card); color: var(--ink);
  font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: 2px 2px 0 var(--ink);
}
.dialog-content { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.dialog-cover { position: relative; border-right: var(--border); background: var(--cover); }
.dialog-cover > img, .dialog-cover > .cover-fallback { width: 100%; height: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.dialog-info { padding: 28px 24px 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.dialog-info h2 { font-family: Bangers, Impact, sans-serif; font-weight: 400; letter-spacing: .03em; font-size: 2.2rem; line-height: 1; margin: 0; padding-right: 40px; }
.dialog-info .price { font-size: 2.2rem; }
.description { margin: 0; color: var(--muted); }
.details { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; font-size: .9rem; border-top: var(--border-thin); padding-top: 10px; width: 100%; }
.details dt { color: var(--muted); font-weight: 600; }
.details dd { margin: 0; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: .9rem; }
.field select { padding: 8px 10px; border: var(--border-thin); border-radius: var(--radius); background: var(--card); color: var(--ink); font: inherit; min-width: 140px; }
.dialog-info .btn { margin-top: 8px; width: 100%; }
.dialog-info .sticker, .dialog-info .stamp { position: static; display: inline-block; }

/* Footer */
.site-footer { position: relative; z-index: 1; border-top: var(--border); background: var(--card); padding: 28px 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; }
.footer-inner p { margin: 2px 0; }
.footer-info { flex: 1 1 220px; }
.footer-title { font-family: Bangers, Impact, sans-serif; font-size: 1.6rem; color: var(--ink); letter-spacing: .04em; }
.footer-links { display: flex; gap: 16px; font-weight: 800; margin-top: 8px; }
.footer-links a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.footer-links a:hover { color: var(--accent); }
.footer-note { width: 100%; font-size: .8rem; color: var(--muted); }

/* Store logo in a sticker frame. White on purpose (not --card) so the logo's own
   white background blends into the frame. Never wider than the 150px source. */
.logo-sticker {
  display: inline-block; flex: none; line-height: 0;
  background: #fff; border: var(--border); box-shadow: var(--shadow);
  padding: 8px; transform: rotate(-3deg); transition: transform .15s;
}
.logo-sticker img { max-width: 150px; width: 100%; height: auto; }
.footer-sticker:hover { transform: rotate(0deg); }

/* Small shop stamp in the hero's bottom-right corner */
.hero-text { position: relative; }
.hero-stamp {
  position: absolute; right: 18px; bottom: 18px; width: 72px; padding: 4px;
  border-width: 2px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(6deg);
}

/* Floating WhatsApp (small screens only) */
.wa-float {
  display: none; position: fixed; right: 16px; bottom: 16px; z-index: 30;
  width: 58px; height: 58px; align-items: center; justify-content: center;
  background: var(--wa); color: var(--ink); border: var(--border); border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 760px) {
  .hero-panel { grid-template-columns: 1fr; }
  .hero-text { border-right: 0; border-bottom: var(--border); padding: 24px 18px; order: 2; }
  .hero-art { order: 1; min-height: 0; padding: 28px 16px; }
  .hero-cover { width: min(170px, 50%); }
  .header-address { display: none; }
}

@media (max-width: 640px) {
  .header-right .btn-wa { display: none; }
  .hero-stamp { display: none; }
  .wa-float { display: flex; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .card { box-shadow: var(--shadow-sm); }
  .price { font-size: 1.3rem; }
  .cover-fallback-title { font-size: 1.2rem; }
  .cover-fallback-volume { font-size: 2rem; }
  .result-count { margin-left: 0; width: 100%; }
  .dialog-content { grid-template-columns: 1fr; }
  .dialog-cover { border-right: 0; border-bottom: var(--border); max-height: 300px; overflow: hidden; }
  .site-footer { padding-bottom: 96px; }
}

/* Decorative comic pages in the side margins (wide screens only).
   Pure CSS: no images, no artwork. Content max width is 1200px, so each margin is 50% - 600px. */
.side-comic { display: none; }
@media (min-width: 1400px) {
  .side-comic {
    --extra: 160px; /* extra height consumed by the parallax */
    position: fixed; top: 0; z-index: 0; pointer-events: none;
    width: calc(50% - 600px - 24px);
    height: calc(100vh + var(--extra));
    padding: 84px 0 24px;
    display: flex; flex-direction: column; gap: 12px; /* gap = paper gutter */
    opacity: .22;
    will-change: transform;
  }
  .side-left { left: 12px; }
  .side-right { right: 12px; }
}
.side-comic .panel {
  position: relative; flex: var(--h, 2) 1 0; min-height: 0; overflow: hidden;
  border: var(--border); background-color: var(--card);
  display: flex; align-items: center; justify-content: center;
}
.panel.skew-l { transform: skewY(-2deg); }
.panel.skew-r { transform: skewY(2deg); }
.fill-tone { background-image: radial-gradient(var(--ink) 1px, transparent 1.3px); background-size: 7px 7px; }
.fill-speed { background-image: repeating-conic-gradient(from 0deg at 30% 55%, var(--ink) 0deg 2deg, transparent 2deg 9deg); }
.fill-speed-r { background-image: repeating-conic-gradient(from 3deg at 70% 40%, var(--ink) 0deg 1.5deg, transparent 1.5deg 7deg); }
.fill-hatch { background-image: repeating-linear-gradient(45deg, var(--ink) 0 1.5px, transparent 1.5px 7px); }
.fill-hatch-x {
  background-image:
    repeating-linear-gradient(45deg, var(--ink) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(-45deg, var(--ink) 0 1px, transparent 1px 8px);
}
.panel-sfx {
  font-family: Bangers, Impact, sans-serif; color: var(--ink); line-height: .9; text-align: center;
  font-size: clamp(1.4rem, 3.2vw, 4rem); letter-spacing: .03em; transform: rotate(-8deg);
  background: var(--card); padding: 0 .15em;
}
.panel-sfx.tilt { transform: rotate(10deg); }
.bubble {
  position: relative; width: 62%; aspect-ratio: 1.5; border: var(--border); border-radius: 50%;
  background: var(--card);
}
.bubble::after { /* tail */
  content: ""; position: absolute; left: 22%; bottom: -16px;
  border: 10px solid transparent; border-top: 16px solid var(--ink); border-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .card:hover { transform: none; }
  .side-comic { transform: none !important; }
}
