/* ========================================================================
   KILINC PRICING SYSTEM — 0.7.2
   Tek mağaza fiyat dili.
   Canlı Kılınç tasarımının sakin eski fiyat + tam kırmızı yüzde + güçlü yeni
   fiyat hiyerarşisini yeni temanın bütün merchandising yüzeylerine taşır.
   Cart/checkout toplamları kendi özel UI'larında bırakılır.
   ======================================================================== */

:root {
  --kg-price-ink: #111111;
  --kg-price-muted: #999994;
  --kg-price-discount: #e00000;
  --kg-price-card-old: 11.5px;
  --kg-price-card-sale: 14px;
  --kg-price-card-badge: 10px;
  --kg-price-card-badge-h: 20px;
  --kg-price-detail-old: 14px;
  --kg-price-detail-sale: 21px;
  --kg-price-detail-badge: 10px;
}

/* Eski WooCommerce satış balonu artık gereksiz; yüzde fiyat alanında yaşar. */
.woocommerce span.onsale,
.woocommerce .onsale,
.kg-product-card .onsale,
.single-product .onsale {
  display: none !important;
}

/* ------------------------------------------------------------------------
   COMPACT PRICE — ürün kartı, anasayfa, kategori, son görüntülenen, related
   ve Kombini Tamamla kartları aynı fiziksel ölçüleri kullanır.
   ------------------------------------------------------------------------ */
:where(
  .kg-product-card,
  .kg-complete-look__card,
  .kg-recently-viewed,
  .related.products,
  .upsells.products
) :where(.price, .ks-price-range, .kg-product-card__price, .kg-complete-look__price) {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  column-gap: 6px !important;
  row-gap: 3px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--kg-price-ink) !important;
  font-size: var(--kg-price-card-sale) !important;
  font-weight: 700 !important;
  line-height: 1.18 !important;
  font-variant-numeric: tabular-nums;
}

:where(
  .kg-product-card,
  .kg-complete-look__card,
  .kg-recently-viewed,
  .related.products,
  .upsells.products
) :where(.price, .ks-price-range, .kg-product-card__price, .kg-complete-look__price) del {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--kg-price-muted) !important;
  opacity: 1 !important;
  font-size: var(--kg-price-card-old) !important;
  font-weight: 400 !important;
  line-height: 1.15 !important;
  text-decoration-thickness: 1px !important;
  text-decoration-color: #aaa9a5 !important;
  white-space: nowrap !important;
}

:where(
  .kg-product-card,
  .kg-complete-look__card,
  .kg-recently-viewed,
  .related.products,
  .upsells.products
) :where(.price, .ks-price-range, .kg-product-card__price, .kg-complete-look__price) del :where(.amount, bdi) {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
}

