/* The storefront inherits Yamari's type, ink, and cobalt from the release. */
.shop-page {
  --shop-canvas: #fbf8f4;
  --shop-paper: #fffdfa;
  --shop-studio: #f2ede7;
  --shop-edge: #e4d9d0;
  --shop-control-edge: #94827e;
  --shop-muted: #5d5359;
  --shop-burgundy: #5c1d34;
  --shop-burgundy-dark: #431226;
  --shop-rose: #f7eced;
  --shop-cobalt: var(--blue, #074d9d);
  --shop-ink: var(--ink, #101c2e);
  --shop-radius: .875rem;
  --shop-gap: clamp(.875rem, 2vw, 1.5rem);
  --shop-section-space: clamp(2rem, 5vw, 4.5rem);
  background: var(--shop-canvas);
  color: var(--shop-ink);
}

.shop-main {
  padding-block-end: var(--shop-section-space);
  overflow-wrap: anywhere;
}

/* Controls and views retain the visibility set by the shop script. */
.shop-main[hidden],
.shop-main [hidden] { display: none !important; }

.shop-main :focus-visible {
  outline: 3px solid var(--shop-cobalt);
  outline-offset: 3px;
}

/* Storefront introduction */
.shop-main .shop-hero {
  padding-block: clamp(2.5rem, 6.4vw, 6.25rem);
  border-block-end: 1px solid var(--shop-burgundy-dark);
  background:
    radial-gradient(ellipse at 93% 62%, #873d582e 26%, #f5c6d21c 26.3%, transparent 26.7% 41%, #f5c6d216 41.3%, transparent 41.7% 55%, #f5c6d212 55.3%, transparent 55.7%),
    linear-gradient(112deg, var(--shop-burgundy-dark) 8%, var(--shop-burgundy) 70%, #69243e);
  color: #fffaf7;
}

.shop-main .shop-hero__copy { max-inline-size: 49rem; }

.shop-main .shop-hero h1,
.shop-main .shop-detail h1 {
  font-weight: 700;
  letter-spacing: -.058em;
  line-height: 1.02;
  text-wrap: wrap;
}

.shop-main .shop-hero h1 { font-size: clamp(2.75rem, 1.4rem + 5.6vw, 6rem); }

.shop-main .shop-hero p {
  max-inline-size: 51ch;
  margin-block-start: clamp(.8rem, 2vw, 1.35rem);
  color: #f5dfe5;
  font-size: clamp(1rem, .93rem + .36vw, 1.18rem);
  line-height: 1.6;
}

.shop-main .shop-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
  margin-block-start: clamp(1.25rem, 2.7vw, 2rem);
}

.shop-main :is(.shop-hero__actions a, .shop-inquiry, .shop-secondary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 44px;
  min-block-size: 48px;
  max-inline-size: 100%;
  padding: .65rem 1rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.shop-main .shop-hero__actions a {
  border-color: #e8beca;
  background: transparent;
  color: #fffaf7;
}

.shop-main .shop-hero__actions a:first-child {
  border-color: #fffaf7;
  background: #fffaf7;
  color: var(--shop-burgundy-dark);
}

.shop-main .shop-hero__actions a:focus-visible { outline-color: #fffaf7; }

.shop-main .shop-hero__actions a:is(:hover, :active) { background: #ffffff1f; }
.shop-main .shop-hero__actions a:first-child:is(:hover, :active) { background: #f5dfe5; }

/* Catalog and filters */
.shop-main .shop-catalog { padding-block-start: var(--shop-section-space); }

.shop-main .shop-section-heading { margin-block-end: clamp(1rem, 2.4vw, 1.65rem); }

.shop-main :is(h2, h3).shop-section-heading,
.shop-main .shop-section-heading :is(h2, h3) {
  color: var(--shop-ink);
  font-size: clamp(1.85rem, 1.12rem + 2.5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -.052em;
  line-height: 1.08;
  text-wrap: wrap;
}

.shop-main .shop-section-heading p {
  max-inline-size: 60ch;
  margin-block-start: .55rem;
  color: var(--shop-muted);
}

.shop-main .shop-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: .8rem var(--shop-gap);
  padding: clamp(.875rem, 2.1vw, 1.25rem);
  border: 1px solid var(--shop-edge);
  border-radius: var(--shop-radius);
  background: var(--shop-paper);
}

.shop-main .shop-field {
  display: grid;
  min-inline-size: 0;
  gap: .35rem;
  font-size: .875rem;
  font-weight: 700;
}

.shop-main :is(#shop-search, #shop-brand, #shop-sort) {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 48px;
  margin: 0;
  padding: .55rem .7rem;
  border: 1px solid var(--shop-control-edge);
  border-radius: .45rem;
  background-color: #fff;
  color: var(--shop-ink);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.3;
}

.shop-main :is(#shop-brand, #shop-sort) { cursor: pointer; }
.shop-main #shop-search::placeholder { color: var(--shop-muted); opacity: 1; }

.shop-main .shop-status {
  margin-block: .85rem;
  color: var(--shop-muted);
  font-size: .9rem;
  font-weight: 700;
}

.shop-main .shop-status:empty { margin: 0; }

.shop-main .shop-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--shop-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-main .shop-card {
  display: flex;
  min-inline-size: 0;
}

.shop-main .shop-card__link {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-inline-size: 0;
  min-block-size: 44px;
  padding: .5rem;
  border: 1px solid var(--shop-edge);
  border-radius: var(--shop-radius);
  background: var(--shop-paper);
  color: var(--shop-ink);
  text-decoration: none;
}

.shop-main .shop-card__link:is(:focus-visible, :active) { border-color: var(--shop-cobalt); }

/* Shared image stage. The companion stylesheet supplies image treatments. */
.shop-main :is(.shop-card, .shop-detail__media) .shop-photo {
  position: relative;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  aspect-ratio: 1;
  min-inline-size: 0;
  overflow: hidden;
  padding: clamp(.75rem, 2vw, 1.5rem);
  border-radius: .55rem;
  background: var(--shop-studio);
}

:where(.shop-main .shop-photo > .shop-photo__shot) {
  inline-size: 100%;
  block-size: 100%;
  min-inline-size: 0;
  min-block-size: 0;
}

:where(.shop-main .shop-photo__shot > img) {
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
}

.shop-main .shop-photo__missing {
  color: var(--shop-muted);
  font-size: .9rem;
  text-align: center;
}

.shop-main .shop-card__copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-inline-size: 0;
  padding: .9rem clamp(.55rem, 1.35vw, .95rem) 0;
}

.shop-main :is(.shop-card__copy small, .shop-detail__brand) {
  color: var(--shop-burgundy);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.shop-main .shop-card__copy h2 {
  margin-block: .25rem .4rem;
  font-size: clamp(1.15rem, 1rem + .5vw, 1.5rem);
  line-height: 1.16;
  letter-spacing: -.035em;
  text-wrap: wrap;
}

.shop-main .shop-card__copy p {
  color: var(--shop-muted);
  font-size: .875rem;
  line-height: 1.45;
}

.shop-main .shop-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-block: .7rem .9rem;
}

.shop-main :is(.shop-swatch, .shop-color__dot) {
  display: inline-block;
  flex: none;
  inline-size: .875rem;
  block-size: .875rem;
  border: 1px solid #32263366;
  border-radius: 50%;
  background-color: var(--swatch, #c6bcbc);
}

.shop-main .shop-card__cta,
.shop-main .shop-back {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding-block: .4rem;
  color: var(--shop-cobalt);
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.25;
}

.shop-main .shop-card__cta {
  justify-content: space-between;
  margin-block-start: auto;
  border-block-start: 1px solid var(--shop-edge);
}

.shop-main .shop-card__link > :is(.shop-swatches, .shop-card__cta) { margin-inline: .55rem; }

.shop-main .shop-card__cta::after,
.shop-main .shop-back::before {
  content: "";
  flex: none;
  inline-size: .45em;
  block-size: .45em;
  margin-inline: .12em;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}

/* Product view and configuration */
.shop-main .shop-detail { padding-block-start: clamp(1rem, 3vw, 2.5rem); }

.shop-main .shop-back {
  margin-block-end: .7rem;
  text-decoration: none;
}

.shop-main .shop-back::before { transform: rotate(-135deg); }

.shop-main .shop-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--shop-gap);
}

.shop-main :is(.shop-detail__media, .shop-detail__config) { min-inline-size: 0; }

.shop-main .shop-detail__media .shop-photo {
  border: 1px solid var(--shop-edge);
  border-radius: var(--shop-radius);
  background: radial-gradient(ellipse at 50% 36%, var(--shop-paper), var(--shop-studio) 74%);
}

.shop-main .shop-credit {
  border-color: var(--shop-edge);
  color: var(--shop-muted);
}

.shop-main .shop-credit > summary {
  justify-content: flex-start;
  gap: .65rem;
  min-block-size: 44px;
  padding: .45rem .25rem;
  color: var(--shop-cobalt);
  font-size: .875rem;
}

.shop-main .shop-credit p {
  padding: 0 .25rem .5rem;
  color: var(--shop-muted);
  font-size: .85rem;
}

.shop-main .shop-detail__config {
  padding: clamp(1rem, 3.4vw, 2.5rem);
  border: 1px solid var(--shop-edge);
  border-radius: var(--shop-radius);
  background: var(--shop-paper);
}

.shop-main .shop-detail h1 {
  margin-block-start: .35rem;
  font-size: clamp(2.1rem, 1.35rem + 3.25vw, 4rem);
}

.shop-main .shop-detail__intro {
  margin-block: .65rem 1.2rem;
  color: var(--shop-muted);
}

.shop-main .shop-options {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.shop-main .shop-options + .shop-options { margin-block-start: .85rem; }

.shop-main .shop-options legend {
  max-inline-size: 100%;
  margin-block-end: .4rem;
  padding: 0;
  font-weight: 700;
}

.shop-main .shop-options__choices {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.shop-main :is(.shop-color, .shop-storage) {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-inline-size: 44px;
  min-block-size: 44px;
  max-inline-size: 100%;
  padding: .48rem .68rem;
  border: 1px solid var(--shop-control-edge);
  border-radius: .5rem;
  background: #fff;
  color: var(--shop-ink);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.25;
}

.shop-main .shop-options input[type="radio"] { accent-color: var(--shop-burgundy); }

/* Keep the native radio as the keyboard and assistive-technology control. */
@supports selector(label:has(input)) {
  .shop-main .shop-options input[type="radio"] {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: 0;
    clip-path: inset(50%);
  }

  .shop-main :is(.shop-color, .shop-storage)::after {
    content: "";
    flex: none;
    inline-size: .36rem;
    block-size: .66rem;
    margin-inline: .05rem .1rem;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: translateY(-.08rem) rotate(45deg);
    visibility: hidden;
  }

  .shop-main :is(.shop-color, .shop-storage):is(:has(input:checked), input:checked + label) {
    border-color: var(--shop-burgundy);
    background: var(--shop-rose);
    box-shadow: inset 0 0 0 1px var(--shop-burgundy);
    color: var(--shop-burgundy-dark);
  }

  .shop-main :is(.shop-color, .shop-storage):is(:has(input:checked), input:checked + label)::after {
    visibility: visible;
  }

  .shop-main :is(.shop-color, .shop-storage):is(:has(input:focus-visible), input:focus-visible + label) {
    outline: 3px solid var(--shop-cobalt);
    outline-offset: 2px;
  }

  .shop-main :is(.shop-color, .shop-storage):is(:has(input:disabled), input:disabled + label) {
    border-style: dashed;
    background: var(--shop-canvas);
    color: var(--shop-muted);
    cursor: default;
  }
}

.shop-main .shop-detail__selection {
  margin-block: 1.25rem .75rem;
  padding: .65rem .8rem;
  border-inline-start: 3px solid var(--shop-burgundy);
  border-radius: .2rem .45rem .45rem .2rem;
  background: var(--shop-rose);
  color: var(--shop-burgundy-dark);
  font-size: .9rem;
  font-weight: 700;
}

.shop-main .shop-detail__selection:empty { display: none; }

.shop-main .shop-inquiry {
  display: flex;
  inline-size: 100%;
  background: var(--shop-burgundy);
  color: #fff;
}

.shop-main .shop-inquiry:is(:hover, :active) { background: var(--shop-burgundy-dark); }

.shop-main .shop-detail__note {
  margin-block-start: .65rem;
  color: var(--shop-muted);
  font-size: .85rem;
}

.shop-main .shop-more {
  margin-block-start: var(--shop-section-space);
  padding-block-start: clamp(1.25rem, 3vw, 2.25rem);
  border-block-start: 1px solid var(--shop-edge);
}

.shop-main .shop-more .shop-section-heading :is(h2, h3) {
  font-size: clamp(1.65rem, 1.2rem + 1.8vw, 2.55rem);
}

/* Alternate lookup, results, and credits */
.shop-main .shop-lookup {
  inline-size: min(76rem, calc(100% - 2 * var(--edge, 1.125rem)));
  margin: var(--shop-section-space) auto 0;
  border: 1px solid var(--shop-edge);
  border-radius: var(--shop-radius);
  background: var(--shop-paper);
}

.shop-main .shop-lookup > summary {
  min-block-size: 52px;
  padding: .75rem clamp(.95rem, 2.5vw, 1.45rem);
  border-radius: var(--shop-radius);
  color: var(--shop-cobalt);
  line-height: 1.35;
}

.shop-main :is(.shop-lookup, .shop-credit) > summary::after {
  inline-size: .52em;
  block-size: .52em;
  margin-inline-end: .15rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  background: none;
  transform: translateY(-.12em) rotate(45deg);
}

.shop-main :is(.shop-lookup, .shop-credit)[open] > summary::after {
  transform: translateY(.12em) rotate(225deg);
}

.shop-main .shop-lookup[open] > summary { border-block-end: 1px solid var(--shop-edge); }

.shop-main .shop-lookup .model-directory {
  border: 0;
  border-end-start-radius: var(--shop-radius);
  border-end-end-radius: var(--shop-radius);
}

.shop-main .shop-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  padding: clamp(1rem, 3vw, 1.8rem);
  border: 1px solid var(--shop-edge);
  border-radius: var(--shop-radius);
  background: var(--shop-paper);
}

.shop-main .shop-empty p { flex: 0 0 100%; }

.shop-main .shop-secondary {
  border-color: var(--shop-control-edge);
  background: var(--shop-paper);
  color: var(--shop-cobalt);
}

.shop-main .shop-secondary:is(:hover, :active) { background: #eef4fd; }

.shop-main :is(.shop-empty, .shop-status, .shop-credit, noscript) a:not(.shop-secondary) {
  display: inline-flex;
  align-items: center;
  min-inline-size: 44px;
  min-block-size: 44px;
  max-inline-size: 100%;
  color: var(--shop-cobalt);
  vertical-align: middle;
}

.shop-main :is(.shop-back, .shop-credit > summary, .shop-lookup > summary):hover {
  text-decoration: underline;
  text-underline-offset: .22em;
}

@media (min-width: 30rem) {
  .shop-main :is(.shop-controls, .shop-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-main .shop-field:has(#shop-search) { grid-column: 1 / -1; }
}

@media (min-width: 48rem) {
  .shop-main .shop-detail__grid { grid-template-columns: minmax(0, 1fr) minmax(0, .94fr); }
}

@media (min-width: 52rem) {
  .shop-main .shop-controls { grid-template-columns: minmax(0, 1.65fr) repeat(2, minmax(0, 1fr)); }
  .shop-main .shop-field:has(#shop-search) { grid-column: auto; }
  .shop-main .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 68rem) {
  .shop-main .shop-catalog .shop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (hover: hover) {
  .shop-main .shop-card__link:hover {
    border-color: #a57b8b;
    box-shadow: 0 .55rem 1.4rem #50263b13;
  }

  .shop-main .shop-card__link:hover .shop-card__cta { text-decoration: underline; }
  .shop-main :is(.shop-color, .shop-storage):hover { border-color: var(--shop-burgundy); }
}

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-ym-motion="off"]) .shop-main :is(.shop-card__link, .shop-inquiry, .shop-secondary, .shop-hero__actions a) {
    transition: background-color 150ms ease-out, border-color 150ms ease-out, box-shadow 150ms ease-out;
  }

  :root:not([data-ym-motion="off"]) .shop-main .shop-card[data-shop-animate] {
    animation: yamari-shop-card-in 260ms ease-out backwards;
    animation-delay: calc(28ms * clamp(0, var(--shop-order, 0), 3));
  }

  :root:not([data-ym-motion="off"]) .shop-main .shop-photo > [data-shop-animate] {
    animation: yamari-shop-photo-in 160ms ease-out;
  }
}

@keyframes yamari-shop-card-in {
  from { opacity: .86; transform: translateY(6px); }
}

@keyframes yamari-shop-photo-in {
  from { opacity: .76; }
}

@media (forced-colors: active) {
  .shop-main .shop-inquiry { border-color: ButtonText; }
  .shop-main :is(.shop-swatch, .shop-color__dot) { forced-color-adjust: none; border-color: CanvasText; }
}
