* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  --ink: #101b33;
  --navy: #0e192f;
  --muted: #50607a;
  --line: #dbe2ef;
  --blue: #3152f5;
  --surface: #f5f7fc;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.5;
}
body { margin: 0; }
.header {
  min-height: 60px;
  margin: 14px clamp(12px, 2vw, 28px) 0;
  padding: 5px clamp(12px, 2.5vw, 36px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  background: var(--navy);
  color: #fff;
  border: 1px solid #223659;
  border-radius: 16px;
}
.brand { justify-self: start; display: inline-flex; align-items: center; }
.brand img { display: block; width: 116px; height: 37px; object-fit: contain; }
.store-nav, .store-actions { display: flex; align-items: center; }
.store-nav { gap: clamp(18px, 3vw, 52px); }
.store-nav a { color: #fff; font-size: .9rem; font-weight: 700; text-decoration: none; }
.store-nav a:hover { text-decoration: underline; }
.store-actions { justify-self: end; gap: 3px; }
.store-actions a {
  width: 42px; height: 42px; display: grid; place-items: center;
  color: #fff; text-decoration: none; border-radius: 8px;
}
.store-actions a:hover, .store-actions a[aria-current=page] { background: #243553; }

main { max-width: 1330px; margin: auto; padding: clamp(30px, 5vw, 68px) clamp(16px, 4vw, 56px) 56px; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 25px; }
.intro h1, #store-preview h1 { margin: 0; font-size: clamp(2rem, 4.75vw, 3.6rem); line-height: 1.05; letter-spacing: -.05em; }
#store-preview p, .gallery > p { color: var(--muted); }
.send-review, button {
  background: var(--blue); color: white; border: 1px solid var(--blue);
  padding: 10px 15px; border-radius: 9px; font: inherit; font-weight: 650; cursor: pointer;
}
.send-review { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; text-decoration: none; }
.send-review span { font-size: 1.3rem; line-height: 1; }
.send-review:hover, button:hover { background: #2545dd; }
.gallery { border-top: 1px solid var(--line); padding-top: 20px; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 320px));
  gap: 20px;
}
.review-card { min-width: 0; overflow-wrap: anywhere; }
.review-card__media {
  aspect-ratio: 1 / 1;
  position: relative;
  display: grid; place-items: center;
  overflow: hidden; border: 1px solid var(--line); border-radius: 16px;
  background: #fff; box-shadow: 0 8px 24px #172b5010;
}
.review-card__media img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.review-card__media--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); aspect-ratio: 2 / 1; }
.review-card__media--pair img + img { border-inline-start: 1px solid var(--line); }
.review-card__caption { padding: 10px 2px 0; }
.review-card h3 { margin: 0 0 4px; font-size: 1.0625rem; font-weight: 750; }
.review-card p { margin: 4px 0 0; color: var(--ink); font-size: 1rem; font-weight: 600; line-height: 1.55; }
.purchase-badge {
  position: absolute; z-index: 1; top: 11px; left: 11px; max-width: calc(100% - 22px);
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px;
  background: #edf8ef; color: #184b31; font-size: .78rem; font-weight: 750; line-height: 1.2;
  box-shadow: 0 2px 10px #0e192f35;
}
.purchase-badge span {
  display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%;
  background: #286645; color: white; font-size: .62rem; line-height: 1;
}
.gallery .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 500px)); align-items: start; }
.gallery .review-card { padding: clamp(14px, 2.4vw, 22px); border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 8px 24px #172b5010; }
.gallery .review-card__caption { padding: 0; margin-bottom: 15px; }
.review-card__byline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 7px; }
.review-card__byline h3 { margin: 0; }
.review-card__byline .purchase-badge { position: static; max-width: 100%; box-shadow: none; }
.review-card__photos { display: flex; gap: 8px; align-items: flex-start; }
.review-card__photo, .review-card__photo:hover { position: relative; flex: var(--photo-ratio, 1) 1 0; min-width: 0; padding: 0; margin: 0; border: 0; overflow: hidden; border-radius: 12px; background: var(--surface); cursor: zoom-in; }
.review-card__photo img { display: block; width: 100%; height: auto; }
.review-card__zoom { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; display: grid; place-items: center; color: #fff; background: #101b33db; border-radius: 50%; font-size: 1.2rem; line-height: 1; }
.photo-dialog { margin: auto; padding: 0; width: min(860px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: hidden; border: 0; border-radius: 16px; color: var(--ink); background: #fff; }
.photo-dialog::backdrop { background: #101b33cc; }
.photo-dialog__toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px; }
.photo-dialog__toolbar h2 { margin: 0 auto 0 0; font-size: 1rem; }
.photo-dialog__toolbar button { margin: 0; padding: 6px 10px; font-size: .875rem; }
.photo-dialog__viewport { display: grid; place-items: center; max-height: max(120px, calc(100vh - 174px)); overflow: auto; background: var(--navy); touch-action: pan-y pinch-zoom; }
.photo-dialog__viewport img { display: block; width: auto; height: auto; max-width: 100%; max-height: max(120px, calc(100vh - 174px)); }
.photo-dialog__viewport.is-zoomed { display: block; touch-action: auto; }
.photo-dialog__viewport.is-zoomed img { width: 200%; max-width: none; max-height: none; }
.photo-dialog__navigation { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 12px; }
.photo-dialog__navigation button { margin: 0; min-width: 44px; min-height: 44px; padding: 4px 12px; }
.photo-dialog__navigation button:disabled { opacity: .35; cursor: default; }
.photo-dialog__navigation span { min-width: 3ch; text-align: center; font-variant-numeric: tabular-nums; }
.moderation { margin-top: 24px; padding: 14px; background: #edf1fa; border: 1px solid var(--line); border-radius: 12px; }
.moderation .cards { margin-top: 12px; }
.write-view { max-width: 540px; margin-inline: auto; }
.back-link { display: inline-block; color: var(--blue); margin-bottom: 16px; }
.form-panel { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 10px 26px #172b5010; }
h2 { font-size: 1.4rem; letter-spacing: -.035em; margin: 0 0 16px; }
label, summary { font-weight: 650; }
label { display: block; margin: 12px 0 5px; }
input, textarea { width: 100%; padding: 11px; border: 1px solid #b8c3d6; border-radius: 9px; font: inherit; color: inherit; background: white; }
button { margin: 8px 6px 0 0; }
.privacy, .form-panel details, .gallery > p { font-size: .875rem; }
.privacy, .form-panel details { color: var(--muted); }
.privacy { margin: 12px 0 6px; }
#message:not(:empty) { padding: 10px 12px; background: #ecf1ff; border-radius: 8px; margin: 12px 0; font-size: .875rem; }
.review-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block: 10px; }
.review-photos img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #f3f5f9; border-radius: 8px; }
.review-photos button { color: var(--blue); background: transparent; padding: 4px; margin: 4px 0 0; }
.review-photos button:hover { background: #ecf1ff; }
summary { cursor: pointer; }
.form-panel details { margin-top: 18px; }
.form-panel details p { margin: 5px 0; }
:focus-visible { outline: 2px solid #668bff; outline-offset: 3px; }
@media (max-width: 749px) {
  .header { grid-template-columns: 1fr auto; gap: 5px; }
  .store-nav, .store-actions a.store-actions__messages { display: none; }
  .store-actions a { width: 37px; height: 37px; }
  .form-panel { padding: 18px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
}
