/* Each theme uses the same storefront markup, including its original media and copy. */
[data-page="store"][data-theme] {
  color-scheme: light;
  accent-color: var(--accent);
}

[data-page="store"][data-theme] .product-card {
  min-inline-size: 0;
}

[data-page="store"][data-theme] :is(.hero-copy, .hero-media, .product-body) {
  min-inline-size: 0;
}

[data-page="store"][data-theme] .hero-inner:not(:has(.hero-media)) {
  grid-template-columns: minmax(0, 1fr);
}

[data-page="store"][data-theme] :is(.hero-media, .product-image) img {
  display: block;
  max-inline-size: 100%;
  object-fit: contain;
}

/* A · Terracotta */
[data-theme="a"] {
  --background: #f8f3ee;
  --surface: #fffdfb;
  --text: #271916;
  --muted: #6d514b;
  --accent: #a93424;
  --on-accent: #ffffff;
  --line: #e5d6ce;
  --radius: 12px;
  --shadow: 0 10px 28px #4020150b;
  --display-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --body-font: var(--display-font);
}

[data-theme="a"] .site-header {
  background: var(--surface);
  border-block-start: 4px solid var(--accent);
}

[data-theme="a"] .hero {
  background: #fae0d6;
  border-block-end: 1px solid #eac3b4;
}

[data-theme="a"] .hero-inner {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 5vw, 5.25rem);
  align-items: center;
}

[data-theme="a"] .hero-media {
  background: #fff6ef;
  border: 1px solid #f4cabe;
  border-radius: 2rem 2rem 2rem 0.35rem;
}

[data-theme="a"] .product-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

[data-theme="a"] .product-card {
  border: 1px solid var(--line);
  background: var(--surface);
}

[data-theme="a"] .product-body {
  border-block-start: 1px solid var(--line);
}

[data-theme="a"] .section-head {
  border-block-end: 2px solid var(--text);
  padding-block-end: 0.85rem;
}

