/* Public shop detail: the approved warm-white editorial treatment.
   This file only changes presentation; content and state stay in app.js. */

body.detail-open {
  overflow: hidden;
}

/* The page-in animation retains a transform after finishing, which otherwise
   makes fixed drawer/backdrop coordinates relative to the scrolled page. */
body.detail-open #page-explore.is-active {
  animation: none;
  transform: none;
}

@media (min-width: 981px) {
  .detail-backdrop:not([hidden]) {
    position: fixed;
    z-index: 90;
    inset: 0;
    display: block;
    background: rgb(43 41 37 / 32%);
  }

  #page-explore .detail-pane:not([hidden]) {
    position: fixed;
    z-index: 91;
    inset: 0 0 0 auto;
    width: min(610px, 100vw);
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    overflow-y: auto;
    border: 0;
    background: var(--canvas);
    box-shadow: -12px 0 40px rgb(43 41 37 / 12%);
    overscroll-behavior: contain;
  }
}

.detail-pane {
  position: relative;
}

.detail-close {
  position: sticky;
  z-index: 2;
  top: 18px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  margin: 18px 18px -58px auto;
  background: rgb(255 255 255 / 96%);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: 0 2px 12px rgb(43 41 37 / 10%);
  place-items: center;
}

.detail-close:hover {
  background: var(--surface-warm);
}

.detail-close svg {
  width: 18px;
  height: 18px;
}

.detail-media {
  height: clamp(300px, 33vw, 420px);
  background: var(--surface-muted);
}

.detail-media::after {
  content: none;
}

.detail-media img,
.mobile-detail-media img {
  object-fit: cover;
  object-position: center;
}

.detail-content {
  padding: 32px clamp(24px, 4vw, 42px) 60px;
}

.detail-heading {
  gap: 24px;
}

.detail-heading h2,
.mobile-detail-content h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 550;
  letter-spacing: -0.05em;
  line-height: 1.22;
}

.detail-heading p,
.mobile-detail-content > p {
  color: var(--muted);
  line-height: 1.65;
}

.detail-score strong {
  font-family: var(--font-brand);
  font-size: 1.9rem;
  font-weight: 500;
}

.detail-score span {
  color: var(--berry);
}

.detail-description {
  margin-top: 22px;
  font-size: 0.9rem;
  line-height: 1.75;
}

.detail-tags {
  margin-top: 18px;
  gap: 7px;
}

.detail-tags span {
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--surface-warm);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 500;
}

.detail-actions {
  flex-wrap: wrap;
  margin-top: 26px;
  gap: 9px;
}

.detail-actions .primary-button {
  min-height: 44px;
  margin-right: 0;
}

.detail-actions .icon-text-button {
  min-height: 44px;
  border-color: var(--line);
  border-radius: 6px;
  background: transparent;
  font-weight: 550;
}

.detail-actions .icon-text-button:hover,
.detail-actions .icon-text-button[aria-pressed="true"] {
  border-color: var(--berry);
  background: var(--surface-warm);
  color: var(--berry-dark);
}

.detail-pane .order-status,
.mobile-shop-page .order-status {
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-radius: 10px;
  margin-top: 24px;
  background: var(--tea-soft);
  color: var(--tea);
  gap: 12px;
}

.detail-pane .order-status strong,
.mobile-shop-page .order-status strong {
  font-size: 0.8rem;
  font-weight: 650;
}

.detail-pane .order-status small,
.mobile-shop-page .order-status small {
  color: var(--tea);
  font-size: 0.71rem;
  line-height: 1.55;
}

.detail-tabs {
  margin-top: 28px;
  gap: 20px;
}

.detail-tabs button {
  min-height: 48px;
  padding: 0 2px;
  font-size: 0.83rem;
  font-weight: 600;
}

.detail-tabs button::after {
  right: 0;
  left: 0;
  height: 2px;
  background: var(--berry);
}

.tab-panel {
  padding-top: 22px;
}

.consensus-card {
  padding: 22px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-warm);
}

.consensus-card h3 {
  font-size: 1.06rem;
  font-weight: 550;
  line-height: 1.45;
}

.consensus-row {
  min-height: 32px;
  font-size: 0.73rem;
}

.detail-pane .community-reviews,
.mobile-shop-page .community-reviews {
  display: grid;
  gap: 12px;
}

.detail-pane .review-card--community,
.mobile-shop-page .review-card--community {
  min-width: 0;
  padding: 18px;
  border: 0;
  border-radius: 10px;
  margin-top: 0;
  background: var(--surface);
  gap: 12px;
}