:where(
  .kg-product-card,
  .kg-complete-look__card,
  .kg-recently-viewed,
  .related.products,
  .upsells.products
) .price-discount-perc {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  min-width: 0 !important;
  min-height: var(--kg-price-card-badge-h) !important;
  height: var(--kg-price-card-badge-h) !important;
  margin: 0 !important;
  padding: 0 7px !important;
  border: 0 !important;
  border-radius: 3px !important;
  background: var(--kg-price-discount) !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: var(--kg-price-card-badge) !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

:where(
  .kg-product-card,
  .kg-complete-look__card,
  .kg-recently-viewed,
  .related.products,
  .upsells.products
) :where(.price, .ks-price-range, .kg-product-card__price, .kg-complete-look__price) ins {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--kg-price-ink) !important;
  font-size: var(--kg-price-card-sale) !important;
  font-weight: 750 !important;
  line-height: 1.15 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

:where(
  .kg-product-card,
  .kg-complete-look__card,
  .kg-recently-viewed,
  .related.products,
  .upsells.products
) :where(.price, .ks-price-range, .kg-product-card__price, .kg-complete-look__price) ins :where(.amount, bdi),
:where(
  .kg-product-card,
  .kg-complete-look__card,
  .kg-recently-viewed,
  .related.products,
  .upsells.products
) :where(.price, .ks-price-range, .kg-product-card__price, .kg-complete-look__price) > .amount,
:where(
  .kg-product-card,
  .kg-complete-look__card,
  .kg-recently-viewed,
  .related.products,
  .upsells.products
) :where(.price, .ks-price-range, .kg-product-card__price, .kg-complete-look__price) > .amount bdi {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
}

/* Kart içinde taksit metni ürün detayına aittir; merchandising kartını bozmasın. */
:where(.kg-product-card, .kg-complete-look__card, .kg-recently-viewed) .kg-installment-inline,
:where(.kg-product-card, .kg-complete-look__card, .kg-recently-viewed) .kg-price-break {
  display: none !important;
}

/* Rating olmayan kartlarda fiyat satırını rating olan kartlarla aynı eksene al. */
@media (min-width: 641px) {
  .kg-product-card__meta:not(:has(.ty-rating-container)):has(:where(.price, .ks-price-range))::before {
    content: "";
    display: block;
    height: 23px;
    margin: 7px 0 8px;
  }
}

/* ------------------------------------------------------------------------
   PRODUCT DETAIL PRICE — aynı renk, badge ve tipografi dili; yalnızca satın
   alma panelinin hiyerarşisi gereği daha büyük ölçek.
   ------------------------------------------------------------------------ */
.single-product .kg-product-summary :where(.price, .kg-price-installment-wrapper),
.single-product .summary :where(.price, .kg-price-installment-wrapper) {
  color: var(--kg-price-ink) !important;
  font-variant-numeric: tabular-nums;
}

.single-product .kg-price-installment-wrapper {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px 10px !important;
}

.single-product .kg-price-installment-wrapper del,
.single-product .kg-product-summary .price del,
.single-product .summary .price del {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  color: var(--kg-price-muted) !important;
  opacity: 1 !important;
  font-size: var(--kg-price-detail-old) !important;
  font-weight: 400 !important;
  line-height: 1.15 !important;
  text-decoration-thickness: 1px !important;
  white-space: nowrap !important;
}

.single-product .kg-product-summary .price-discount-perc,
.single-product .summary .price-discount-perc,
.single-product .kg-price-installment-wrapper .price-discount-perc {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 22px !important;
  min-height: 22px !important;
  margin: 0 !important;
  padding: 0 8px !important;
  border: 0 !important;
  border-radius: 3px !important;
  background: var(--kg-price-discount) !important;
  color: #fff !important;
  font-size: var(--kg-price-detail-badge) !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}

.single-product .kg-price-installment-wrapper .kg-installment-inline {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 0 2px !important;
  border-bottom: 1px solid #c8c8c3 !important;
  color: #3f3f3b !important;
  font-size: 12px !important;
  font-weight: 520 !important;
  line-height: 1.2 !important;
}
.single-product .kg-price-installment-wrapper .kg-installment-inline svg {
  width: 17px !important;
  height: 17px !important;
  color: #33332f !important;
}

.single-product .kg-price-installment-wrapper .kg-price-break {
  flex-basis: 100% !important;
  width: 100% !important;
  height: 0 !important;
  margin: 0 !important;
}

.single-product .kg-price-installment-wrapper ins,
.single-product .kg-product-summary .price ins,
.single-product .summary .price ins {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  color: var(--kg-price-ink) !important;
  font-size: var(--kg-price-detail-sale) !important;
  font-weight: 720 !important;
  line-height: 1.15 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.single-product .kg-price-installment-wrapper ins :where(.amount, bdi),
.single-product .kg-product-summary .price ins :where(.amount, bdi),
.single-product .summary .price ins :where(.amount, bdi) {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
}

/* Sticky/mobile satın alma fiyatı da kompakt fiyat tokenlarını kullanır. */
.single-product .ks-sticky-price-area {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-variant-numeric: tabular-nums;
}
.single-product .ks-sticky-price-area del {
  margin: 0 !important;
  color: var(--kg-price-muted) !important;
  font-size: 11px !important;
  font-weight: 400 !important;
}
.single-product .ks-sticky-price-area ins {
  margin: 0 !important;
  color: var(--kg-price-ink) !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  text-decoration: none !important;
}

@media (max-width: 640px) {
  :root {
    --kg-price-card-old: 10.5px;
    --kg-price-card-sale: 13.5px;
    --kg-price-card-badge: 9px;
    --kg-price-card-badge-h: 18px;
  }

  :where(
    .kg-product-card,
    .kg-complete-look__card,
    .kg-recently-viewed,
    .related.products,
    .upsells.products
  ) :where(.price, .ks-price-range, .kg-product-card__price, .kg-complete-look__price) {
    column-gap: 5px !important;
    row-gap: 2px !important;
  }
}

/* ========================================================================
   0.7.3 — Mobile sticky add-to-cart price alignment
   Sticky price follows the global Kılınç price language: muted regular price,
   red percentage badge, strong sale price directly underneath on the same
   left axis. No markup/business-logic changes.
   ======================================================================== */
.single-product .ks-sticky-price-area .ks-price-top-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.single-product .ks-sticky-price-area .price-discount-perc {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  height: var(--kg-price-card-badge-h, 20px) !important;
  min-height: var(--kg-price-card-badge-h, 20px) !important;
  margin: 0 !important;
  padding: 0 6px !important;
  border: 0 !important;
  border-radius: 3px !important;
  background: var(--kg-price-discount, #e00000) !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: var(--kg-price-card-badge, 10px) !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}

@media (max-width: 640px) {
  .single-product .ks-sticky-price-area {
    display: grid !important;
    grid-template-columns: max-content !important;
    justify-items: start !important;
    align-items: start !important;
    align-content: center !important;
    min-width: 92px !important;
    gap: 2px !important;
    margin: 0 !important;
  }

  .single-product .ks-sticky-price-area .ks-price-top-row {
    width: max-content !important;
  }

  .single-product .ks-sticky-price-area del,
  .single-product .ks-sticky-price-area ins {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }

  .single-product .ks-sticky-price-area del {
    font-size: 10px !important;
  }

  .single-product .ks-sticky-price-area ins {
    font-size: 12px !important;
    font-weight: 750 !important;
  }

  .single-product .ks-sticky-price-area .price-discount-perc {
    height: 18px !important;
    min-height: 18px !important;
    padding-inline: 5px !important;
    font-size: 9px !important;
  }
}
