/* ════════════════════════════════════════════════════════════════════════
   TOMODATCHI SHOP — core styles
   Ported from the main tomodatchi.net character-directory design system.
   ════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #ffffff;
  --grid: rgba(148,179,215,0.18);
  --ink: #2e37fb;
  --muted: #9099ac;
  --border: #c8d8ec;
  --border-soft: #e8f0f9;
  --card-border: 4px;
  --card-border-outer: 8px;
  --radius: 24px;
  --nav-h: 72px;
  --logo-blue: #2e37fb;

  --card-art-height: 200px;
  --card-img-maxheight: 160px;
  --card-img-hover-scale: 1.14;

  /* Site palette — pale grey-blue replaces the 5-colour card system */
  --card-bg: #eaf4fd;
  --card-shade: #d4e8f5;

  /* 5-colour palette kept for reference/other uses */
  --c-pink:   #ffa1bc; --c-pink-shade:   #dc86b9;
  --c-amber:  #ffd39e; --c-amber-shade:  #edbe9f;
  --c-green:  #affcbd; --c-green-shade:  #91cfbd;
  --c-blue:   #9cd8f7; --c-blue-shade:   #8dc1f0;
  --c-purple: #c3a6ff; --c-purple-shade: #9f88f5;
}

html { scroll-behavior: smooth; }

body.tomo-theme {
  font-family: 'Nunito', sans-serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  color: var(--ink);
  min-height: 100vh;
  margin: 0;
  padding-top: var(--nav-h);
}

img { max-width: 100%; height: auto; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px);
}

/* ─── NAV ─── */
.tomo-nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 9999;
  background: rgba(255,255,255,0.93);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  /* Extra bottom padding so the logo (which overflows) doesn't clip border */
  padding: 0 36px 0 36px;
  height: var(--nav-h);
  gap: 20px;
  /* Logo renders on top of everything */
  overflow: visible;
}

.tomo-nav-left { display: flex; align-items: center; min-width: 0; position: relative; z-index: 2; }
.tomo-nav-center { display: flex; align-items: center; justify-content: center; }
.tomo-nav-right { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; }

/* Logo — overflows the nav downward so the outline blends with the nav border.
   The mockup shows the logo sitting in the upper-left, its bottom fringe
   dipping below the nav border line and the grey-blue outline tracing
   seamlessly into that border. We achieve this by:
     • giving the nav overflow:visible
     • pulling the logo DOWN so it extends below the nav bar
     • applying a white inner outline then a #c8d8ec outer outline that
       matches --border, which visually stitches to the nav bottom border */
