/* =========================================================
   DS Market – vylepšení detailu produktu
   soubor: /user/documents/product-detail.css  (+ product-detail.js)
   1) nákupní box hned pod štítky + plovoucí lišta při scrollu
   2) vyladěný nákupní box (stepper, sklad nad tlačítkem, výhody)
   5) Doplňkové parametry přilepené při scrollu
   6) bez hodnocení: místo prázdných hvězd „Ohodnoťte jako první“
   7) Zeptat se / Hlídat / Sdílet jako řádek odkazů
   8) Vlastnosti v parametrech jako seznam s fajfkami
   ========================================================= */

/* ---------- 1) pořadí v pravém sloupci ---------- */
.type-detail .p-info-wrapper > .p-detail-inner-header  { order: 1; }
.type-detail .p-info-wrapper > .p-detail-info          { order: 2; }
.type-detail .p-info-wrapper > .price-line             { order: 3; }
.type-detail .p-info-wrapper > .dsm-ship-date          { order: 4; }
.type-detail .p-info-wrapper > .p-short-description    { order: 5; }
.type-detail .p-info-wrapper > p                       { order: 6 !important; }
.type-detail .p-info-wrapper > .social-buttons-wrapper { order: 7; }
.type-detail .p-info-wrapper > .detail-parameters      { order: 8; }

