/*
 * Onea Shop V16 focused visual repair
 * ONLY requested scope:
 * 1) Hide the static carousel indicator because the hero is not a carousel.
 * 2) Preserve product-image aspect ratios and stop stretching/cropping.
 * 3) Visually blend ASBIS white-backed product images into the existing grey image surface.
 *
 * No footer, routes, API, catalogue, cart, checkout, account, database,
 * pricing, supplier or payment behaviour is changed here.
 */

/* Existing compact power-icon rules restored from the pre-V15 file. */
.mark {
  width: 58px !important;
  height: 58px;
  display: grid !important;
  place-items: center;
  overflow: hidden;
}

.mark img {
  display: block;
  width: 54px !important;
  height: 54px !important;
  object-fit: contain;
}

.actions .account {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.actions .account img {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain;
}

/* Requested 1: the hero is static, so do not show fake carousel pagination. */
.hero-index {
  display: none !important;
}

/* Requested 2: product imagery must retain its source aspect ratio. */
.product-image,
.onea-cart-item-image {
  isolation: isolate;
  overflow: hidden;
}

.product-image img,
.onea-cart-item-image img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: auto !important;
  padding: 0 !important;
  background: transparent !important;
}

/*
 * Requested 3: ASBIS/IT4Profit catalogue artwork frequently contains a baked-in
 * white canvas. Blend only those supplier images with the existing product-image
 * surface so the white square does not sit visibly inside the grey frame.
 * Other site photography and non-ASBIS images are not affected.
 */
.product-image img[src*="content.it4profit.com"],
.onea-cart-item-image img[src*="content.it4profit.com"] {
  mix-blend-mode: multiply;
}

@media (max-width: 840px) {
  .mark {
    width: 48px !important;
    height: 48px;
  }

  .mark img {
    width: 44px !important;
    height: 44px !important;
  }
}


/* Homepage department grid: matched columns, row heights and gutters. */
html body:not(.onea-category-page) .category-section .category-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  aspect-ratio: 2 / 1;
  gap: clamp(12px, 1.2vw, 20px) !important;
  align-items: stretch !important;
}
html body:not(.onea-category-page) .category-section .onea-merch-card {
  min-width: 0;
  min-height: 0;
  height: 100%;
  aspect-ratio: auto !important;
}
html body:not(.onea-category-page) .category-section .onea-merch-card:nth-child(-n+2) {
  grid-column: span 2;
}
html body:not(.onea-category-page) .category-section .onea-merch-card:nth-child(7) {
  grid-column: 2 / span 2 !important;
}
#ayo-shop-root .ayo-launcher {
  border-color: transparent !important;
}
@media (max-width: 1100px) {
  html body:not(.onea-category-page) .category-section .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
    aspect-ratio: 3 / 4;
  }
  html body:not(.onea-category-page) .category-section .onea-merch-card:nth-child(-n+2) {
    grid-column: auto;
  }
  html body:not(.onea-category-page) .category-section .onea-merch-card:nth-child(7) {
    grid-column: 1 / -1 !important;
    width: calc((100% - 18px) / 2) !important;
    justify-self: center !important;
  }
}
@media (max-width: 600px) {
  html body:not(.onea-category-page) .category-section {
    padding-bottom: 36px !important;
  }
  html body:not(.onea-category-page) .category-section .section-heading {
    margin-bottom: 24px !important;
  }
  html body:not(.onea-category-page) .category-section .category-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(6, auto) !important;
    aspect-ratio: auto !important;
  }
  html body:not(.onea-category-page) .category-section .onea-merch-card {
    height: 50vw !important;
    min-height: 184px !important;
    max-height: 300px !important;
    aspect-ratio: auto !important;
  }
  html body:not(.onea-category-page) .category-section .onea-merch-card:nth-child(7) {
    grid-column: auto !important;
    width: 100% !important;
    justify-self: stretch !important;
  }
}
/* Keep the four collection cards in the second row; clear the legacy Wi-Fi placement. */
html body:not(.onea-category-page) .category-section .category-grid > .onea-merch-card#wifi { grid-column: auto !important; }
html body:not(.onea-category-page) .category-section .category-grid > .onea-merch-card#laptops,
html body:not(.onea-category-page) .category-section .category-grid > .onea-merch-card#phones { grid-column: span 2 !important; }

#ayo-shop-root .ayo-launcher {
  border-color: transparent !important;
}
#ayo-shop-root .ayo-launcher { border: 0 !important; background: transparent !important; }

/* Preserve the six-card desktop layout without reserving an empty grid row. */
@media (min-width: 1101px) {
  html body:not(.onea-category-page) .category-section .category-grid {
    aspect-ratio: 2 / 1;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  }
}
/* Keep the one-column mobile grid from inheriting the desktop card spans. */
@media (max-width: 600px) {
  html body:not(.onea-category-page) .category-section .category-grid > .onea-merch-card#laptops,
  html body:not(.onea-category-page) .category-section .category-grid > .onea-merch-card#phones {
    grid-column: auto !important;
  }
}
