/* Single-product mobile presentation. The existing desktop template is untouched. */
@media (max-width: 900px) {
  html:has(body.single-product),
  body.single-product,
  body.single-product .an-product-scroll-root {
    scroll-snap-type: none !important;
    scroll-padding: 0 !important;
    scroll-behavior: auto !important;
  }
  html body.single-product main.product-shell:is(.product-shell, .an-product-mobile) {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 640px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin-inline: auto !important;
    padding: 0 20px 32px !important;
    overflow: visible !important;
    scroll-snap-align: none !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .product-hero {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 12px 0 24px !important;
    scroll-snap-align: none !important;
    scroll-snap-stop: normal !important;
    scroll-margin: 0 !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .product-hero-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 20px !important;
    margin: 0 !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .product-media {
    width: 100% !important;
    height: clamp(280px, 100vw, 540px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .product-info {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .product-info > * {
    margin-block: 0 12px !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) :is(.product-title-premium, .an-product-name) {
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    letter-spacing: normal !important;
    overflow-wrap: anywhere;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .an-product-subtitle {
    display: block;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    margin-top: 6px !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .product-price-premium {
    font-size: 16px !important;
    line-height: 1.5 !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .product-info .product-cta-premium {
    margin-top: 20px !important;
    text-align: left !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .product-info .product-cta-premium form.cart {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .product-cta-premium .an-piece-reference-single {
    display: block !important;
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
  }
  html body.single-product .product-shell .product-cta-premium .quantity:has(input[type="hidden"]) {
    display: none !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .product-info .product-cta-premium .single_add_to_cart_button {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 124px !important;
    min-height: 44px !important;
    max-width: 100% !important;
    margin: 0 0 0 auto !important;
    padding: 11px 14px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    letter-spacing: .025em !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) :is(.an-product-next, .an-product-home) {
    display: none !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) > .an-product-slide {
    display: block !important;
    position: relative !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 0 28px !important;
    overflow: visible !important;
    scroll-snap-align: none !important;
    scroll-snap-stop: normal !important;
    scroll-margin: 0 !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .an-product-back-nav {
    justify-content: flex-start !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .an-product-back-link {
    min-height: 44px;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
  }
  html body.single-product .product-shell .an-product-back-link > span[aria-hidden="true"] {
    display: none !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) :is(.an-product-slide-title, .an-product-details > summary) {
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    letter-spacing: .04em !important;
  }
  html body.single-product .product-shell:is(.product-shell, .an-product-mobile) .an-product-description {
    color: #f2ece3;
    font-size: 14px !important;
    line-height: 1.65 !important;
    overflow: visible !important;
    overflow-wrap: anywhere;
    height: auto !important;
    max-height: none !important;
  }
  html body.single-product .product-shell .an-product-description details > summary {
    box-sizing: border-box;
    min-height: 44px;
    padding-block: 12px !important;
    font-size: 14px !important;
    line-height: 1.5;
    cursor: pointer;
  }
  html body.single-product .an-product-footer-template.an-product-footer-stop {
    height: auto !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    scroll-snap-align: none !important;
    scroll-snap-stop: normal !important;
  }

  /* Replace only a recognized, successfully copied gallery. Keep native DOM intact. */
  html body.single-product .product-shell .an-store-media-ready > .product-gallery-stage {
    display: none !important;
  }
  html body.single-product .product-shell .an-store-product-primary {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
  }
  html body.single-product .product-shell :is(.an-store-product-views, .an-store-product-frame) {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
  }
  html body.single-product .product-shell .an-store-product-frame[hidden] {
    display: none !important;
  }
  html body.single-product .product-shell .an-store-product-primary :is(img, video) {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    background: transparent;
  }
  html body.single-product .product-shell .an-store-product-arrow {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    box-sizing: border-box;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
    margin: 0 !important;
    padding: 10px !important;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: #c99a32 !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }
  html body.single-product .product-shell .an-store-product-arrow.is-previous { left: -14px; }
  html body.single-product .product-shell .an-store-product-arrow.is-next { right: -14px; }
  html body.single-product .product-shell .an-store-product-arrow svg {
    display: block;
    width: 20px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
  }
  html body.single-product .product-shell .an-store-product-arrow:focus-visible {
    outline: 1px solid #c99a32;
    outline-offset: -5px;
  }
  html body.single-product .product-shell .an-store-product-view-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Defensive restoration when a viewport change precedes the matchMedia callback. */
@media (min-width: 901px) {
  .an-store-product-primary { display: none !important; }
}
