.shop-section {
  --shop-surface: #f8f7f3;
  --shop-surface-strong: #efede7;
  --shop-image-surface: #e9e7e1;
  --shop-focus: #53654e;
  --shop-muted: #646861;
  position: relative;
  padding: clamp(96px, 8vw, 148px) clamp(22px, 3.8vw, 72px) clamp(110px, 9vw, 170px);
  overflow: hidden;
  background: var(--shop-surface);
  border-top: 1px solid var(--line);
}

.shop-shell {
  width: min(100%, var(--container));
  margin-inline: auto;
}

.shop-heading {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.shop-title {
  margin: 0;
  font-size: clamp(34px, 3vw, 52px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.03em;
}

.shop-count {
  color: var(--shop-muted);
  font-size: 13px;
}

.shop-toolbar {
  min-height: 66px;
  margin-top: clamp(34px, 4vw, 58px);
  padding: 10px clamp(10px, 1.6vw, 26px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-block: 1px solid var(--line);
  background: rgba(255,255,255,.28);
}

.shop-category,
.shop-sort {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 20px);
}

.shop-category label {
  color: var(--shop-muted);
  font-size: 11px;
  letter-spacing: .08em;
}

.shop-category select,
.shop-sort button,
.shop-pagination button,
.shop-status button,
.shop-product-card__media,
.shop-product-card__title-button,
.shop-dialog__close {
  font: inherit;
}

.shop-category select {
  min-height: 40px;
  padding: 0 32px 0 10px;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.shop-sort button {
  min-height: 40px;
  padding: 0 10px;
  color: var(--shop-muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: color .25s var(--ease), transform .25s var(--ease);
  white-space: nowrap;
}

.shop-sort button:hover,
.shop-sort button.is-active {
  color: var(--ink);
}

.shop-sort button:active,
.shop-pagination button:active,
.shop-status button:active,
.shop-dialog__close:active {
  transform: translateY(1px);
}

.shop-category select:focus-visible,
.shop-sort button:focus-visible,
.shop-pagination button:focus-visible,
.shop-status button:focus-visible,
.shop-product-card__media:focus-visible,
.shop-product-card__title-button:focus-visible,
.shop-dialog__close:focus-visible,
.shop-dialog__image-nav:focus-visible,
.shop-dialog__thumbnail:focus-visible,
.shop-dialog__contact:focus-visible {
  outline: 2px solid var(--shop-focus);
  outline-offset: 3px;
}

.shop-status {
  min-height: 24px;
  margin-top: 26px;
  color: var(--shop-muted);
  font-size: 13px;
}

.shop-status[hidden] {
  display: none;
}

.shop-status.is-panel {
  min-height: 260px;
  padding: 56px 24px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.34);
}

.shop-status__content {
  max-width: 460px;
}

.shop-status__title {
  display: block;
  color: var(--ink);
  font-size: 22px;
  font-weight: 400;
}

.shop-status__body {
  margin: 10px 0 0;
  line-height: 1.8;
}

.shop-status button {
  min-height: 42px;
  margin-top: 22px;
  padding: 0 20px;
  color: #fff;
  border: 1px solid var(--ink);
  background: var(--ink);
  cursor: pointer;
}

.shop-grid {
  margin-top: 12px;
  display: flex;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.shop-grid::-webkit-scrollbar { display: none; }

.shop-product-page {
  flex: 0 0 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(34px, 4vw, 64px) clamp(12px, 1.45vw, 28px);
  align-content: start;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.shop-product-card {
  min-width: 0;
  animation: shopCardReveal .62s var(--ease) both;
  animation-delay: calc(var(--shop-index, 0) * 48ms);
}

/* Keep dynamic cards hidden until the shop grid first enters the viewport. */
.shop-grid[data-reveal-state="pending"] .shop-product-card {
  animation: none;
}

.shop-grid[data-reveal-state="visible"] .shop-product-card {
  animation: shopCardReveal .72s var(--ease) both;
  animation-delay: calc(.08s + var(--shop-index, 0) * 60ms);
}

.shop-product-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--shop-image-surface);
  cursor: pointer;
}

.shop-product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease);
}

.shop-product-card__media:hover img {
  transform: scale(1.018);
}

.shop-product-card__image-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--shop-muted);
  font-size: 12px;
  text-align: center;
}

.shop-product-card__image-error[hidden] {
  display: none;
}

.shop-product-card__meta {
  min-height: 22px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--shop-muted);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.shop-product-card__badge:empty {
  visibility: hidden;
}

.shop-product-card__title {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

.shop-product-card__title-button {
  width: 100%;
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.shop-product-card__colors {
  min-height: 16px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.shop-product-card__swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(32,33,31,.16);
}

.shop-product-card__footer {
  margin-top: 10px;
}

.shop-product-card__price {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
}

.shop-skeleton {
  min-width: 0;
}

.shop-skeleton__image,
.shop-skeleton__line {
  position: relative;
  overflow: hidden;
  background: #e6e4de;
}

.shop-skeleton__image {
  aspect-ratio: 4 / 5;
  border-radius: 8px;
}

.shop-skeleton__line {
  height: 11px;
  margin-top: 13px;
}

.shop-skeleton__line.is-short {
  width: 58%;
}

.shop-skeleton__image::after,
.shop-skeleton__line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: shopSkeleton 1.25s ease-in-out infinite;
}

.shop-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-pagination[hidden] {
  display: none;
}

.shop-pagination button {
  min-width: 66px;
  min-height: 40px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
}

.shop-pagination button:disabled {
  color: #aaa9a5;
  border-color: var(--line);
  cursor: not-allowed;
}

.shop-pagination__page {
  min-width: 54px;
  color: var(--shop-muted);
  font-size: 12px;
  text-align: center;
}

.shop-dialog {
  width: min(1040px, calc(100vw - 40px));
  height: min(720px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  border: 0;
  border-radius: 10px;
  background: var(--shop-surface);
  box-shadow: 0 30px 90px rgba(27,29,26,.24);
}

.shop-dialog::backdrop {
  background: rgba(23,26,24,.62);
  backdrop-filter: blur(5px);
}

.shop-dialog__layout {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
}

.shop-dialog__gallery {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--shop-image-surface);
}

.shop-dialog__media {
  position: relative;
  min-height: 0;
  height: 100%;
  background: var(--shop-image-surface);
}

.shop-dialog__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shop-dialog__image-nav {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255,255,255,.48);
  background: rgba(32,33,31,.52);
  font: 300 30px/1 var(--font-sans);
  cursor: pointer;
  transform: translateY(-50%);
}

