/* =========================================================
   Kustom Instalments — Journal3 matching + Glass variant
   (UPDATED: supports new minicart markup)
   ========================================================= */

/* ---------- Context helpers (optional) ---------- */
.kustom-inst[data-context="product"]{ margin-top: 8px; }
.kustom-inst[data-context="cart"]{ width: 100%; }
.kustom-inst[data-context="minicart"]{ font-size: 12px; }

/* wrappers */
.kustom-mini-inst{ margin: 10px 0; }
.kustom-cart-inst{ margin-top: 10px; }
.kustom-inst-wrap{ margin-top: 10px; }

/* ---------- Base component (default card) ---------- */
/* Works both for old markup and new minicart markup */
.kustom-inst[data-kustom-inst="1"],
.kustom-inst-wrap .kustom-inst{
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 10px;

  background: rgba(0,0,0,.02);
  border: 1px solid rgba(0,0,0,.06);

  color: inherit;
  line-height: 1.25;

  transition: box-shadow .18s ease,
              border-color .18s ease,
              background-color .18s ease,
              transform .18s ease;
}

/* new layout helpers */
.kustom-inst__row{ width: 100%; }
.kustom-inst__left{ flex: 0 0 auto; line-height: 0; }
.kustom-inst__right{ flex: 1 1 auto; min-width: 0; }

/* badge */
.kustom-inst__badge{
  height: 18px;
  width: auto;
  display: block;
  flex: 0 0 auto;
  opacity: .95;
}

/* text */
.kustom-inst__text{ min-width: 0; }
.kustom-inst-line{
  font-weight: 700;
  font-size: 13px;
  word-break: break-word;
}
.kustom-inst-note{
  margin-top: 2px;
  font-size: 12px;
  opacity: .75;
  word-break: break-word;
}

/* -------------------------
   Glass variant (product)
   ------------------------- */
.kustom-inst--glass[data-kustom-inst="1"],
.kustom-inst-wrap.kustom-inst--glass .kustom-inst{
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(0,0,0,.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0,0,0,.10);
}

.kustom-inst--glass[data-kustom-inst="1"]:hover,
.kustom-inst-wrap.kustom-inst--glass .kustom-inst:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0,0,0,.14);
  border-color: rgba(0,0,0,.14);
}

/* -------------------------
   Cart page (more card)
   ------------------------- */
#content .kustom-inst-wrap .kustom-inst{
  background: rgba(0,0,0,.015);
  border-color: rgba(0,0,0,.08);
}

@media (min-width: 768px){
  #content .kustom-inst-wrap .kustom-inst{
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
  }
  #content .kustom-inst-wrap .kustom-inst:hover{
    border-color: rgba(0,0,0,.12);
    box-shadow: 0 10px 26px rgba(0,0,0,.08);
  }
}

/* -------------------------
   Mini-cart compact (NEW)
   Uses wrapper class: .kustom-inst--minicart
   ------------------------- */
.kustom-inst-wrap.kustom-inst--minicart{
  margin: 8px 0 8px;
  padding: 0; /* keep clean: padding is on inner .kustom-inst */
}

#cart-content .kustom-inst-wrap.kustom-inst--minicart .kustom-inst{
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;

  background: rgba(0,0,0,.015);
  border-color: rgba(0,0,0,.05);

  box-shadow: none;
  transform: none;
}

/* minicart badge bigger + nicer spacing */
#cart-content .kustom-inst-wrap.kustom-inst--minicart .kustom-inst__badge{
  height: auto;
  max-width: 54px;
}

/* minicart typography */
#cart-content .kustom-inst-wrap.kustom-inst--minicart .kustom-inst-line{
  font-size: 12.5px;
  line-height: 1.25;
  margin: 0 0 2px;
}

#cart-content .kustom-inst-wrap.kustom-inst--minicart .kustom-inst-note{
  font-size: 11.5px;
  line-height: 1.25;
  margin: 0;
  opacity: .85;
}

/* -------------------------
   Strong overrides vs Journal3 (if it resets img/text)
   ------------------------- */
.kustom-inst-wrap .kustom-inst img.kustom-inst__badge,
.kustom-inst[data-kustom-inst="1"] img.kustom-inst__badge{
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.kustom-inst-wrap .kustom-inst .kustom-inst-line,
.kustom-inst-wrap .kustom-inst .kustom-inst-note,
.kustom-inst[data-kustom-inst="1"] .kustom-inst-line,
.kustom-inst[data-kustom-inst="1"] .kustom-inst-note{
  background: none !important;
}

/* -------------------------
   Dark mode
   ------------------------- */
@media (prefers-color-scheme: dark){
  .kustom-inst[data-kustom-inst="1"],
  .kustom-inst-wrap .kustom-inst{
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.10);
  }

  .kustom-inst--glass[data-kustom-inst="1"],
  .kustom-inst-wrap.kustom-inst--glass .kustom-inst{
    background: rgba(20,20,20,.45);
    border-color: rgba(255,255,255,.10);
    box-shadow: 0 14px 34px rgba(0,0,0,.35);
  }

  #cart-content .kustom-inst-wrap.kustom-inst--minicart .kustom-inst{
    background: rgba(255,255,255,.04);
    border-color: rgba(255,255,255,.08);
  }
}