/* Tuningkauppa – mini cartin footer
   Sijainti: lapsiteema/assets/css/mini-cart.css */
body:has(.elementor-menu-cart--shown) {
  overflow: hidden !important;
}
.woocommerce-mini-cart__footer {
  --tk-green: #14931f;
  --tk-green-hover: #0f7a19;
  --tk-muted: #6D6D6D;
  --tk-line: #e3e3e3;
  --tk-card: #f0f0f0;

  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--tk-line);
  flex: 1;
  position: absolute;
  bottom: 0;
  width: 100%;
}

/* ---------- Katso myös nämä ---------- */
.tk-upsell { margin-bottom: 20px; }

.tk-upsell__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.tk-upsell__title {
  color: #000;
  font-size: 20px;
  font-weight: 600;
}

.tk-upsell__nav { display: flex; gap: 4px; }

.woocommerce .elementor-container button.tk-upsell__btn,
.tk-upsell__btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0 !important;
  background-color: transparent !important;
  color: #000 !important;
  cursor: pointer;
}
.tk-upsell__btn:disabled { color: #c4c4c4; cursor: default; }

.tk-upsell__track {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.tk-upsell__track::-webkit-scrollbar { display: none; }

.tk-upsell__item {
  flex: 0 0 88%;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 64px 1fr 48px;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--tk-card);
}

.tk-upsell__img img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
}

.tk-upsell__info { min-width: 0; }
.tk-upsell__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: #111;
  text-decoration: none;
}

/* get_price_html() tulostaa <del>vanha</del><ins>uusi</ins> → uusi ylös, vanha alle */
.tk-upsell__price {
  display: flex;
  flex-direction: column-reverse;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
}
.tk-upsell__price ins { text-decoration: none; }
.tk-upsell__price del { font-size: 13px; font-weight: 400; color: var(--tk-muted); }

.tk-upsell__add {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--tk-green);
  color: #fff;
}
.tk-upsell__add:hover { background: var(--tk-green-hover); color: #fff; }
.tk-upsell__add.loading { opacity: .6; pointer-events: none; }
/* WooCommerce lisää "Näytä ostoskori" -linkin napin perään – piilotetaan */
.tk-upsell__item .added_to_cart { display: none; }

/* ---------- Summat ---------- */
.tk-totals {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--tk-line);
}

.tk-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 600;
}
.tk-row__label { color: #262626; font-weight: 600; font-size: 16px;}
.tk-row__value { white-space: nowrap; }
.tk-row__old {
  margin-left: 8px;
  font-weight: 400;
  color: var(--tk-muted);
}

.tk-shipping-note {
  margin: 2px 0 0;
  line-height: 1;
  font-size: 14px;
  color: #6D6D6D;
  font-size: 14px;
}

.tk-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
}
.tk-total__labels { display: flex; flex-direction: column; }
.tk-total__label { font-size: 20px; font-weight: 600; line-height: 1.1; color: #262626;}
.tk-total__tax { font-size: 14px; color: var(--tk-muted); }
.tk-total__amount { font-size: 24px; font-weight: 600; white-space: nowrap; }

/* ---------- Kassanappi ---------- */
ul.woocommerce-mini-cart {
  flex: 1;
  overflow: scroll;
}
@media(max-width: 767px) {
  ul.woocommerce-mini-cart {
    overflow: hidden;
  }
  .widget_shopping_cart_content {
    overflow: scroll;
  }
  .woocommerce-mini-cart__footer {
    flex: auto;
    position: absolute;
    width: 100%;
    bottom: 0;
  }
}
.woocommerce-mini-cart__footer .woocommerce-mini-cart__buttons { margin: 0; }

.woocommerce-mini-cart__footer .tk-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: var(--tk-green);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  border: 0;
  border-radius: 0;
}
.woocommerce-mini-cart__footer .tk-checkout:hover {
  background: var(--tk-green-hover);
  color: #fff;
}