/* B · Atelier */
[data-theme="b"] {
  --background: #fffcf6;
  --surface: #fffcf6;
  --text: #35251f;
  --muted: #6b584d;
  --accent: #644237;
  --on-accent: #ffffff;
  --line: #dacfc0;
  --radius: 0px;
  --shadow: none;
  --display-font: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  --body-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

[data-theme="b"] .header-inner {
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

[data-theme="b"] .brand {
  inline-size: 100%;
  font-family: var(--display-font);
  font-weight: 600;
  letter-spacing: 0.12em;
}

[data-theme="b"] .header-inner .main-nav {
  justify-content: center;
  font-size: 0.875rem;
}

[data-theme="b"] .hero-inner {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
}

[data-theme="b"] .hero-media:not([hidden]) {
  grid-column: 1;
  grid-row: 1;
  border: clamp(0.5rem, 1.25vw, 1rem) solid #f1e9dc;
  background: #f1e9dc;
  box-shadow: 0 0 0 1px var(--line);
}

[data-theme="b"] .hero-copy:has(+ .hero-media:not([hidden])) {
  grid-column: 2;
  grid-row: 1;
}

[data-theme="b"] .hero-copy :is(h1, h2) {
  font-weight: 500;
  letter-spacing: 0.035em;
}

[data-theme="b"] .section-head {
  border-block: 1px solid var(--line);
  justify-content: center;
  padding-block: 0.8rem;
  text-align: center;
}

[data-theme="b"] .product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(1rem, 4vw, 3rem);
  row-gap: 2rem;
}

[data-theme="b"] .product-card {
  border: 0;
  border-block-end: 1px solid var(--line);
  background: transparent;
}

[data-theme="b"] .product-image {
  border: 1px solid var(--line);
}

[data-theme="b"] .product-body {
  padding-inline: 0;
}

[data-theme="b"] .product-body :is(h2, h3) {
  font-family: var(--display-font);
  font-weight: 600;
}

/* C · Night Grid */
[data-page="store"][data-theme="c"] {
  color-scheme: dark;
  --background: #101419;
  --surface: #1a222b;
  --text: #f4f7f4;
  --muted: #b2bec6;
  --accent: #c5fb62;
  --on-accent: #182203;
  --line: #3b4b57;
  --radius: 5px;
  --shadow: none;
  --display-font: "Microsoft JhengHei", "Noto Sans TC", "PingFang TC", sans-serif;
  --body-font: var(--display-font);
}

[data-theme="c"] .site-header {
  background: #101419;
  border-block-end: 1px solid var(--line);
}

[data-theme="c"] .brand {
  font-weight: 850;
  letter-spacing: 0.07em;
}

[data-theme="c"] .main-nav {
  padding-inline-start: 1rem;
  border-inline-start: 1px solid var(--line);
}

[data-theme="c"] .hero {
  background-color: #161f28;
  background-image:
    linear-gradient(#2b3a44 1px, transparent 1px),
    linear-gradient(90deg, #2b3a44 1px, transparent 1px);
  background-size: 48px 48px;
  border-block-end: 2px solid var(--accent);
}

[data-theme="c"] .hero-inner {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: center;
}

[data-theme="c"] .hero-copy {
  background: #141b23;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent);
  padding: clamp(1rem, 4vw, 3rem);
}

[data-theme="c"] .hero-media {
  border: 1px solid #657883;
  background: #0d1115;
}

[data-theme="c"] .section-head {
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: 1rem;
}

[data-theme="c"] .product-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

[data-theme="c"] .product-card {
  background: var(--surface);
  border: 0;
  border-radius: 0;
}

[data-theme="c"] .product-image {
  background: #131920;
}

[data-theme="c"] .product-price {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* D · Lavender */
[data-theme="d"] {
  --background: #f6f2fb;
  --surface: #ffffff;
  --text: #251b35;
  --muted: #604b71;
  --accent: #683994;
  --on-accent: #ffffff;
  --line: #dfd4e8;
  --radius: 22px;
  --shadow: 0 14px 35px #4d28730c;
  --display-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --body-font: var(--display-font);
}

[data-theme="d"] .site-header {
  background: #f0e8fa;
}

[data-theme="d"] .main-nav :is(a, button) {
  border-radius: 99px;
}

[data-theme="d"] .hero {
  background: linear-gradient(160deg, #f3e9fd 12%, #eddff7 65%, #f6f2fb);
}

[data-theme="d"] .hero-inner {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}

[data-theme="d"] .hero-copy :is(h1, h2) {
  letter-spacing: -0.04em;
}

[data-theme="d"] .hero-media {
  border: 0.65rem solid #ffffff;
  border-radius: 2.5rem;
  background: #e8d9f2;
  box-shadow: 0 14px 38px #3e166016;
}

[data-theme="d"] .product-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

[data-theme="d"] .product-card {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  grid-template-rows: 1fr;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
}

[data-theme="d"] .product-image {
  height: 100%;
  min-height: 9.5rem;
  display: grid;
  place-items: center;
  background: #f1eaf9;
}

[data-theme="d"] .product-body {
  align-self: center;
}

/* E · Blue Shelf */
[data-theme="e"] {
  --background: #eff4fa;
  --surface: #ffffff;
  --text: #142636;
  --muted: #496071;
  --accent: #124b8b;
  --on-accent: #ffffff;
  --line: #ccd9e6;
  --radius: 5px;
  --shadow: 0 2px 6px #00162c0b;
  --display-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --body-font: var(--display-font);
}

[data-theme="e"] .site-header {
  background: #0e3b68;
  color: var(--text);
  --text: #ffffff;
  --muted: #dceafb;
  --accent: #dceafb;
  --on-accent: #10385e;
}

[data-theme="e"] .brand {
  font-weight: 800;
}

[data-theme="e"] .hero {
  background: #e2edf9;
  border-block-end: 1px solid #c4d8eb;
}

[data-theme="e"] .hero-inner {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 3.5rem);
  align-items: center;
}

[data-theme="e"] .hero-media {
  border: 1px solid #b7cde2;
  background: #f5faff;
}

[data-theme="e"] .section-head {
  background: #deebf9;
  border-block: 1px solid #c4d8eb;
  padding: 0.75rem 1rem;
}

[data-theme="e"] .catalog-sidebar {
  background: #ffffff;
  border: 1px solid #c4d8eb;
  border-block-start: 4px solid var(--accent);
}

[data-theme="e"] .product-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.5rem, 1.1vw, 1rem);
}

[data-theme="e"] .product-card {
  background: var(--surface);
  border: 1px solid var(--line);
}

[data-theme="e"] .product-body {
  padding-inline: 0.75rem;
}

[data-theme="e"] .product-price {
  font-variant-numeric: tabular-nums;
}

/* F · Field Notes */
[data-theme="f"] {
  --background: #f7f8ee;
  --surface: #fffef5;
  --text: #243222;
  --muted: #52654a;
  --accent: #2f603b;
  --on-accent: #ffffff;
  --line: #d4dccb;
  --radius: 5px;
  --shadow: none;
  --display-font: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  --body-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

[data-theme="f"] .site-header {
  background: var(--surface);
  border-block-end: 1px solid var(--line);
}

[data-theme="f"] .brand {
  font-family: var(--display-font);
  font-weight: 600;
}

[data-theme="f"] .hero {
  background: #e6eddd;
  border-block-end: 1px solid #cbd6c5;
}

[data-theme="f"] .hero-inner,
[data-theme="f"] .hero-inner:has(.hero-media[hidden]) {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 1.75rem;
}

[data-theme="f"] .hero-copy {
  inline-size: min(100%, 42rem);
  text-align: center;
}

[data-theme="f"] .hero-copy :is(h1, h2) {
  font-weight: 600;
}

[data-theme="f"] .hero-media {
  inline-size: min(100%, 64rem);
  aspect-ratio: 2.5;
  border: 0.625rem solid #f6f9ef;
  background: #f6f9ef;
  box-shadow: 0 0 0 1px #b6c6b0;
}

[data-theme="f"] .product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.8vw, 2.25rem);
}

[data-theme="f"] .product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}

