/**
 * Header mini-cart — match Figma (RTL)
 * Row: title+price | thumb+remove — then outline / solid CTAs
 */

/* ---------- Shell ---------- */
.thegem-te-cart.desktop-view .minicart,
.thegem-te-cart .minicart {
  width: 360px !important;
  max-width: calc(100vw - 24px) !important;
  padding: 0 !important;
  border: 1px solid #c5d4de !important;
  background: #fff !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.thegem-te-cart .minicart .widget_shopping_cart_content {
  background: #fff !important;
  padding: 0 !important;
  margin: 0 !important;
}

.thegem-te-cart.desktop-view .mobile-cart-header {
  display: none !important;
}

/* ---------- List ---------- */
.thegem-te-cart .minicart .woocommerce-mini-cart,
.thegem-te-cart .minicart ul.cart_list,
.thegem-te-cart .minicart ul.product_list_widget,
.thegem-te-cart .minicart ul.leboss-mini-cart-list {
  display: block !important;
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 4px 18px 0 !important;
  list-style: none !important;
  box-shadow: none !important;
  border: 0 !important;
  max-height: min(52vh, 380px);
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box !important;
}

.thegem-te-cart .minicart .woocommerce-mini-cart-item,
.thegem-te-cart .minicart .leboss-mini-cart-item,
.thegem-te-cart .minicart ul.cart_list > li {
  display: block !important;
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 16px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid #e8e8e8 !important;
  position: relative !important;
  background: transparent !important;
  box-sizing: border-box !important;
}

.thegem-te-cart .minicart .woocommerce-mini-cart-item:last-child,
.thegem-te-cart .minicart .leboss-mini-cart-item:last-child {
  border-bottom: 0 !important;
}

/* Row: image on the right (RTL), text on the left */
.thegem-te-cart .minicart .leboss-mini-cart-item__row {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 14px !important;
  width: 100% !important;
  direction: rtl !important;
}

/* ---------- Thumb + remove ---------- */
.thegem-te-cart .minicart .leboss-mini-cart-item__media,
.thegem-te-cart .minicart .woocommerce-mini-cart-item .minicart-image,
.thegem-te-cart .minicart .cart_list .minicart-image {
  float: none !important;
  position: relative !important;
  flex: 0 0 78px !important;
  width: 78px !important;
  min-width: 78px !important;
  height: 96px !important;
  margin: 0 !important;
  padding: 0 !important;
  order: 0 !important;
}

.thegem-te-cart .minicart .leboss-mini-cart-item__thumb,
.thegem-te-cart .minicart .leboss-mini-cart-item__media > a,
.thegem-te-cart .minicart .minicart-image > a:not(.remove) {
  display: block !important;
  width: 78px !important;
  height: 96px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  border-radius: 0 !important;
  line-height: 0 !important;
  background: #f3f3f3 !important;
}

.thegem-te-cart .minicart .leboss-mini-cart-item__thumb img,
.thegem-te-cart .minicart .minicart-image img,
.thegem-te-cart .minicart .woocommerce-mini-cart-item img {
  display: block !important;
  width: 78px !important;
  height: 96px !important;
  max-width: 78px !important;
  object-fit: cover !important;
  object-position: center top !important;
  margin: 0 !important;
  float: none !important;
}

.thegem-te-cart .minicart .minicart-image::before,
.thegem-te-cart .minicart .minicart-image::after,
.thegem-te-cart .minicart .leboss-mini-cart-item__media::after,
.thegem-te-cart .minicart .woocommerce-mini-cart-item.sale .minicart-image::before {
  display: none !important;
  content: none !important;
}

/* Black circular × — Figma */
.thegem-te-cart .minicart .leboss-mini-cart-item__remove,
.thegem-te-cart .minicart .woocommerce-mini-cart-item a.remove,
.thegem-te-cart .minicart a.remove.remove_from_cart_button,
.thegem-te-cart .minicart .woocommerce-mini-cart-item a.remove_from_cart_button {
  position: absolute !important;
  top: -7px !important;
  right: -7px !important;
  left: auto !important;
  z-index: 5 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #111 !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  text-indent: 0 !important;
  text-decoration: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28) !important;
}

.thegem-te-cart .minicart .leboss-mini-cart-item__remove:hover,
.thegem-te-cart .minicart .woocommerce-mini-cart-item a.remove:hover {
  background: #000 !important;
  color: #fff !important;
  opacity: 1 !important;
}

/* ---------- Title + price ---------- */
.thegem-te-cart .minicart .leboss-mini-cart-item__body,
.thegem-te-cart .minicart .cart-item-info {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: right !important;
  float: none !important;
}