.detail-pane .review-card--community:first-child,
.mobile-shop-page .review-card--community:first-child {
  margin-top: 16px;
}

.detail-pane .review-meta,
.mobile-shop-page .review-meta {
  flex-wrap: wrap;
  gap: 3px 10px;
}

.detail-pane .review-card p,
.mobile-shop-page .review-card p {
  font-size: 0.78rem;
  line-height: 1.7;
}

.detail-pane .owner-reply,
.mobile-shop-page .owner-reply {
  border-left-color: var(--berry);
  border-radius: 0 7px 7px 0;
  background: var(--surface-warm);
}

.detail-pane .menu-list,
.mobile-shop-page .menu-list {
  display: grid;
  gap: 14px;
}

.detail-pane .menu-list > li,
.mobile-shop-page .menu-list > li {
  min-width: 0;
  padding: 18px;
  border: 0;
  border-radius: 10px;
  background: var(--surface);
}

.detail-pane .menu-list .product-detail-item,
.mobile-shop-page .menu-list .product-detail-item {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 20px;
}

.product-detail-item__media {
  min-width: 0;
}

.product-detail-item__image {
  width: 100%;
  aspect-ratio: 1.05;
  border-radius: 8px;
  background: var(--surface-muted);
  object-fit: cover;
}

.product-detail-item__thumbnails {
  margin-top: 7px;
  gap: 6px;
}

.product-detail-item__thumbnail {
  border-color: transparent;
  border-radius: 6px;
  background: var(--surface-muted);
}

.product-detail-item__thumbnail[aria-pressed="true"] {
  border-color: var(--berry);
}

.product-detail-item__heading {
  align-items: start;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.product-detail-item__heading strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.product-detail-item__heading b {
  color: var(--ink);
  font-family: var(--font-brand);
  font-size: 1.4rem;
  font-weight: 500;
  white-space: nowrap;
}

.product-detail-item dl {
  display: grid;
  margin: 14px 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.product-detail-item dl div {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.product-detail-item dt {
  color: var(--muted);
  font-size: 0.68rem;
}

.product-detail-item dd {
  color: var(--ink-soft);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.product-detail-item .product-status {
  padding: 5px 9px;
  font-size: 0.7rem;
}

.product-detail-item.is-highlighted {
  border-radius: 10px;
  outline-color: var(--berry);
  background: var(--surface-warm);
}

.detail-pane .menu-list__empty,
.mobile-shop-page .menu-list__empty,
.mobile-shop-page .mobile-reviews-empty {
  padding: 24px;
  border-radius: 10px;
  background: var(--surface-warm);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .detail-backdrop {
    display: none !important;
  }

  .mobile-shop-page.is-active {
    background: transparent;
  }

  .mobile-shop-back {
    min-height: 48px;
    padding-inline: 0;
    background: transparent;
    color: var(--berry-dark);
  }

  .mobile-detail-media {
    height: clamp(280px, 46vw, 440px);
    border-radius: 12px;
    background: var(--surface-muted);
  }

  .mobile-detail-media button {
    right: 16px;
    bottom: 16px;
    border: 0;
    background: rgb(255 255 255 / 95%);
  }

  .mobile-detail-content {
    padding: 28px 0 110px;
  }

  .mobile-detail-content h1 {
    margin-top: 8px;
  }

  .mobile-detail-content > p:nth-of-type(2) {
    font-size: 0.9rem;
  }

  .mobile-rating b {
    color: var(--berry-dark);
  }

  .mobile-detail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mobile-detail-section {
    padding-top: 26px;
    border-top: 1px solid var(--line);
    margin-top: 34px;
  }

  .mobile-detail-section h2 {
    margin-bottom: 18px;
    font-size: 1.45rem;
    font-weight: 550;
    letter-spacing: -0.03em;
  }
}

@media (max-width: 600px) {
  .mobile-shop-page.is-active {
    margin: 0;
    width: 100%;
  }

  .mobile-detail-media {
    height: auto;
    min-height: 0;
    aspect-ratio: 1.25;
  }

  .mobile-detail-content {
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }

  .mobile-detail-actions {
    grid-template-columns: 1fr;
  }

  .mobile-shop-page .menu-list .product-detail-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .mobile-shop-page .product-detail-item__media {
    width: 100%;
  }

  .mobile-shop-page .product-detail-item__image {
    aspect-ratio: 1.15;
  }

  .mobile-shop-page .product-detail-item__thumbnails {
    max-width: 240px;
  }

  .mobile-shop-page .product-detail-item dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .mobile-shop-page .product-detail-item dl {
    grid-template-columns: 1fr;
  }
}