[data-theme="f"] .product-card .product-image {
  width: auto;
  margin: 0.5rem;
  background: #edf0e5;
}

[data-theme="f"] .product-body :is(h2, h3) {
  font-family: var(--display-font);
}

/* G · Tidal */
[data-theme="g"] {
  --background: #f3faf9;
  --surface: #ffffff;
  --text: #113b3d;
  --muted: #4a6766;
  --accent: #006964;
  --on-accent: #ffffff;
  --line: #cbe2df;
  --radius: 28px;
  --shadow: 0 14px 32px #115f5910;
  --display-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --body-font: var(--display-font);
}

[data-theme="g"] .site-header {
  background: #f3faf9;
}

[data-theme="g"] .header-inner {
  gap: clamp(0.75rem, 3vw, 2rem);
}

[data-theme="g"] .main-nav {
  padding: 0.25rem 0.65rem;
  border: 1px solid #cbe2df;
  border-radius: 99px;
  background: #ffffff;
}

[data-theme="g"] .hero {
  background: transparent;
  padding-inline: 1rem;
}

[data-theme="g"] .hero-inner {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1rem, 4vw, 3.25rem);
  border: 1px solid #b7ded7;
  border-radius: clamp(2rem, 6vw, 5.5rem);
  background: radial-gradient(ellipse at right, #a8ddd3 0, transparent 69%), #d6efeb;
}

[data-theme="g"] .hero-media {
  border: 1px solid #abd7ce;
  border-radius: clamp(1rem, 4vw, 3rem);
  background: #e7f7f4;
  overflow: hidden;
}

[data-theme="g"] .hero-copy :is(h1, h2) {
  letter-spacing: -0.04em;
}

[data-theme="g"] .btn {
  border-radius: 99px;
}

[data-theme="g"] .product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

[data-theme="g"] .product-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(0.425rem, 1.3vw, 0.85rem);
}

[data-theme="g"] .product-image {
  border-radius: calc(var(--radius) - 0.45rem);
  background: #eaf7f5;
}

[data-theme="g"] .product-body {
  padding-inline: 0.65rem;
}

/* H · Grand Format */
[data-theme="h"] {
  --background: #f3f1ed;
  --surface: #fdfcf9;
  --text: #232221;
  --muted: #57534e;
  --accent: #a42126;
  --on-accent: #ffffff;
  --line: #d7d2cb;
  --radius: 0px;
  --shadow: none;
  --display-font: "Microsoft JhengHei", "Noto Sans TC", "PingFang TC", sans-serif;
  --body-font: var(--display-font);
}

[data-theme="h"] .site-header {
  background: #21201f;
  color: var(--text);
  --text: #fffdf9;
  --muted: #e1dcd4;
  --accent: #fff3e9;
  --on-accent: #232221;
}

[data-theme="h"] .brand {
  text-transform: uppercase;
  letter-spacing: 0.075em;
  font-weight: 900;
}

[data-theme="h"] .hero {
  background: #a42126;
  color: var(--text);
  --text: #fffdf9;
  --muted: #f8ddda;
  --accent: #fffdf9;
  --on-accent: #8a1c20;
}