a.tk-checkout::after {
  display: none !important;
}
/* ---------- Maksutavat ---------- */
.tk-payments {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.tk-payments img { max-width: 100%; height: auto; }

/* ======================================================
   Ilmaisen toimituksen laatikko (otsikon alla)
   ====================================================== */
.elementor-menu-cart__main {
  --tk-green: #14931f;
  --tk-green-hover: #0f7a19;
  --tk-muted: #6b6b6b;
  --tk-line: #e3e3e3;
  --tk-card: #f0f0f0;
  background: #f9f9f9;
}

.tk-freeship {
  margin: 0 16px;
  margin-bottom: 8px;
  padding: 16px 18px;
  background: #fff;
  border-radius: 4px;
}
p.tk-freeship__text {
  margin: 0;
  display: block !important;
  margin-bottom: 12px !important;
  font-size: 14px;
  line-height: 1.3;
  color: #092D3D;
}
.tk-freeship__text .amount { font-weight: 700; }

.tk-freeship__bar {
  height: 6px;
  background: #ececec;
  border-radius: 3px;
  overflow: hidden;
}
.tk-freeship__bar span {
  display: block;
  height: 100%;
  background: var(--tk-green);
  border-radius: 3px;
  transition: width .4s ease;
}

/* ======================================================
   Tuotekortti
   [kuva] [nimi]            [×]
   [ − 1 + ]            [hinta]
   ====================================================== */
.elementor-menu-cart__main h2.mini-cart-title {
    margin-bottom: 0;
}
.elementor-menu-cart__main .woocommerce-mini-cart {
  margin: 0;
  padding: 0;
  list-style: none;
}

.elementor-menu-cart__main .woocommerce-mini-cart-item.tk-item {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr 28px;
  grid-template-areas:
    "img  name  remove"
    "qty  qty   price";
  align-items: start;
  column-gap: 14px;
  row-gap: 16px;
  margin: 0 0 8px;
  padding: 16px;
  background: #FFF;
  border-radius: 4px;
  border: 0;
}

/* Nollataan teeman / WooCommercen oletustyylit (float, absoluuttinen sijainti, kuvan koko) */
.tk-item img,
.tk-item .remove,
.tk-item .quantity { float: none !important; margin: 0 !important; }

.tk-item__img { grid-area: img; display: block; width: 40px; height: 40px; }
.tk-item__img img {
  display: block;
  width: 40px !important;
  height: 40px;
  object-fit: contain;
}

.tk-item__name {
  grid-area: name;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: #000;
}
.tk-item__name a { color: inherit; text-decoration: none; }
.tk-item__name dl.variation { margin: 4px 0 0; font-size: 13px; font-weight: 400; color: var(--tk-muted); }

.tk-item .remove {
  grid-area: remove;
  justify-self: end;
  display: grid !important;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 24px;
  line-height: 1;
  color: #111 !important;
  background: none !important;
  border: 0;
  text-decoration: none;
}
.tk-item .remove:hover { color: #c00 !important; }
.tk-item .remove::before {
    display: none !important;
}

/* Määrävalitsin */
.tk-qty {
  grid-area: qty;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  background: var(--tk-card);
  border-radius: 4px;
}
.woocommerce .elementor-container button.tk-qty__btn,
.tk-qty__btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0 !important;
  background-color: #f2f2f2 !important;
  color: #262626 !important;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.tk-qty__btn:hover:not(:disabled) { background: #e4e4e4; }
.tk-qty__btn:disabled { color: #bdbdbd; cursor: default; }
.tk-qty__val {
    color: #262626;
  min-width: 28px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
}
.tk-qty--static { padding: 8px 12px; font-size: 14px; }

.tk-item__price {
  grid-area: price;
  justify-self: end;
  align-self: end;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

/* Lataustila, kun määrää päivitetään */
.tk-item.is-updating { opacity: .55; pointer-events: none; }