/* Page-specific layout. Components live in components.css. Mobile-first. */
@layer pages {
  /* ---------- Placeholder pages (D-032) ---------- */
  .soon {
    padding-block: 56px 72px;
    text-align: center;
  }

  .soon h1 {
    font-size: var(--fs-xl);
  }

  .soon p {
    margin-top: 10px;
    color: var(--muted);
  }

  .soon .btn {
    margin-top: 22px;
  }

  /* ---------- Breadcrumbs ---------- */
  .crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-block: 12px 4px;
    font-size: var(--fs-xs);
    color: var(--muted);
  }

  .crumbs a:hover {
    color: var(--ink);
  }

  .crumbs li + li::before {
    content: "›";
    margin-right: 6px;
    color: var(--muted-2);
  }

  .crumbs li:last-child {
    color: var(--text-2);
  }

  /* ---------- Product page ---------- */
  .pd {
    display: grid;
    gap: 18px;
    padding-block: 8px 24px;
  }

  .pd__title {
    font-size: 1.25rem;
    line-height: 1.25;
  }

  .pd__variant {
    color: var(--muted);
    font-weight: 400;
  }

  .pd__sku {
    margin-top: 4px;
    font-size: var(--fs-xs);
    color: var(--muted-2);
  }

  .gallery {
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-card);
  }

  .gallery__track {
    display: flex;
    aspect-ratio: 1;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-radius: var(--radius-m);
  }

  .gallery__track::-webkit-scrollbar {
    display: none;
  }

  .gallery__slide {
    flex: none;
    display: grid;
    place-items: center;
    width: 100%;
    scroll-snap-align: start;
  }

  .gallery__slide img {
    width: 100%;
    height: 100%;
    padding: 8px;
    object-fit: contain;
  }

  .gallery__thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .gallery__thumbs::-webkit-scrollbar {
    display: none;
  }

  .gallery__thumb {
    flex: none;
    width: 56px;
    height: 56px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
  }

  .gallery__thumb.is-active {
    border-color: var(--red);
  }

  .gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .quick-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 14px;
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--surface);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-card);
  }

  .quick-specs li {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    font-size: var(--fs-xs);
  }

  .quick-specs span {
    color: var(--muted);
  }

  .quick-specs strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
    font-size: var(--fs-s);
  }

  .picker {
    margin-top: 16px;
  }

  .picker h2 {
    margin-bottom: 8px;
    font-size: var(--fs-s);
    font-weight: 700;
    color: var(--text-2);
  }

  .picker h2 em {
    font-style: normal;
    color: var(--ink);
  }

  .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    font-size: var(--fs-s);
    color: var(--text-2);
    transition: border-color 0.15s, color 0.15s;
  }

  .chip small {
    color: var(--muted-2);
    font-size: var(--fs-xs);
  }

  .chip:hover {
    border-color: var(--muted-2);
    color: var(--ink);
  }

  .chip.is-active {
    border-color: var(--red);
    background: var(--red-soft);
    color: var(--red);
    font-weight: 700;
  }

  .chip.is-off {
    border-style: dashed;
    color: var(--muted-2);
  }

  .swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .swatch {
    width: 30px;
    height: 30px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--border);
  }

  .swatch.is-active {
    box-shadow: 0 0 0 2px var(--red);
  }

  .buybox {
    margin-top: 18px;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-card);
  }

  .buybox__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
  }

  .buybox__price strong {
    font-size: 1.75rem;
    line-height: 1;
    font-weight: 700;
    color: var(--red);
  }

  .buybox__price s {
    font-size: var(--fs-m);
    color: var(--muted-2);
  }

  .disc {
    padding: 2px 8px;
    border-radius: 7px;
    background: var(--red);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 700;
  }

  .buybox__installment {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--surface-2);
    font-size: var(--fs-s);
    color: var(--text-2);
  }

  .buybox__installment .icon {
    width: 18px;
    height: 18px;
    color: var(--ink);
  }

  .buybox__installment strong {
    color: var(--ink);
  }

  .bank {
    margin-left: auto;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #ff5b00;
  }

  .buybox__stock {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: var(--fs-s);
    color: #1f8f4e;
  }

  .buybox__stock .icon {
    width: 16px;
    height: 16px;
  }

  .buybox__stock.is-out {
    color: var(--muted);
  }

  .buybox__actions {
    display: grid;
    gap: 8px;
    margin-top: 14px;
  }

  .btn--block {
    justify-content: center;
    padding: 13px 18px;
    border-radius: 12px;
    font-size: var(--fs-m);
    font-weight: 700;
  }

  .btn--block .icon {
    width: 18px;
    height: 18px;
  }

  .btn--dark {
    background: var(--ink);
    color: #fff;
  }

  .btn--dark:hover {
    background: #000;
  }

  .perks {
    display: grid;
    gap: 9px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }

  .perks li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-xs);
    color: var(--text-2);
  }

  .perks .icon {
    width: 20px;
    height: 20px;
    color: var(--ink);
  }

  .pd-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
  }

  .pd-tabs a {
    padding: 10px 14px;
    border-bottom: 2px solid transparent;
    font-size: var(--fs-s);
    font-weight: 700;
    color: var(--text-2);
    white-space: nowrap;
  }

  .pd-tabs a:hover {
    color: var(--red);
    border-color: var(--red);
  }

  .pd-section {
    margin-top: 24px;
    scroll-margin-top: 70px;
  }

  .pd-section > h2 {
    margin-bottom: 12px;
    font-size: 1.0625rem;
  }

  .pd-desc {
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-card);
    font-size: var(--fs-s);
    line-height: 1.6;
    color: var(--text-2);
  }

  .specs {
    display: grid;
    gap: 10px;
  }

  .specs__group {
    overflow: hidden;
    background: var(--surface);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-card);
  }

  .specs__group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: var(--fs-s);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }

  .specs__group summary::-webkit-details-marker {
    display: none;
  }

  .specs__group summary::after {
    content: "+";
    color: var(--muted-2);
    font-size: 1.1rem;
    line-height: 1;
  }

  .specs__group[open] summary::after {
    content: "−";
  }

  .specs__group dl {
    border-top: 1px solid var(--border);
  }

  .specs__group dl > div {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 12px;
    padding: 9px 16px;
    font-size: var(--fs-xs);
  }

  .specs__group dl > div:nth-child(even) {
    background: var(--bg);
  }

  .specs__group dt {
    color: var(--muted);
  }

  .specs__group dd {
    overflow-wrap: anywhere;
    color: var(--ink);
  }

  @media (min-width: 768px) {
    .pd {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 28px;
      padding-block: 12px 32px;
    }

    .pd__gallery {
      position: sticky;
      top: 72px;
      align-self: start;
    }

    .pd__title {
      font-size: 1.5rem;
    }

    .gallery__thumb {
      width: 64px;
      height: 64px;
    }

    .specs {
      grid-template-columns: 1fr 1fr;
      align-items: start;
    }

    .pd-section > h2 {
      font-size: 1.125rem;
    }
  }
}