/* ---------- 2) nákupní box ---------- */
.type-detail .p-info-wrapper > .price-line {
  display: grid !important;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "price stock"
    "cart  cart"
    "perks perks";
  align-items: center;
  gap: 16px 16px;
  margin: 4px 0 16px !important;
  padding: 20px 22px !important;
  background: #f3faf4 !important;
  border: 1px solid #d6ecdb;
  border-radius: 14px;
}
.type-detail .price-line .p-final-price-wrapper {
  grid-area: price;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.type-detail .price-line .price-final {
  font-size: 34px !important;
  line-height: 1.05;
  font-weight: 800;
  color: #14301c;
}
.type-detail .price-line .price-measure {
  font-size: 13px;
  color: #6b776e;
}

/* sklad – pilulka vpravo nahoře */
.type-detail .price-line .availability-value {
  grid-area: stock;
  justify-self: end;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  padding: 7px 13px 7px 11px;
  background: #fff;
  border: 1px solid #cfe7d5;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.type-detail .price-line .availability-value::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1f9d44;
  box-shadow: 0 0 0 3px rgba(31, 157, 68, .18);
}
.type-detail .price-line .availability-label { color: #1a7a35 !important; }
.type-detail .price-line .availability-amount { color: #5d6b61; font-weight: 600; }
.type-detail .price-line .delivery-line:empty { display: none; }

/* poslední kusy */
.type-detail .price-line .availability-value.dsm-low { border-color: #f3d9b5; }
.type-detail .price-line .availability-value.dsm-low::before {
  background: #e08600;
  box-shadow: 0 0 0 3px rgba(224, 134, 0, .2);
}
.type-detail .price-line .availability-value.dsm-low .availability-amount { color: #b56a00; }

/* množství + tlačítko */
.type-detail .price-line .add-to-cart {
  grid-area: cart;
  display: flex !important;
  align-items: stretch;
  gap: 12px;
  margin: 0 !important;
  width: 100%;
}
.type-detail .price-line .quantity {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  flex: 0 0 auto;
  width: auto !important;
  height: 54px;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff;
  border: 1px solid #cdd9d0;
  border-radius: 12px;
}
.type-detail .price-line .quantity .decrease,
.type-detail .price-line .quantity .increase {
  position: static !important;
  transform: none !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 42px !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: #1f8f3a !important;
  font-size: 22px !important;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  opacity: 1 !important;
}
.type-detail .price-line .quantity .decrease { order: 0; border-radius: 12px 0 0 12px !important; }
.type-detail .price-line .quantity label     { order: 1; margin: 0; height: 100%; }
.type-detail .price-line .quantity .increase { order: 2; border-radius: 0 12px 12px 0 !important; }
.type-detail .price-line .quantity .increase__sign,
.type-detail .price-line .quantity .decrease__sign {
  display: block !important;
  position: static !important;
  transform: none !important;
  font-size: 22px !important;
  line-height: 1;
  color: #1f8f3a !important;
}
.type-detail .price-line .quantity .increase::before, .type-detail .price-line .quantity .increase::after,
.type-detail .price-line .quantity .decrease::before, .type-detail .price-line .quantity .decrease::after { display: none !important; }
.type-detail .price-line .quantity > [class*="-tooltip"] { position: absolute !important; }
.type-detail .price-line .quantity .decrease:hover,
.type-detail .price-line .quantity .increase:hover { background: #eef7f0 !important; }
.type-detail .price-line .quantity input.amount {
  width: 44px !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center;
  font-size: 18px !important;
  font-weight: 700;
  color: #14301c;
  -moz-appearance: textfield;
}
.type-detail .price-line .quantity input.amount::-webkit-outer-spin-button,
.type-detail .price-line .quantity input.amount::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.type-detail .price-line .add-to-cart-button {
  flex: 1 1 auto;
  height: 54px;
  margin: 0 !important;
  padding: 0 24px !important;
  border-radius: 12px !important;
  font-size: 18px !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(31, 157, 68, .22);
}

/* výhody pod tlačítkem (vkládá JS) */
.type-detail .dsm-buy-perks {
  grid-area: perks;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding-top: 14px;
  border-top: 1px dashed #cfe2d4;
  font-size: 14px;
  color: #3f4d43;
}
.type-detail .dsm-buy-perks > span { display: inline-flex; align-items: center; gap: 7px; }
.type-detail .dsm-buy-perks > span > span { display: inline; }
@media (min-width: 768px) {
  .type-detail .dsm-buy-perks > span { white-space: nowrap; }
}
.type-detail .dsm-buy-perks svg { width: 18px; height: 18px; color: #1f8f3a; flex: 0 0 18px; }
.type-detail .dsm-buy-perks strong { color: #14301c; }

/* ---------- 1) plovoucí lišta (vkládá JS) ---------- */
.dsm-sticky-buy {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 990;
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid #dfe9e2;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .08);
  transform: translateY(110%);
  transition: transform .25s ease;
}
.dsm-sticky-buy.is-visible { transform: translateY(0); }
.dsm-sticky-buy__in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.dsm-sticky-buy__img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  flex: 0 0 48px;
}
.dsm-sticky-buy__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: #14301c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dsm-sticky-buy__price {
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 800;
  color: #14301c;
  white-space: nowrap;
}
.dsm-sticky-buy__btn {
  flex: 0 0 auto;
  height: 46px;
  padding: 0 26px;
  border: 0;
  border-radius: 11px;
  background: #1fa64a;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(31, 157, 68, .25);
}
.dsm-sticky-buy__btn:hover { background: #188a3c; }

/* ---------- 5) přilepené Doplňkové parametry ---------- */
.type-detail .overall-wrapper { overflow: clip !important; }  /* hidden by sticky vypnulo */
@media (min-width: 992px) {
  .type-detail .extended-description.dsm-sticky {
    position: sticky;
    top: 76px;
    align-self: flex-start;
  }
}

/* ---------- 6) produkt bez hodnocení ---------- */
.type-detail .stars-wrapper.dsm-norating .stars { display: none !important; }
.type-detail .stars-wrapper.dsm-norating .js-ratingDialogTrigger {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 0 !important;
  font-size: 14px;
  color: #3f4d43 !important;
  text-decoration: none !important;
}
.type-detail .stars-wrapper.dsm-norating .js-ratingDialogTrigger::before {
  content: "★";
  font-size: 16px;
  color: #e0a100;
}
.type-detail .stars-wrapper.dsm-norating .js-ratingDialogTrigger:hover { color: #1f8f3a !important; text-decoration: underline !important; }

/* ---------- 7) Zeptat se / Hlídat / Sdílet ---------- */
.type-detail .social-buttons-wrapper { margin: 4px 0 0 !important; }
.type-detail .social-buttons-wrapper .link-icons {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: flex-start;
  padding: 12px 0 0 !important;
  border-top: 1px solid #edf1ee;
}
.type-detail .social-buttons-wrapper .link-icon {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 7px;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 4px 0 !important;
  color: #3f4d43 !important;
  font-size: 14px !important;
  text-align: left;
  text-decoration: none;
}
.type-detail .social-buttons-wrapper .link-icon.print { display: none !important; }
/* vlastní ikony místo různě velkých obrázků ze šablony */
.type-detail .social-buttons-wrapper .link-icon::before {
  content: "" !important;
  position: static !important;
  flex: 0 0 18px;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  transform: none !important;
  opacity: 1 !important;
  background: #1f8f3a !important;
  -webkit-mask: var(--dsm-ico) center / contain no-repeat;
  mask: var(--dsm-ico) center / contain no-repeat;
}
.type-detail .social-buttons-wrapper .link-icon.chat {
  --dsm-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20.5l1.4-4.9A8 8 0 1 1 21 12z'/%3E%3Cpath d='M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .8-1 1.5v.4'/%3E%3Cpath d='M12 16.5h.01'/%3E%3C/svg%3E");
}
.type-detail .social-buttons-wrapper .link-icon.watchdog {
  --dsm-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 1 1 12 0c0 7 3 8 3 8H3s3-1 3-8'/%3E%3Cpath d='M10.3 20a2 2 0 0 0 3.4 0'/%3E%3C/svg%3E");
}
.type-detail .social-buttons-wrapper .link-icon.share {
  --dsm-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='M8.6 13.5l6.8 4M15.4 6.5l-6.8 4'/%3E%3C/svg%3E");
}
.type-detail .social-buttons-wrapper .link-icon span { font-size: 14px !important; margin: 0 !important; }
.type-detail .social-buttons-wrapper .link-icon:hover { color: #1f8f3a !important; }
.type-detail .social-buttons-wrapper .link-icon:hover span { text-decoration: underline; }

/* ---------- 8) Vlastnosti jako seznam ---------- */
/* JS rozdělí řádek: nadpis přes celou šířku + pod ním řádek se seznamem */
.type-detail .extended-description tr.dsm-props-row th { padding-bottom: 4px !important; border-bottom: 0 !important; }
.type-detail .extended-description tr.dsm-props-list-row td { padding-top: 4px !important; text-align: left !important; }
.type-detail .dsm-props {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
}
.type-detail .dsm-props li {
  position: relative;
  margin: 0;
  padding: 0 0 0 24px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: #1c3d26;
}
.type-detail .dsm-props li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #1f8f3a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* ---------- mobil ---------- */
@media (max-width: 767px) {
  .type-detail .p-info-wrapper > .price-line { padding: 16px !important; gap: 12px; }
  .type-detail .price-line .price-final { font-size: 30px !important; }
  .type-detail .price-line .availability-value { font-size: 13px; padding: 6px 11px 6px 9px; }
  .type-detail .price-line .quantity { height: 50px; }
  .type-detail .price-line .quantity .decrease,
  .type-detail .price-line .quantity .increase { width: 38px !important; }
  .type-detail .price-line .add-to-cart-button { height: 50px; font-size: 17px !important; padding: 0 14px !important; }
  .type-detail .dsm-buy-perks { flex-direction: column; font-size: 13px; }

  .dsm-sticky-buy__in { padding: 8px 14px; gap: 12px; }
  .dsm-sticky-buy__img { width: 40px; height: 40px; flex-basis: 40px; }
  .dsm-sticky-buy__name { display: none; }
  .dsm-sticky-buy__price { flex: 1 1 auto; font-size: 20px; }
  .dsm-sticky-buy__btn { height: 44px; padding: 0 22px; }

  .type-detail .dsm-props { grid-template-columns: 1fr; }
}