.shop-dialog__image-nav.is-previous { left: 14px; }
.shop-dialog__image-nav.is-next { right: 14px; }
.shop-dialog__image-nav:disabled { opacity: .28; cursor: not-allowed; }
.shop-dialog__image-nav[hidden] { display: none; }

.shop-dialog__image-count {
  position: absolute;
  right: 14px;
  bottom: 14px;
  min-width: 48px;
  padding: 7px 10px;
  color: #fff;
  background: rgba(32,33,31,.62);
  font-size: 11px;
  text-align: center;
}

.shop-dialog__image-count:empty { display: none; }

.shop-dialog__thumbnails {
  padding: 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  border-top: 1px solid var(--line);
}

.shop-dialog__thumbnails[hidden] { display: none; }

.shop-dialog__thumbnail {
  flex: 0 0 62px;
  width: 62px;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.shop-dialog__thumbnail[aria-current="true"] { border-color: var(--ink); }

.shop-dialog__thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-dialog__content {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: clamp(32px, 3.8vw, 54px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
}

.shop-dialog__close {
  min-height: 38px;
  margin-left: auto;
  padding: 0 12px;
  color: var(--shop-muted);
  border: 0;
  background: transparent;
  cursor: pointer;
}

.shop-dialog__category {
  margin-top: clamp(28px, 4vh, 46px);
  color: var(--shop-muted);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.shop-dialog__title {
  margin: 14px 0 0;
  font-size: clamp(29px, 2.5vw, 40px);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -.025em;
}

.shop-dialog__description {
  margin: 20px 0 0;
  color: var(--ink-soft);
  line-height: 1.9;
}

.shop-dialog__price {
  margin-top: 22px;
  font-size: 22px;
  font-weight: 500;
}

.shop-dialog__contact {
  min-height: 48px;
  margin-top: 26px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--ink);
  transition: background .25s var(--ease), transform .25s var(--ease);
  white-space: nowrap;
}

.shop-dialog__contact:hover {
  background: var(--green);
}

.shop-dialog__contact:active {
  transform: translateY(1px);
}

@keyframes shopCardReveal {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shopSkeleton {
  to { transform: translateX(100%); }
}

@media (max-width: 1380px) {
  .shop-product-page { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .shop-product-page { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop-toolbar { flex-wrap: wrap; }
  .shop-pagination { margin-left: auto; }
}

@media (max-width: 760px) {
  .shop-section {
    padding: 88px 18px 112px;
  }
  .shop-heading {
    align-items: flex-end;
    justify-content: space-between;
  }
  .shop-title { font-size: 34px; }
  .shop-toolbar {
    margin-inline: -18px;
    padding: 14px 18px;
    display: grid;
    gap: 8px;
  }
  .shop-category,
  .shop-sort {
    width: 100%;
  }
  .shop-sort {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .shop-sort::-webkit-scrollbar { display: none; }
  .shop-sort button { flex: 0 0 auto; }
  .shop-category { justify-content: space-between; }
  .shop-pagination { margin-left: 0; justify-content: flex-end; }
  .shop-product-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 10px;
  }
  .shop-product-card__meta {
    margin-top: 11px;
    font-size: 9px;
  }
  .shop-product-card__title { font-size: 13px; }
  .shop-pagination { justify-content: center; }
  .shop-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }
  .shop-dialog__layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 52%) minmax(0, 48%);
  }
  .shop-dialog__thumbnail { flex-basis: 54px; width: 54px; }
  .shop-dialog__thumbnails { padding: 8px; }
  .shop-dialog__content { padding: 16px 20px 20px; }
  .shop-dialog__close { min-height: 32px; }
  .shop-dialog__category { margin-top: 6px; }
  .shop-dialog__title { margin-top: 8px; font-size: clamp(24px, 7vw, 30px); }
  .shop-dialog__description { margin-top: 10px; font-size: 13px; line-height: 1.6; }
  .shop-dialog__price { margin-top: 14px; font-size: 20px; }
  .shop-dialog__contact { min-height: 42px; margin-top: 16px; }
}

@media (min-width: 761px) and (max-height: 760px) {
  .shop-dialog__content { padding: 26px 32px; }
  .shop-dialog__category { margin-top: 18px; }
  .shop-dialog__title { font-size: 30px; }
  .shop-dialog__description { margin-top: 14px; line-height: 1.65; }
  .shop-dialog__price { margin-top: 18px; }
  .shop-dialog__contact { min-height: 44px; margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .shop-product-card { animation: none !important; }
  .shop-product-card__media img { transition: none !important; }
  .shop-skeleton__image::after,
  .shop-skeleton__line::after { animation: none !important; }
}
