/* One product frame for every theme. A product photo fills the box (cover)
   unless that photo was saved as contain. Contain letterboxes on the photo's
   own edge colour, or white. Selectors sit above each theme's gallery rules
   so the ratio and the fit stay the same on the product page, the card, the
   cart and the thumbnails. */

body.sector-shell {
  --product-frame: 1 / 1;
  --product-fit: cover;
}

body.sector-shell[data-theme="butik"],
body.sector-shell[data-theme="moda"],
body.sector-shell[data-theme="podyum"],
body.sector-shell[data-theme="zarif"] {
  --product-frame: 3 / 4;
}

body.sector-shell[data-theme="klasik"],
body.sector-shell[data-theme="vitrin"],
body.sector-shell[data-theme="dokuma"],
body.sector-shell[data-theme="atolye"],
body.sector-shell[data-theme="hane"] {
  --product-frame: 4 / 5;
}

body.sector-shell[data-theme="salon"],
body.sector-shell[data-theme="devre"] {
  --product-frame: 4 / 3;
}

html body.sector-shell[data-theme][data-screen][data-help-id] .product .gallery .gallery-stage {
  position: relative;
  aspect-ratio: var(--product-frame);
  padding: 0;
  overflow: hidden;
}

html body.sector-shell[data-theme][data-screen][data-help-id] .product .gallery .gallery-stage > img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: var(--product-fit);
  padding: 0;
  background: transparent;
}

html body.sector-shell[data-theme][data-screen][data-help-id] .product .gallery .gallery-thumbs img {
  height: auto;
  aspect-ratio: var(--product-frame);
  object-fit: var(--product-fit);
  padding: 0;
  background: transparent;
}

html body.sector-shell[data-theme][data-screen][data-help-id] main ul.grid:not(.list) > .card > :is(.card-media, .card-gallery-wrap),
html body.sector-shell[data-theme][data-screen][data-help-id] main ul.grid.list > .card > :is(.card-media, .card-gallery-wrap),
html body.sector-shell[data-theme][data-screen] main .stack-section[data-cards][data-cards] ul.grid > li.card > :is(.card-media, .card-gallery-wrap) {
  aspect-ratio: var(--product-frame);
  padding: 0;
}

html body.sector-shell[data-theme][data-screen][data-help-id] main ul.grid > .card :is(.card-media, .card-frame) img,
html body.sector-shell[data-theme][data-screen] main .stack-section[data-cards] ul.grid > li.card :is(.card-media, .card-frame) img {
  width: 100%;
  height: 100%;
  object-fit: var(--product-fit);
  padding: 0;
  background: transparent;
}

html body.sector-shell[data-theme] .cart-image,
html body.sector-shell[data-theme] .quick-cart-image {
  aspect-ratio: var(--product-frame);
  height: auto;
  padding: 0;
  overflow: hidden;
  background: transparent;
}

html body.sector-shell[data-theme] .cart-image img,
html body.sector-shell[data-theme] .quick-cart-image img,
html body.sector-shell[data-theme] .buybox .variant-card img {
  width: 100%;
  height: 100%;
  aspect-ratio: var(--product-frame);
  object-fit: var(--product-fit);
  padding: 0;
  background: transparent;
}

html body.sector-shell[data-theme] .buybox .variant-card img {
  width: 4.5rem;
  height: auto;
}

html body.sector-shell[data-theme][data-screen][data-help-id] .product .gallery .gallery-stage > img[data-fit="contain"],
html body.sector-shell[data-theme][data-screen][data-help-id] .product .gallery .gallery-thumbs img[data-fit="contain"],
html body.sector-shell[data-theme][data-screen][data-help-id] main ul.grid > .card :is(.card-media, .card-frame) img[data-fit="contain"],
html body.sector-shell[data-theme][data-screen] main .stack-section[data-cards] ul.grid > li.card :is(.card-media, .card-frame) img[data-fit="contain"],
html body.sector-shell[data-theme] .cart-image img[data-fit="contain"],
html body.sector-shell[data-theme] .quick-cart-image img[data-fit="contain"],
html body.sector-shell[data-theme] .card-media img[data-fit="contain"],
html body.sector-shell[data-theme] .buybox .variant-card img[data-fit="contain"] {
  --product-fit: contain;
  object-fit: contain;
  padding: 0;
  background-color: var(--product-fill, #fff);
}

html body.sector-shell[data-theme][data-screen][data-help-id] .product .gallery .gallery-stage > img[data-fit="cover"],
html body.sector-shell[data-theme][data-screen][data-help-id] .product .gallery .gallery-thumbs img[data-fit="cover"],
html body.sector-shell[data-theme][data-screen][data-help-id] main ul.grid > .card :is(.card-media, .card-frame) img[data-fit="cover"],
html body.sector-shell[data-theme][data-screen] main .stack-section[data-cards] ul.grid > li.card :is(.card-media, .card-frame) img[data-fit="cover"],
html body.sector-shell[data-theme] .cart-image img[data-fit="cover"],
html body.sector-shell[data-theme] .quick-cart-image img[data-fit="cover"],
html body.sector-shell[data-theme] .card-media img[data-fit="cover"],
html body.sector-shell[data-theme] .buybox .variant-card img[data-fit="cover"] {
  --product-fit: cover;
  object-fit: cover;
}

/* List view on wide screens: a horizontal card (small photo left, details right) instead of one photo filling the row. */
@media (min-width: 841px) {
  html body.sector-shell[data-theme][data-screen][data-help-id] main ul.grid.list { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  html body.sector-shell[data-theme][data-screen][data-help-id] main ul.grid.list > .card { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); grid-auto-rows: auto; column-gap: 1.25rem; row-gap: .4rem; align-items: start; align-content: start; }
  html body.sector-shell[data-theme][data-screen][data-help-id] main ul.grid.list > .card > :is(.card-media, .card-gallery-wrap) { grid-column: 1; grid-row: 1 / span 8; width: 100%; max-width: 200px; align-self: start; }
  html body.sector-shell[data-theme][data-screen][data-help-id] main ul.grid.list > .card > :not(.card-media):not(.card-gallery-wrap) { grid-column: 2; min-width: 0; }
  html body.sector-shell[data-theme][data-screen][data-help-id] main ul.grid.list > .card .card-add { max-width: 22rem; }
}
