/* NASYPANEJ | LISTING 9.0.2 | Merkur
   Category, homepage and product detail. V8 base + approved V9 layout.
   Pair with ns-listing-v9.js. Native prices, cart and favourites retained. */

/* Native discount: keep both amounts, change only presentation. */
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image {
  position: relative;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image > .flags-extra {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: auto;
  left: auto;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p .flags-extra .flag-discount {
  display: inline-flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 5px 8px;
  border-radius: var(--ns-radius-small, 3px);
  background: #c91d27;
  color: #fff;
  line-height: 1.2;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p .flag-discount .price-save {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: inherit;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p .flag-discount .price-standard {
  font-size: 11px;
  line-height: 1.2;
  color: inherit;
}

/* The description and tools are children of the offer, not p-bottom.
   Other DOM variants retain the native layout. */
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p .p-bottom > [data-micro="offer"]:has(> .p-desc):has(> .prices):has(> .p-tools) {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p .p-bottom > [data-micro="offer"]:has(> .p-desc):has(> .prices):has(> .p-tools) > .p-desc {
  grid-column: 1 / -1;
  grid-row: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  width: auto;
  height: 3em;
  min-height: 0;
  max-height: 3em;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p .p-bottom > [data-micro="offer"]:has(> .p-desc):has(> .prices):has(> .p-tools) > .prices {
  grid-column: 1;
  grid-row: 2;
  width: auto;
  min-width: 0;
  margin: 0;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p .p-bottom > [data-micro="offer"]:has(> .p-desc):has(> .prices):has(> .p-tools) > .p-tools {
  grid-column: 2;
  grid-row: 2;
  width: auto;
  margin: 0;
}

@media (max-width: 767px) {
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p .p-bottom > [data-micro="offer"]:has(> .p-desc):has(> .prices):has(> .p-tools) {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p .p-bottom > [data-micro="offer"]:has(> .p-desc):has(> .prices):has(> .p-tools) > .p-tools {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > .p-in:has(.p-bottom > [data-micro="offer"] > .p-desc):has(.p-bottom > [data-micro="offer"] > .p-tools) > .p-in-in {
    min-height: 0;
    height: auto;
    margin-bottom: 4px;
  }
}

/* V3: mobile spacing and description clipping only.
   Keep native image spacing, ratings, favourites and purchasing controls. */
@media (max-width: 767px) {
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > .p-in:has(.p-bottom > [data-micro="offer"] > .p-desc):has(.p-bottom > [data-micro="offer"] > .p-tools) > .p-in-in > a.name {
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p .p-bottom > [data-micro="offer"]:has(> .p-desc):has(> .prices):has(> .p-tools) > .p-desc {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    box-sizing: border-box;
    line-height: 20px !important;
    height: 40px !important;
    min-height: 0 !important;
    max-height: 40px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip-path: inset(0);
  }
}

/* V4: mobile product photo scale, verified by local browser test. */
@media (max-width: 767px) {
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image > img {
    scale: 1.12;
  }
}

/* V5: native review count only, without brackets or average. */
body.paxio-merkur:is(.type-category, .type-index, .type-detail)
.product .stars-wrapper[data-micro-rating-count]:not([data-micro-rating-count="0"]):not([data-micro-rating-count=""])::after {
    content: attr(data-micro-rating-count);
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
    color: #777;
    margin-left: 4px;
    white-space: nowrap;
}

/* V6: equal mobile rating space, including products without stars.
   Exact rules from the local alignment test. */
@media (max-width: 767px) {
  body.paxio-merkur:is(.type-category, .type-index, .type-detail)
  .product > .p > .p-in {
    position: relative;
    padding-top: 12px !important;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail)
  .product > .p > .p-in > .stars-wrapper {
    position: absolute !important;
    top: -22px !important;
    left: 0;
    right: 0;
    height: 12px;
    margin: 0 !important;
    transform: none !important;
  }
}


/* V8: native badges, left stack, compact horizontal reference price.
   Never recalculate prices or discounts. Keep the native reference price visible.
   The tested hide-price rule is intentionally omitted. */
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image > .flags {
  left: 10px !important;
  right: auto !important;
  bottom: auto !important;
  width: max-content !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 4px !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image > .flags-extra,
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image > .flags-default {
  top: 10px !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image:has(> .flags-extra > .flag) > .flags-default {
  top: 38px !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image:has(> .flags-extra > .flag ~ .flag) > .flags-default {
  top: 66px !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-discount,
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-freeshipping,
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-new {
  box-sizing: border-box !important;
  width: max-content !important;
  height: 24px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 8px !important;
  margin: 0 !important;
  border-radius: 3px !important;
  float: none !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  white-space: nowrap;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-discount {
  background: #111 !important;
  color: #fff !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-discount .price-standard {
  order: 1;
  display: inline-block !important;
  font-size: 11px;
  line-height: 1.2;
  color: inherit;
  margin: 0;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-freeshipping .icon-van {
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 14px !important;
  line-height: 1 !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-freeshipping .icon-van::before {
  font-size: 14px !important;
  line-height: 1 !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-freeshipping .flag-text {
  font-size: 11px !important;
  line-height: 1 !important;
  margin: 0 !important;
}


/* V9: no card borders; preserve box dimensions and focus outlines. */
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .products,
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .products > .product,
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .products > .product > .p {
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Compact, native badge stacks. 22px badge + 4px gap. */
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image > .flags-extra,
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image > .flags-default {
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image:has(> .flags-extra > .flag) > .flags-default { top: 26px !important; }
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image:has(> .flags-extra > .flag ~ .flag) > .flags-default { top: 52px !important; }
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image:has(> .flags-extra > .flag ~ .flag ~ .flag) > .flags-default { top: 78px !important; }
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-discount,
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-new,
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-freeshipping {
  height: 22px !important;
  padding: 0 6px !important;
  font-size: 10px !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-discount .price-save,
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-discount .until,
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-freeshipping .flag-text {
  font-size: 10px !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-freeshipping .icon-van,
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p > a.image .flag-freeshipping .icon-van::before { font-size: 12px !important; }

/* V9: native stars above title; favourite stays in its native parent. */
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in {
  position: relative;
  padding-top: 0 !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-in-in {
  position: static !important;
  height: auto !important;
  min-height: 0 !important;
  margin-bottom: 2px !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 .p-in-in > .name {
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .stars-wrapper,
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .ns-rating-empty {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  box-sizing: border-box;
  height: 24px !important;
  min-height: 24px !important;
  margin: 0 0 5px !important;
  padding-right: 30px;
  align-items: center;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 .stars-wrapper > .stars { zoom: .85; }
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 .p-in-in > .dkLabFavouriteProductDiv {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  bottom: auto !important;
  height: 24px !important;
  line-height: 24px !important;
  transform: none !important;
  display: flex !important;
  align-items: center !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 .ns-card-subtitle {
  font-size: 13px;
  font-weight: 600 !important;
  color: #222;
  line-height: 17px;
  height: auto !important;
  min-height: 17px;
  max-height: 34px;
  margin: 0 0 5px !important;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Native crossed-out price moved by JS; never compute or fabricate a price. */
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p .prices > .ns-old-price {
  display: block !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 15px !important;
  color: #777 !important;
  text-decoration: line-through;
  margin: 0 0 2px !important;
}
body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 .prices {
  min-height: 59px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
}

/* Desktop: same native cart glyph as header, plus original label. */
@media (min-width: 768px) {
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > a.image { margin-bottom: 24px !important; }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 .p-tools { align-self: center !important; }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 .p-tools button.btn-cart[type="submit"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 .p-tools button.btn-cart[type="submit"]::before {
    content: "\e900" !important;
    font-family: "ikony" !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    font-style: normal !important;
    display: inline-block !important;
    position: static !important;
    line-height: 1 !important;
    margin: 0 !important;
    transform: none !important;
    flex-shrink: 0;
    color: inherit;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 .p-tools button.btn-cart[type="submit"] > span { margin: 0 !important; }
}

/* Mobile: approved text alignment and native purchase controls. */
@media (max-width: 767px) {
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 { display: flex !important; flex-direction: column !important; }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > a.image { flex-shrink: 0; margin-bottom: 30px !important; }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in,
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 .ns-card-subtitle {
    font-size: 12px;
    line-height: 16px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 .p-in-in > .dkLabFavouriteProductDiv { line-height: 20px !important; }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"] { flex: 1 1 auto; }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"]:has(> .p-tools button.btn-cart[type="submit"]),
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"]:has(> .p-tools > a.btn-primary) {
    display: grid !important;
    grid-template-rows: minmax(40px, 1fr) auto !important;
    column-gap: 6px !important;
    align-items: center;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"]:has(> .p-tools button.btn-cart[type="submit"]) { grid-template-columns: minmax(0, 1fr) 44px !important; }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"]:has(> .p-tools > a.btn-primary) { grid-template-columns: minmax(0, 1fr) auto !important; }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"] > .p-desc {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    align-self: start !important;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"] > .prices { grid-column: 1 !important; grid-row: 2 !important; min-width: 0; }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"]:has(> .p-tools button.btn-cart[type="submit"]) > .p-tools,
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"]:has(> .p-tools > a.btn-primary) > .p-tools {
    grid-column: 2 / 3 !important;
    grid-row: 2 / 3 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: center !important;
    justify-self: end !important;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"]:has(> .p-tools button.btn-cart[type="submit"]) > .p-tools { width: 44px !important; }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"]:has(> .p-tools > a.btn-primary) > .p-tools { width: auto !important; }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"]:has(> .p-tools button.btn-cart[type="submit"]) button.btn-cart[type="submit"] {
    box-sizing: border-box;
    position: relative;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 3px !important;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"]:has(> .p-tools button.btn-cart[type="submit"]) button.btn-cart[type="submit"]::before {
    content: "\e900" !important;
    font-family: "ikony" !important;
    font-size: 23px !important;
    font-weight: 400 !important;
    font-style: normal !important;
    display: block !important;
    position: static !important;
    line-height: 1 !important;
    margin: 0 !important;
    transform: none !important;
    color: inherit;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"]:has(> .p-tools button.btn-cart[type="submit"]) button.btn-cart[type="submit"] > span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  body.paxio-merkur:is(.type-category, .type-index, .type-detail) .product > .p.ns-text-v9 > .p-in > .p-bottom > [data-micro="offer"]:has(> .p-tools > a.btn-primary) > .p-tools > a.btn-primary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    width: auto !important;
    min-width: 0 !important;
    height: 44px !important;
    padding: 0 7px !important;
    font-size: 11px !important;
    white-space: nowrap;
    margin: 0 !important;
  }
}
