:where(.site-shell, :root[data-meemon-legacy]) {
  --media-frame-fill: var(--app-surface-secondary, var(--meemon-app-raised, #21172b));
  --media-frame-edge: var(--app-border-strong, var(--meemon-app-rim, rgb(228 210 247 / 22%)));
  --media-frame-depth: inset 0 1px rgb(255 255 255 / 18%), 0 3px 7px rgb(0 0 0 / 20%), 0 10px 25px rgb(0 0 0 / 17%);
  --media-frame-padding: clamp(5px, .65vw, 7px);
  --media-frame-radius: clamp(16px, 2vw, 22px);
}

/* Keep non-catalog artwork fully visible, with its existing inset frame. */
.site-shell .wallpaper-grid .wallpaper-preview,
:root[data-meemon-legacy] :is(.v3-wallpaper-card-image, .v3-horse-image, .wallet-launch-art, .archive-fortune-hero > img) {
  box-sizing: border-box;
  padding: var(--media-frame-padding);
  overflow: hidden;
  border: 1px solid var(--media-frame-edge);
  border-radius: var(--media-frame-radius);
  background: var(--media-frame-fill);
  box-shadow: var(--media-frame-depth);
}

.site-shell .wallpaper-grid .wallpaper-preview {
  margin: clamp(5px, .9vw, 10px);
  margin-block-end: 0;
}

.site-shell .wallpaper-grid .wallpaper-preview > img,
.site-shell .wallpaper-grid article:hover .wallpaper-preview > img,
:root[data-meemon-legacy] :is(.v3-wallpaper-card-image, .v3-horse-image) > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
}

/* The product card supplies one rounded clip for both the image and the glass. */
.site-shell .product-card,
:root[data-meemon-legacy] [data-v3-screen="shop-legacy"] :is(.product-card, .flash-sale-item) {
  overflow: hidden;
  border-radius: var(--media-frame-radius);
}

.site-shell .product-card > .product-image,
:root[data-meemon-legacy] [data-v3-screen="shop-legacy"] :is(.product-card > .product-img, .flash-sale-item > .flash-sale-img) {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}

.site-shell .product-card .product-image::after { content: none; }

.site-shell .product-card > .product-image > img,
.site-shell .product-card:hover .product-image > img,
:root[data-meemon-legacy] [data-v3-screen="shop-legacy"] :is(.product-img, .flash-sale-img) > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: none;
}

.site-shell .home-section .featured-products .product-card,
.site-shell .content-section .product-grid .product-card,
.site-shell .wallpaper-grid > article {
  box-shadow: var(--media-frame-depth);
}

.site-shell .wallpaper-grid > article { border-radius: var(--media-frame-radius); }

.site-shell .product-detail .product-gallery { align-content: start; }

.site-shell .product-gallery > :is(.product-main-image, .main-product-image),
:root[data-meemon-legacy] [data-v3-screen="shop-legacy"] .product-detail-img {
  overflow: hidden;
  border: 1px solid var(--media-frame-edge);
  border-radius: var(--media-frame-radius);
  background: var(--media-frame-fill);
  box-shadow: var(--media-frame-depth);
}

.site-shell .product-gallery > :is(.product-main-image, .main-product-image),
:root[data-meemon-legacy] [data-v3-screen="shop-legacy"] .product-detail-img:has(> img) {
  padding: 0;
  height: auto;
  aspect-ratio: auto;
}

.site-shell .product-gallery > :is(.product-main-image, .main-product-image) > img,
:root[data-meemon-legacy] [data-v3-screen="shop-legacy"] .product-detail-img > img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.site-shell :is(.cart-item > a img, .checkout-line img, .phone-history-items img, .horse-picker img, .chant-heading img),
:root[data-meemon-legacy] [data-v3-screen="shop-legacy"] :is(.cart-item-img, .checkout-item-img, .order-item-thumb, .admin-item-thumb) {
  box-sizing: border-box;
  border: 1px solid var(--media-frame-edge);
  border-radius: clamp(10px, 1.5vw, 16px);
  background: var(--media-frame-fill);
  box-shadow: var(--media-frame-depth);
}

.site-shell :is(.horse-picker img, .chant-heading img) {
  padding: 2px;
  object-fit: contain;
}

.site-shell :is(.cart-item > a img, .checkout-line img, .phone-history-items img),
.site-shell .thumbnail-row button > img,
:root[data-meemon-legacy] [data-v3-screen="shop-legacy"] :is(.cart-item-img, .checkout-item-img, .order-item-thumb, .admin-item-thumb) {
  padding: 0;
  object-fit: cover;
}

.site-shell .thumbnail-row button > img,
:root[data-meemon-legacy] [data-v3-screen="shop-legacy"] :is(.cart-item-img, .checkout-item-img, .order-item-thumb, .admin-item-thumb) > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

:root[data-meemon-legacy] [data-v3-screen="shop-legacy"] :is(.cart-item-img, .checkout-item-img, .order-item-thumb, .admin-item-thumb) {
  overflow: hidden;
}

:root[data-meemon-legacy] .v3-horse-image img { border-radius: 0; }
:root[data-meemon-legacy] .v3-wallpaper-card-image { width: auto; margin: .375rem; }

:root[data-meemon-legacy] .v3-wallpaper-modal-image > #modal-img,
:root[data-meemon-legacy] body[data-meemon-lifestyle="card-archive"] #wallpaper-result img,
.site-shell .admin-slip-viewer > img {
  box-sizing: border-box;
  width: auto;
  height: auto;
  max-width: 100%;
  padding: var(--media-frame-padding);
  border: 1px solid var(--media-frame-edge);
  border-radius: var(--media-frame-radius);
  box-shadow: var(--media-frame-depth);
  object-fit: contain;
}

:root[data-meemon-legacy] .v3-wallpaper-modal-image > #modal-img { max-height: 50svh; }
.site-shell .admin-slip-viewer > img { max-width: min(560px, 100%); }

@media (min-width: 48rem) {
  :root[data-meemon-legacy] .v3-wallpaper-modal-image > #modal-img { max-height: 68svh; }
}

:root[data-meemon-legacy] body[data-meemon-lifestyle="card-archive"] .stack-card-back > img {
  object-fit: contain;
  border-radius: 0;
}
