/**
 * Copyright since 2026 appiapp
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License version 3.0
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/AFL-3.0
 *
 * @author    appiapp
 * @copyright Since 2026 appiapp
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
 */

/* Wrapper is layout-transparent: children position against the image container */
.appiapp-stickers {
  display: contents;
}

/* One stack per position: same-position stickers pile up, never overlap */
.appiapp-stack {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.appiapp-sticker {
  /* inline-block: CSS transforms (offset X/Y) are ignored on inline elements,
     and inside the theme's flags <li> the sticker is not a flex item */
  display: inline-block;
  position: static;
  pointer-events: none;
  line-height: 1;
}

/* Stack direction/alignment per anchor */
.appiapp-sticker-top-right,
.appiapp-sticker-center-right,
.appiapp-sticker-bottom-right { align-items: flex-end; }

.appiapp-sticker-top-center,
.appiapp-sticker-center,
.appiapp-sticker-bottom-center { align-items: center; }

.appiapp-sticker-bottom-left,
.appiapp-sticker-bottom-center,
.appiapp-sticker-bottom-right { flex-direction: column-reverse; }

/* Stickers living inside the theme's product-flags list */
li.product-flag.appiapp-flag {
  background: none;
  padding: 0;
  box-shadow: none;
}

.appiapp-sticker img {
  display: block;
  max-width: 100%;
  height: auto;
}

.appiapp-sticker-text {
  display: inline-block;
  background: #ff4c4c;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 3px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Positions */
.appiapp-sticker-top-left      { top: 0.5rem; left: 0.5rem; }
.appiapp-sticker-top-center    { top: 0.5rem; left: 50%; transform: translateX(-50%); }
.appiapp-sticker-top-right     { top: 0.5rem; right: 0.5rem; }
.appiapp-sticker-center-left   { top: 50%; left: 0.5rem; transform: translateY(-50%); }
.appiapp-sticker-center        { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.appiapp-sticker-center-right  { top: 50%; right: 0.5rem; transform: translateY(-50%); }
.appiapp-sticker-bottom-left   { bottom: 0.5rem; left: 0.5rem; }
.appiapp-sticker-bottom-center { bottom: 0.5rem; left: 50%; transform: translateX(-50%); }
.appiapp-sticker-bottom-right  { bottom: 0.5rem; right: 0.5rem; }

/* Product detail page (classic + hummingbird themes).
   product-cover / carousel-inner wrap only the main image: stickers anchor
   there so "bottom"/"center" refer to the photo, not photo + thumbnails. */
.images-container,
.product__images,
.product-cover,
.carousel-inner {
  position: relative;
}

/* Product listing (classic theme) */
.product-miniature {
  position: relative;
  overflow: visible;
}

/* Anchoring targets: sticker groups are moved inside one of these */
.thumbnail-container,
.product-thumbnail {
  position: relative;
}

.product-miniature .appiapp-stack {
  z-index: 10;
}
