.akiba-japan-wrap {
  margin-block: 0 26px;
}

.akiba-japan {
  padding: clamp(24px, 4vw, 52px);
  border: 1px solid #dfd9cd;
  border-radius: 20px;
  background: #f1ede4;
  color: #23251f;
}

.akiba-japan [hidden] { display: none !important; }
.akiba-japan :focus-visible { outline: 2px solid #a8221b; outline-offset: 3px; }
.akiba-japan-heading { display: flex; align-items: center; gap: 21px; margin-bottom: 24px; }
.akiba-japan-heading h2 {
  margin: 0;
  color: inherit;
  font-size: clamp(34px, 5.2vw, 70px);
  line-height: 1;
}
.akiba-japan-heading p { margin: 8px 0 0; color: #a8221b; font-weight: 800; }
.akiba-japan-flag {
  display: grid;
  flex: none;
  place-items: center;
  width: 68px;
  aspect-ratio: 3 / 2;
  border: 1px solid #dfd9cd;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 3px 0 #d8cfc0;
  transform: rotate(-9deg);
}
.akiba-japan-flag::after {
  width: 41%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #bc002d;
  content: '';
}
.akiba-japan-controls { display: flex; gap: 8px; margin-inline-start: auto; }
.akiba-japan-controls button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #b7afa1;
  border-radius: 50%;
  background: #fff;
  color: #23251f;
  font: 750 1.25rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.akiba-japan-controls button:hover:not(:disabled) { background: #23251f; color: #fff; }
.akiba-japan-controls button:disabled { opacity: .42; cursor: default; }

.akiba-japan-rail {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72%;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #a49a8a #f1ede4;
  padding-bottom: 10px;
}
.akiba-japan-rail:has(> :only-child),
.akiba-japan-rail:has(> [hidden]) { grid-auto-columns: min(100%, 720px); }
.akiba-japan-card {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  grid-template-rows: auto 1fr;
  min-width: 0;
  scroll-snap-align: start;
  border: 1px solid #dfd9cd;
  border-radius: 15px;
  background: #fff;
  color: #23251f;
}
.akiba-japan-photo {
  display: grid;
  place-items: center;
  height: 292px;
  padding: 20px;
}
.akiba-japan-photo img { display: block; width: min(100%, 248px); height: 100%; min-height: 0; object-fit: contain; }
.akiba-japan-copy {
  display: grid;
  grid-template-rows: 1fr auto auto;
  min-width: 0;
  gap: var(--japan-copy-gap, 5px);
  padding: 22px 20px 22px 9px;
}
.akiba-japan-copy h3 { margin: 0; color: inherit; font-size: clamp(24px, 3vw, 38px); line-height: 1.05; overflow-wrap: anywhere; }
.akiba-japan-copy h3 a { color: inherit; text-decoration: none; }
.akiba-japan-copy h3 a:hover { text-decoration: underline; }
.akiba-japan-copy p { margin: 0; color: #61594e; line-height: 1.4; }
.akiba-japan-edition { font-size: .85rem; font-weight: 750; }
.akiba-japan-copy .akiba-japan-description { max-width: 28ch; margin-top: 5px; }
.akiba-japan-copy .akiba-japan-direct {
  width: fit-content;
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 6px;
  background: #fcf0eb;
  color: #8d221a;
  font-size: .83rem;
  font-weight: 750;
}
.akiba-japan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.akiba-japan-actions strong { font-size: 1.22rem; font-weight: 850; }
.akiba-japan-actions a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 7px;
  background: var(--akiba-purchase, #ffbe39);
  color: var(--akiba-on-purchase, #2f210a);
  font-size: .875rem;
  font-weight: 800;
  text-decoration: none;
}
.akiba-japan-actions a:hover { background: var(--akiba-purchase-hover, #ffae1f); }

@media (prefers-reduced-motion: reduce) {
  .akiba-japan-rail { scroll-behavior: auto; }
}

@media (min-width: 768px) {
  .akiba-japan-wrap:not(.akiba-japan-mobile) .akiba-japan {
    padding: clamp(20px, 3vw, 36px);
  }
  .akiba-japan-wrap:not(.akiba-japan-mobile) .akiba-japan-rail {
    --japan-card-gap: 16px;
    grid-auto-columns: calc((100% - 3 * var(--japan-card-gap)) / 4);
    column-gap: var(--japan-card-gap);
  }
  .akiba-japan-wrap:not(.akiba-japan-mobile) .akiba-japan-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .akiba-japan-wrap:not(.akiba-japan-mobile) .akiba-japan-photo {
    height: clamp(140px, 14vw, 195px);
    padding: 14px;
  }
  .akiba-japan-wrap:not(.akiba-japan-mobile) .akiba-japan-copy {
    --japan-copy-gap: 8px;
    padding: 0 14px 14px;
  }
  .akiba-japan-wrap:not(.akiba-japan-mobile) .akiba-japan-copy h3 {
    font: inherit;
    font-weight: 750;
    line-height: 1.25;
  }
  .akiba-japan-wrap:not(.akiba-japan-mobile) .akiba-japan-direct {
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: .78rem;
  }
  .akiba-japan-wrap:not(.akiba-japan-mobile) .akiba-japan-actions {
    display: grid;
    gap: 8px;
    padding-top: 4px;
  }
  .akiba-japan-wrap:not(.akiba-japan-mobile) .akiba-japan-actions a {
    justify-content: center;
    padding-block: 6px;
    text-align: center;
  }
}

@media (768px <= width < 920px) {
  .akiba-japan-wrap:not(.akiba-japan-mobile) .akiba-japan-rail {
    grid-auto-columns: calc((100% - var(--japan-card-gap)) / 2);
    grid-template-rows: auto auto;
  }
}

.akiba-japan-mobile .akiba-japan { padding: 17px 14px 13px; border-radius: 15px; }
.akiba-japan-mobile .akiba-japan-heading { gap: 12px; margin-bottom: 14px; }
.akiba-japan-mobile .akiba-japan-heading h2 { font-size: clamp(24px, 7.5vw, 33px); overflow-wrap: anywhere; }
.akiba-japan-mobile .akiba-japan-heading p { margin-top: 4px; font-size: .82rem; }
.akiba-japan-mobile .akiba-japan-flag { width: 42px; border-radius: 5px; }
.akiba-japan-mobile .akiba-japan-controls { display: none; }
.akiba-japan-mobile .akiba-japan-rail { grid-auto-columns: 85%; column-gap: 9px; }
.akiba-japan-mobile .akiba-japan-rail:has(> :only-child),
.akiba-japan-mobile .akiba-japan-rail:has(> [hidden]) { grid-auto-columns: 100%; }
.akiba-japan-mobile .akiba-japan-card { grid-template-columns: minmax(0, 1fr); }
.akiba-japan-mobile .akiba-japan-photo { height: 205px; padding: 14px 10px 0; }
.akiba-japan-mobile .akiba-japan-photo img { width: min(100%, 192px); }
.akiba-japan-mobile .akiba-japan-copy { padding: 10px 12px 12px; }
.akiba-japan-mobile .akiba-japan-copy h3 { font-size: 1.2rem; }
.akiba-japan-mobile .akiba-japan-description { font-size: .83rem; }
.akiba-japan-mobile .akiba-japan-actions { justify-content: space-between; margin-top: 5px; }

@supports (grid-template-rows: subgrid) {
  /* Share the photo, product text, four banner rows and actions across each shelf row. */
  .akiba-japan-rail {
    grid-template-rows: repeat(7, auto);
    row-gap: 0;
  }
  .akiba-japan-rail > .akiba-japan-card {
    grid-row: span 7;
    grid-template-rows: subgrid;
  }
  .akiba-japan-copy {
    grid-row: 2 / -1;
    grid-template-rows: subgrid;
    row-gap: 0;
  }
  .akiba-japan-copy > .psa-direct-delivery.journey-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-row: 2 / span 4;
    grid-template-rows: subgrid;
    row-gap: 0;
  }
  .akiba-japan-copy > .journey-banner > .journey-title { grid-row: 1; align-self: start; }
  .akiba-japan-copy > .journey-banner > .journey-included { grid-row: 2; align-self: start; }
  .akiba-japan-copy > .journey-banner > .journey-art { grid-row: 3; align-self: start; }
  .akiba-japan-copy > .journey-banner > .journey-labels { grid-row: 4; align-self: start; }
  .akiba-japan-copy > .akiba-japan-direct { grid-row: 2 / span 4; align-self: start; }
  .akiba-japan-copy > .akiba-japan-actions { grid-row: -2; }

  @media (768px <= width < 920px) {
    .akiba-japan-wrap:not(.akiba-japan-mobile) .akiba-japan-rail {
      grid-template-rows: repeat(14, auto);
    }
    .akiba-japan-wrap:not(.akiba-japan-mobile) .akiba-japan-card:nth-child(odd) {
      margin-block-end: var(--japan-card-gap);
    }
  }
}

@media (max-width: 767px) {
  body > main .akiba-japan-wrap:not(.akiba-japan-mobile) { display: none; }
}

.akiba-japan-nav { display: flex; align-items: center; gap: 16px; margin-inline-start: auto; }
.akiba-japan-browse { color: inherit; font-weight: 800; white-space: nowrap; text-underline-offset: 4px; padding-block: 10px; }
.akiba-japan-browse:hover { text-decoration: underline; }
.akiba-japan-error { padding-block: 12px; }
.akiba-japan-retry {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #d7d0c4;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.akiba-japan-retry:disabled { opacity: .5; cursor: default; }
.akiba-japan-mobile .akiba-japan-heading { flex-wrap: wrap; }
.akiba-japan-mobile .akiba-japan-heading > div:first-of-type { flex: 1 1 calc(100% - 54px); }
.akiba-japan-mobile .akiba-japan-nav { font-size: .875rem; }

.akiba-japan-page-title { display: flex; align-items: center; gap: 18px; }
.akiba-japan-page-title .akiba-japan-flag { width: clamp(40px, 7vw, 68px); }
.akiba-japan-catalog .shared-filters button {
  background: var(--akiba-purchase, #ffbe39);
  color: var(--akiba-on-purchase, #2f210a);
  font-weight: 750;
}
.akiba-japan-card-quote { display: inline-block; font-size: .88rem; line-height: 1.4; }
.akiba-japan-catalog .shared-badge { max-width: calc(100% - 58px); overflow-wrap: anywhere; }

@media (max-width: 767px) {
  .akiba-japan-catalog .shared-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .akiba-japan-catalog .shared-filters label:first-child { grid-column: 1 / -1; }
}
