/* Фотографии привязаны к модели и цвету. Размер области не зависит от пропорций исходного файла. */
.shop-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.shop-grid .card-art { flex: 0 0 auto; }
.shop-card-image { position: relative; overflow: hidden; }
.shop-card-image > :is(.shop-photo, .shop-photo-frame) {
  position: absolute;
  inset: 0;
  padding: 16px 40px;
  pointer-events: none;
}
@media (hover: hover) {
  .shop-card-image > :is(.shop-photo, .shop-photo-frame) { transition: transform var(--motion-ui) var(--ease-out); }
  .shop-card-image:hover > :is(.shop-photo, .shop-photo-frame) { transform: scale(1.025); }
}
.shop-photo-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  container-type: size;
}
.shop-photo-plate {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  width: min(100cqw, calc(100cqh * var(--photo-ratio)));
  aspect-ratio: var(--photo-ratio);
}
.shop-photo-plate .shop-photo {
  position: absolute;
  top: var(--photo-y, 0%);
  left: var(--photo-x, 0%);
  width: var(--photo-w, 100%);
  height: var(--photo-h, 100%);
  max-width: none;
}
.shop-photo-mark {
  position: absolute;
  left: var(--mark-x);
  top: var(--mark-y);
  width: var(--mark-size);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  mask: url("../assets/brand/mark.png") center / contain no-repeat;
  background: linear-gradient(145deg, color-mix(in srgb, var(--mark-tint), #fff 15%), var(--mark-tint));
  opacity: .88;
  pointer-events: none;
}
.card-art:has(.shop-photo), .shop-product-stage:has(.shop-photo) { background: #fff; }
.shop-media-empty {
  display: block;
  color: var(--soft);
  font-size: 14px;
  text-align: center;
}
.card-art:has(.shop-media-empty) { height: 78px; background: #f0eaf8; }
.card-art:has(.shop-media-empty) .shop-card-actions { display: flex; }
.shop-card-image .shop-media-empty { align-self: end; padding-bottom: 9px; }
.series-render { display: grid; position: relative; place-items: center; width: 100%; min-height: 0; height: 100%; }
.series-render > :is(.shop-photo, .shop-photo-frame) { position: absolute; inset: 0; max-height: 76px; }
.series-render:empty { display: none; }
.series-rail:not(:has(.shop-photo)) .series-tile {
  grid-template-rows: auto;
  min-height: 50px;
  border-radius: 12px;
}
.series-rail:not(:has(.shop-photo)) .series-all .brand-mark { display: none; }

.shop-product-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #eee8f7;
}
.shop-product-art { flex: none; height: clamp(235px, 44vh, 350px); min-height: 0; background: transparent; padding: 16px; overflow: hidden; }
.shop-product-art .shop-photo { min-height: 0; }
.shop-product-art .shop-media-empty { padding: 20px; max-width: 28ch; }
.shop-product-art > .shop-photo-enter { animation: photo-show 180ms var(--ease-out) both; }
@keyframes photo-show {
  from { opacity: .35; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.phone-gallery-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 14px;
}
.phone-gallery-tabs[hidden] { display: none; }
.phone-gallery-note { margin: 0 12px 12px; color: var(--soft); font-size: 13px; text-align: center; }
.phone-gallery-tab {
  width: 50px;
  height: 56px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--motion-fast), background-color var(--motion-fast);
}
.phone-gallery-tab[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.phone-gallery-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shop-photo-mini { display: block; width: 43px; height: 65px; grid-row: span 2; }
.shop-photo-mini:empty { height: 0; }
.shop-photo-mini .shop-media-empty { display: none; }
.shop-table .shop-photo-mini { width: min(100%, 80px); height: 90px; margin: 0 auto 8px; }

@media (max-width: 520px) {
  .shop-heading { gap: 12px; }
  .shop-heading p { margin-top: 8px; }
  .shop-visit { padding: 6px 10px 6px 6px; }
  .shop-visit-icon { width: 32px; height: 32px; }
  .series-rail { grid-auto-columns: max-content; padding-bottom: 7px; }
  .series-rail .series-tile {
    grid-template: auto / auto auto;
    gap: 7px;
    min-height: 52px;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
  }
  .series-render { width: 29px; height: 38px; }
  .series-all .brand-mark { width: 28px; }
  .shop-card-image > :is(.shop-photo, .shop-photo-frame) { padding: 14px 24px; }
  .shop-product-art { height: clamp(150px, 27svh, 230px); padding: 10px; }
  .phone-gallery-tab { height: 48px; }
}