.thegem-te-cart .minicart .leboss-mini-cart-item__title,
.thegem-te-cart .minicart .minicart-product-title,
.thegem-te-cart .minicart .leboss-mini-cart-item__body > a,
.thegem-te-cart .minicart .cart-item-info > a:not(.remove) {
  display: block !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  color: #111 !important;
  text-decoration: none !important;
  text-align: right !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

.thegem-te-cart .minicart .leboss-mini-cart-item__title:hover,
.thegem-te-cart .minicart .leboss-mini-cart-item__body > a:hover {
  color: #111 !important;
}

.thegem-te-cart .minicart .leboss-mini-cart-item .variation,
.thegem-te-cart .minicart .woocommerce-mini-cart-item .variation,
.thegem-te-cart .minicart .woocommerce-mini-cart-item dl.variation {
  display: none !important;
}

.thegem-te-cart .minicart .leboss-mini-cart-item__price,
.thegem-te-cart .minicart .leboss-mini-cart-item .quantity,
.thegem-te-cart .minicart .woocommerce-mini-cart-item .quantity {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  color: #111 !important;
  text-align: right !important;
  white-space: nowrap !important;
}

.thegem-te-cart .minicart .leboss-mini-cart-item__price .amount,
.thegem-te-cart .minicart .leboss-mini-cart-item__price .woocommerce-Price-amount,
.thegem-te-cart .minicart .leboss-mini-cart-item__price bdi {
  white-space: nowrap !important;
  word-break: keep-all !important;
  color: #111 !important;
  font-weight: 600 !important;
}

/* Kill TheGem link styling that breaks the row */
.thegem-te-cart .minicart .woocommerce-mini-cart-item a {
  color: inherit;
}

.thegem-te-cart .minicart .woocommerce-mini-cart-item > a {
  /* legacy WC wrap — our template doesn't use it, but neutralize if present */
  margin: 0 !important;
  padding: 0 !important;
}

/* ---------- Hide subtotal (Figma has none) ---------- */
.thegem-te-cart .minicart .woocommerce-mini-cart__total,
.thegem-te-cart .minicart .leboss-mini-cart-total,
.thegem-te-cart .minicart .total,
.thegem-te-cart .minicart .minicart-bottom {
  display: none !important;
}

/* ---------- CTAs — Figma ---------- */
.thegem-te-cart .minicart .woocommerce-mini-cart__buttons,
.thegem-te-cart .minicart .leboss-mini-cart-buttons,
.thegem-te-cart .minicart p.buttons {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 14px 18px 18px !important;
  background: #fff !important;
  border: 0 !important;
  border-top: 0 !important;
  box-sizing: border-box !important;
}

.thegem-te-cart .minicart .woocommerce-mini-cart__buttons .mini-cart-view-cart,
.thegem-te-cart .minicart .woocommerce-mini-cart__buttons .mini-cart-checkout,
.thegem-te-cart .minicart .woocommerce-mini-cart__buttons .gem-button-container {
  display: block !important;
  flex: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

.thegem-te-cart .minicart .woocommerce-mini-cart__buttons a,
.thegem-te-cart .minicart .woocommerce-mini-cart__buttons a.button,
.thegem-te-cart .minicart .woocommerce-mini-cart__buttons .gem-button,
.thegem-te-cart .minicart .leboss-mini-cart-buttons a,
.thegem-te-cart .minicart p.buttons a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 50px !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  box-sizing: border-box !important;
  border-radius: 0 !important;
  border: 1.5px solid #111 !important;
  background: #fff !important;
  color: #111 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  text-align: center !important;
  text-decoration: none !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: none !important;
}

.thegem-te-cart .minicart .woocommerce-mini-cart__buttons a::before,
.thegem-te-cart .minicart .woocommerce-mini-cart__buttons a::after,
.thegem-te-cart .minicart .woocommerce-mini-cart__buttons .gem-button::before {
  display: none !important;
  content: none !important;
}

/* Checkout = solid black */
.thegem-te-cart .minicart .woocommerce-mini-cart__buttons a.checkout,
.thegem-te-cart .minicart .woocommerce-mini-cart__buttons a.wc-forward.checkout,
.thegem-te-cart .minicart .woocommerce-mini-cart__buttons .checkout .gem-button,
.thegem-te-cart .minicart .leboss-mini-cart-buttons a.checkout,
.thegem-te-cart .minicart p.buttons a.checkout {
  background: #111 !important;
  border-color: #111 !important;
  color: #fff !important;
}

.thegem-te-cart .minicart .woocommerce-mini-cart__buttons a:hover,
.thegem-te-cart .minicart .leboss-mini-cart-buttons a:hover {
  opacity: 0.9;
}

.thegem-te-cart .minicart .woocommerce-mini-cart__empty-message {
  margin: 0 !important;
  padding: 32px 20px !important;
  text-align: center !important;
  font-size: 14px !important;
  color: #555 !important;
}

/* ---------- Mobile drawer ---------- */
.thegem-te-cart.mobile-view .minicart {
  background: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
  width: min(86vw, 420px) !important;
  max-width: 450px !important;
}

.thegem-te-cart.mobile-view .mobile-cart-header {
  display: block !important;
  border-bottom: 1px solid #e8e8e8;
  background: #fff !important;
}

.thegem-te-cart.mobile-view .minicart .woocommerce-mini-cart,
.thegem-te-cart.mobile-view .minicart ul.leboss-mini-cart-list {
  max-height: none;
  padding: 4px 20px 0 !important;
}

.thegem-te-cart.mobile-view .minicart .woocommerce-mini-cart__buttons,
.thegem-te-cart.mobile-view .minicart .leboss-mini-cart-buttons {
  padding: 16px 20px 28px !important;
}

html[dir="rtl"] .thegem-te-cart .minicart .leboss-mini-cart-item__remove,
html[dir="rtl"] .thegem-te-cart .minicart .woocommerce-mini-cart-item a.remove {
  right: -7px !important;
  left: auto !important;
}