[data-theme="h"] .hero-inner {
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

[data-theme="h"] .hero-copy {
  max-inline-size: 52rem;
  padding-inline-start: 1rem;
  border-inline-start: 4px solid #fffdf9;
}

[data-theme="h"] .hero-copy :is(h1, h2) {
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

[data-theme="h"] .hero-media {
  aspect-ratio: 2.45;
  background: #581013;
}

[data-theme="h"] .section-head {
  border-block-end: 5px solid var(--text);
  padding-block-end: 0.65rem;
}

[data-theme="h"] .product-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

[data-theme="h"] .product-card {
  border: 0;
  background: var(--surface);
}

[data-theme="h"] .product-image {
  background: #eae7e0;
}

[data-theme="h"] .product-body {
  border-block-start: 1px solid var(--line);
}

/* I · Gold Market */
[data-theme="i"] {
  --background: #fff8e8;
  --surface: #fffcf5;
  --text: #35230d;
  --muted: #665136;
  --accent: #83500a;
  --on-accent: #ffffff;
  --line: #ecd9b5;
  --radius: 13px;
  --shadow: 0 10px 18px #784f100c;
  --display-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --body-font: var(--display-font);
}

[data-theme="i"] .site-header {
  background: #f9e4ae;
}

[data-theme="i"] .header-inner {
  justify-content: space-between;
}

[data-theme="i"] .main-nav :is(a, button):hover {
  background: #fff6de;
}

[data-theme="i"] .hero {
  background: #ffefcc;
  border-block-end: 1px solid #f3d9a1;
}

[data-theme="i"] .hero-inner {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

[data-theme="i"] .hero-copy {
  align-content: center;
  background: #fffbef;
  border: 1px solid #efd7a6;
  border-inline-start: 5px solid #b17117;
  padding: clamp(1rem, 4vw, 3.25rem);
}

[data-theme="i"] .hero-media {
  display: grid;
  align-items: center;
  background: #ffe1a2;
  border: 1px solid #efd7a6;
}

[data-theme="i"] .section-head {
  border-block-end: 1px solid var(--line);
  box-shadow: inset 0 -3px #f3e4c5;
  padding-block-end: 0.85rem;
}

[data-theme="i"] .catalog-sidebar {
  background: #fff5df;
  border-color: #e9c98e;
}

[data-theme="i"] .product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

[data-theme="i"] .product-card {
  border: 1px solid var(--line);
  border-block-end: 3px solid #d5a254;
  background: var(--surface);
}

[data-theme="i"] .product-image {
  background: #fcf0da;
}

/* J · Bronze House */
[data-page="store"][data-theme="j"] {
  color-scheme: dark;
  --background: #1a1917;
  --surface: #262320;
  --text: #fff5e9;
  --muted: #c8b9a9;
  --accent: #e6bb8b;
  --on-accent: #2b1b0d;
  --line: #55483d;
  --radius: 2px;
  --shadow: none;
  --display-font: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  --body-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

[data-theme="j"] .site-header {
  background: #1a1917;
  border-block: 1px solid #695242;
}

[data-theme="j"] .brand {
  color: #f4d7bc;
  font-family: var(--display-font);
  letter-spacing: 0.075em;
}

[data-theme="j"] .main-nav {
  border-block-end: 1px solid #695242;
}

[data-theme="j"] .hero {
  background: radial-gradient(ellipse at top left, #514232, #262320 58%, #1a1917);
}

[data-theme="j"] .hero-inner {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: center;
}

[data-theme="j"] .hero-copy :is(h1, h2) {
  color: #fff4e5;
  font-weight: 500;
}

[data-theme="j"] .hero-media {
  border: 0.625rem solid #312a25;
  background: #312a25;
  box-shadow: 0 0 0 1px #876d56;
}

[data-theme="j"] .section-head {
  border-block: 1px solid #6e563f;
  padding-block: 0.75rem;
}

[data-theme="j"] .product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

[data-theme="j"] .product-card {
  border: 1px solid var(--line);
  background: var(--surface);
}

[data-theme="j"] .product-image {
  background: #211e1a;
}

[data-theme="j"] .product-body {
  border-block-start: 1px solid var(--line);
}

[data-theme="j"] .product-body :is(h2, h3) {
  font-family: var(--display-font);
}

[data-theme="j"] .product-price {
  color: var(--accent);
}

@media (max-width: 1200px) {
  [data-theme="e"] .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1020px) {
  [data-theme="e"] .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  [data-theme="a"] .product-grid,
  [data-theme="c"] .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  [data-theme="d"] .product-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  [data-theme="d"] .product-image {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  [data-page="store"][data-theme] .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  [data-theme="b"] .hero-copy:has(+ .hero-media:not([hidden])),
  [data-theme="b"] .hero-media:not([hidden]) {
    grid-column: auto;
    grid-row: auto;
  }

  [data-theme="f"] .hero-media,
  [data-theme="h"] .hero-media {
    aspect-ratio: 1.62;
  }

  [data-theme="g"] .hero-inner {
    padding: clamp(1rem, 4vw, 2rem);
    border-radius: 1.625rem;
  }

  [data-theme="i"] .hero-copy {
    border-inline-start-width: 4px;
  }

  [data-page="store"][data-theme] .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 410px) {
  [data-theme="f"] .product-card .product-image {
    margin: 0.25rem;
  }

  [data-theme="g"] .product-card {
    border-radius: 1.125rem;
  }

  [data-theme="g"] .product-image {
    border-radius: 0.875rem;
  }

  [data-theme="g"] .product-body {
    padding-inline: 0.45rem;
  }
}