.tomo-logo-wrap {
  display: flex; align-items: flex-end; text-decoration: none; gap: 8px;
  position: relative;
  /* Push logo down so bottom of image overlaps the nav border */
  margin-bottom: -22px;
  z-index: 10;
}
.tomo-logo-wrap img {
  height: 72px; width: auto; display: block;
  /* Layer 1 — white "fat" outline traces the logo shape */
  /* Layer 2 — grey-blue outline matches the nav bottom border (#c8d8ec)
     so the logo outline appears to grow seamlessly from the bar */
  filter:
    drop-shadow( 0px  4px 0px #fff) drop-shadow( 0px -4px 0px #fff)
    drop-shadow( 4px  0px 0px #fff) drop-shadow(-4px  0px 0px #fff)
    drop-shadow( 3px  3px 0px #fff) drop-shadow(-3px  3px 0px #fff)
    drop-shadow( 3px -3px 0px #fff) drop-shadow(-3px -3px 0px #fff)
    drop-shadow( 0px  7px 0px #c8d8ec) drop-shadow( 0px -7px 0px #c8d8ec)
    drop-shadow( 7px  0px 0px #c8d8ec) drop-shadow(-7px  0px 0px #c8d8ec)
    drop-shadow( 5px  5px 0px #c8d8ec) drop-shadow(-5px  5px 0px #c8d8ec)
    drop-shadow( 5px -5px 0px #c8d8ec) drop-shadow(-5px -5px 0px #c8d8ec);
}
.tomo-logo-text {
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 1.05rem;
  color: var(--ink);
}

.tomo-nav-links { display: flex; gap: 2px; }
.tomo-nav-links a {
  font-family: 'Fredoka', sans-serif; font-size: 0.95rem; font-weight: 500;
  text-decoration: none; color: var(--muted);
  padding: 5px 14px; border-radius: 100px;
  transition: background 0.15s, color 0.15s;
  display: inline-block;
}
.tomo-nav-links a:hover { background: var(--border-soft); color: var(--ink); }
.tomo-nav-links li.current-menu-item > a,
.tomo-nav-links a.active { background: var(--ink); color: #fff; }

/* Search — deep blue rounded button */
.tomo-nav-search { position: relative; display: flex; align-items: center; }
.tomo-nav-search input[type="search"] {
  font-family: 'Nunito', sans-serif; font-size: 0.85rem;
  width: 0; opacity: 0; padding: 0; border: none;
  background: var(--border-soft); border-radius: 100px;
  transition: width 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
  height: 34px;
}
.tomo-nav-search.open input[type="search"] {
  width: 160px; opacity: 1; padding: 0 14px;
}
.tomo-nav-search button {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--ink); background: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tomo-nav-search button:hover { background: #1c24d9; border-color: #1c24d9; }

/* Cart pill */
.tomo-cart-link {
  display: flex; align-items: center; gap: 7px;
  font-family: 'Fredoka', sans-serif; font-size: 0.85rem; font-weight: 600;
  background: var(--border-soft); border: 2px solid var(--border);
  border-radius: 100px; padding: 5px 14px 5px 10px;
  text-decoration: none; color: var(--ink);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.tomo-cart-link:hover { background: var(--ink); color: #fff; border-color: var(--ink); transform: scale(1.04); }
.tomo-cart-icon { width: 18px; height: 18px; flex-shrink: 0; }
.tomo-cart-count {
  background: var(--ink); color: #fff;
  font-size: 0.68rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 2px;
}
.tomo-cart-link:hover .tomo-cart-count { background: #fff; color: var(--ink); }

/* Lang toggle */
.lang-toggle {
  display: flex; align-items: center;
  background: var(--border-soft); border: 2px solid var(--border);
  border-radius: 100px; padding: 3px; gap: 0;
}
.lang-btn {
  font-family: 'Fredoka', sans-serif; font-size: 0.72rem; font-weight: 600;
  padding: 3px 10px; border-radius: 100px; border: none;
  background: transparent; cursor: pointer; color: var(--muted);
  transition: background 0.14s, color 0.14s; line-height: 1;
}
.lang-btn.active { background: var(--ink); color: #fff; }

/* Mobile nav toggle */
.tomo-nav-burger {
  display: none; width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--border); background: #fff; cursor: pointer;
  align-items: center; justify-content: center; color: var(--ink);
}

.tomo-nav-mobile-links { display: none; }

@media (max-width: 900px) {
  .tomo-nav { padding: 0 18px; grid-template-columns: auto 1fr auto; }
  .tomo-nav-center { display: none; }
  .tomo-nav-burger { display: flex; }
  .tomo-nav-mobile-links {
    position: fixed; top: var(--nav-h); left: 0; width: 100%;
    background: #fff; border-bottom: 2px solid var(--border);
    flex-direction: column; padding: 10px 18px 18px; gap: 4px;
    z-index: 9998;
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  }
  .tomo-nav-mobile-links.open { display: flex; }
  .tomo-nav-mobile-links a {
    font-family: 'Fredoka', sans-serif; font-weight: 500; color: var(--muted);
    text-decoration: none; padding: 10px 12px; border-radius: 14px;
  }
  .tomo-nav-mobile-links a.active,
  .tomo-nav-mobile-links li.current-menu-item > a { background: var(--border-soft); color: var(--ink); }
}

/* ─── PAGE WRAPPER ─── */
.tomo-shop-wrap {
  width: 100%;
  padding: 40px 36px 80px;
  max-width: 1400px;
  margin: 0 auto;
}
.tomo-shop-inner { width: 100%; }

.tomo-shop-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 1000px) {
  .tomo-shop-layout { grid-template-columns: 1fr; }
}

/* Page heading band */
.tomo-page-head {
  text-align: center;
  padding: 12px 24px 36px;
}
.tomo-page-eyebrow {
  font-family: 'Fredoka', sans-serif; font-size: 0.78rem; font-weight: 500;
  color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase;
  margin: 0 0 6px;
}
.tomo-page-title {
  font-family: 'Fredoka', sans-serif; font-size: 2.2rem; font-weight: 700;
  color: var(--ink); margin: 0;
}

/* ─── FOOTER ─── */
.tomo-footer {
  border-top: 2px solid var(--border-soft);
  padding: 28px 36px 36px;
  text-align: center;
  font-family: 'Fredoka', sans-serif; font-size: 0.8rem; color: var(--muted);
}
.tomo-footer a { text-decoration: none; color: var(--muted); }
.tomo-footer a:hover { color: var(--ink); }
.tomo-footer-links { display: flex; justify-content: center; gap: 18px; margin-bottom: 10px; flex-wrap: wrap; }

/* ─── BUTTONS (shared pill style) ─── */
.tomo-btn {
  font-family: 'Fredoka', sans-serif; font-size: 0.92rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #fff !important;
  border: 2.5px solid var(--ink); border-radius: 100px;
  padding: 11px 26px; cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.18s;
  box-shadow: 0 4px 14px rgba(46,55,251,0.18);
}
.tomo-btn:hover { background: #1c24d9; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(46,55,251,0.26); }
.tomo-btn:active { transform: translateY(0); }
.tomo-btn-outline {
  background: #fff; color: var(--ink) !important; border-color: var(--border);
  box-shadow: 0 4px 14px rgba(160,184,210,0.25);
}
.tomo-btn-outline:hover { background: var(--border-soft); border-color: var(--ink); }
.tomo-btn-block { width: 100%; }
.tomo-btn[disabled], .tomo-btn.disabled {
  opacity: 0.5; cursor: not-allowed; transform: none !important;
}

/* Generic blue-bordered "sticker card" panel */
.tomo-panel {
  background: #fff;
  border: var(--card-border-outer) solid var(--logo-blue);
  border-radius: var(--radius);
  box-shadow: 4px 5px 8px rgba(160,184,210,0.45);
  overflow: hidden;
}

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim { animation: fadeUp 0.42s cubic-bezier(0.22,1,0.36,1) both; }
.anim-d1 { animation-delay: 0.06s; }
.anim-d2 { animation-delay: 0.12s; }
.anim-d3 { animation-delay: 0.18s; }

@keyframes bgDriftStripes {
  from { background-position: 0 0; }
  to   { background-position: -28px 28px; }
}
@keyframes popOutline {
  0%   { filter: none; }
  40%  {
    filter:
      drop-shadow( 0px   3px 0px white) drop-shadow( 0px  -3px 0px white)
      drop-shadow( 3px   0px 0px white) drop-shadow(-3px   0px 0px white)
      drop-shadow( 2px   2px 0px white) drop-shadow(-2px   2px 0px white)
      drop-shadow( 2px  -2px 0px white) drop-shadow(-2px  -2px 0px white)
      drop-shadow(-4px   4px 0px #2e37fb);
  }
  100% {
    filter:
      drop-shadow( 0px   3px 0px white) drop-shadow( 0px  -3px 0px white)
      drop-shadow( 3px   0px 0px white) drop-shadow(-3px   0px 0px white)
      drop-shadow( 2px   2px 0px white) drop-shadow(-2px   2px 0px white)
      drop-shadow( 2px  -2px 0px white) drop-shadow(-2px  -2px 0px white)
      drop-shadow(-4px   4px 0px #2e37fb);
  }
}

/* ─── VARIANT PICKER DIALOGUE (visual novel style) ─── */
.tomo-vn-overlay {
  position: fixed; inset: 0;
  background: rgba(20,24,40,0.35);
  z-index: 19000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.tomo-vn-overlay.open { opacity: 1; pointer-events: all; }

.tomo-vn-panel {
  position: fixed;
  bottom: 40px;
  left: 50%; transform: translateX(-50%) translateY(20px);
  width: min(480px, 92vw);
  background: #fff;
  border: 6px solid var(--logo-blue);
  border-radius: 22px;
  box-shadow: 0 16px 48px rgba(46,55,251,0.22), 4px 5px 8px rgba(160,184,210,0.5);
  padding: 20px 22px 22px;
  z-index: 19001;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22,1,0.36,1);
  pointer-events: none;
}
.tomo-vn-overlay.open .tomo-vn-panel {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}
.tomo-vn-title {
  font-family: 'Fredoka', sans-serif; font-size: 0.72rem; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em;
  margin: 0 0 6px;
}
.tomo-vn-product-name {
  font-family: 'Fredoka', sans-serif; font-size: 1.05rem; font-weight: 700;
  color: var(--logo-blue); margin: 0 0 16px;
}
.tomo-vn-attr-label {
  font-family: 'Fredoka', sans-serif; font-size: 0.72rem; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em;
  margin: 0 0 8px;
}
.tomo-vn-choices {
  display: flex; flex-direction: column; gap: 8px;
}
.tomo-vn-choice {
  font-family: 'Fredoka', sans-serif; font-size: 0.95rem; font-weight: 600;
  background: var(--border-soft); border: 2.5px solid var(--border);
  border-radius: 100px; padding: 10px 20px;
  cursor: pointer; color: var(--ink); text-align: left;
  transition: background 0.14s, border-color 0.14s, transform 0.14s;
  display: flex; align-items: center; gap: 10px;
}
.tomo-vn-choice::before {
  content: '▷';
  font-size: 0.75rem; color: var(--muted);
  flex-shrink: 0;
  transition: color 0.14s;
}
.tomo-vn-choice:hover {
  background: var(--ink); color: #fff; border-color: var(--ink);
  transform: translateX(4px);
}
.tomo-vn-choice:hover::before { color: rgba(255,255,255,0.7); }
.tomo-vn-choice.out-of-stock {
  opacity: 0.45; cursor: not-allowed; pointer-events: none;
}
.tomo-vn-close {
  position: absolute; top: 14px; right: 16px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border); background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px;
  transition: background 0.14s, color 0.14s;
}
.tomo-vn-close:hover { background: var(--border-soft); color: var(--ink); }

@media (max-width: 600px) {
  .tomo-shop-wrap { padding: 24px 16px 60px; }
  .tomo-page-title { font-size: 1.6rem; }
  .tomo-vn-panel { bottom: 16px; }
}
