/**
 * Mini-carrinho Elementor (Menu Cart) — alinhado ao visual dos cards do carrinho LadyCoins.
 * Escopo: só dentro do painel do widget.
 */

/* Painel: fundo escuro (o Elementor deixa .elementor-menu-cart__main branco por defeito) */
.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__container {
  background: transparent !important;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__main {
  z-index: 100001;
  padding: 15px;
  background: #0b0e18 !important;
  color: rgba(255, 255, 255, 0.92);
  --empty-message-color: #ffffff;
  border: 1px solid rgba(89, 32, 126, 0.55);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__close-button,
.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__close-button:hover {
  color: rgba(255, 255, 255, 0.75) !important;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__products {
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-color: rgba(201, 98, 255, 0.45) rgba(255, 255, 255, 0.06);
}

/* Carrinho vazio: texto legível no painel escuro (Elementor usa --empty-message-color no wrapper) */
.elementor-widget-woocommerce-menu-cart .woocommerce-mini-cart__empty-message {
  color: #ffffff !important;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 36px auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 6px;
  align-items: start;
  padding: 10px 8px;
  margin: 0 0 8px;
  box-sizing: border-box;
  background: #111325;
  border: 1px solid rgba(89, 32, 126, 0.85);
  border-radius: 14px;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product:last-of-type {
  margin-bottom: 0;
}

/* Achata .product-name para o grid ver <a> e <ul> como filhos diretos */
.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-name {
  display: contents;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-name > a {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin: 0;
  text-align: left;
  justify-self: start;
  align-self: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff !important;
  text-decoration: none !important;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-name > a:hover {
  color: #c962ff !important;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-image {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  width: 52px;
  margin: 0 !important;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-image img {
  width: 52px !important;
  height: 52px !important;
  max-width: none !important;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  border: 1px solid rgba(201, 98, 255, 0.25);
  background: rgba(2, 7, 17, 0.6);
}

/*
 * Elementor desenha o X no PRÓPRIO .product-remove com ::before/::after (linhas a 50% da largura).
 * Se o bloco estica, o X cobre o card inteiro. A "bolinha" é o border-radius + border do botão 22px esticado.
 */
.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-remove::before,
.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-remove::after {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  transform: none !important;
  position: static !important;
  left: auto !important;
  top: auto !important;
  clip: auto !important;
  visibility: hidden !important;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-remove {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  position: relative !important;
  inset: auto !important;
  inset-inline-end: auto !important;
  bottom: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  width: 36px !important;
  max-width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  max-height: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  flex: 0 0 36px !important;
  z-index: 3;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  text-align: center !important;
}

/*
 * Elementor + Woo geram 2 <a>. A Woo mostra "×" (em) + ícones nos pseudos → X gigante por cima do card.
 * Só deixamos o link do Elementor visível; ícone = background no próprio <a> (sem ::before/::after).
 */
.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-remove > a:not(.elementor_remove_from_cart_button) {
  display: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  pointer-events: none !important;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-remove a.remove_from_cart_button,
.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-remove a.remove:not(.elementor_remove_from_cart_button) {
  display: none !important;
}

/* Elementor: a { position:absolute; width:100%; height:100%; opacity:0 } — anula e mostra lixeira */
.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-remove a.elementor_remove_from_cart_button {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  display: block !important;
  opacity: 1 !important;
  z-index: 4 !important;
  box-sizing: border-box !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 8px;
  border: 1px solid rgba(255, 89, 89, 0.45) !important;
  font-size: 0 !important;
  line-height: 0 !important;
  letter-spacing: -999px !important;
  color: transparent !important;
  text-decoration: none !important;
  overflow: hidden !important;
  text-indent: -9999px !important;
  white-space: nowrap !important;
  background-color: rgba(2, 7, 17, 0.75) !important;
  /* Mesmo SVG do carrinho (template-cart.php → ladycoins-pc-delete-icon) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 18px 18px !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, background-image 0.2s ease;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-remove a.elementor_remove_from_cart_button::before,
.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-remove a.elementor_remove_from_cart_button::after {
  content: none !important;
  display: none !important;
  background: none !important;
  border: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  visibility: hidden !important;
  position: absolute !important;
  clip: rect(0, 0, 0, 0) !important;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-remove a.elementor_remove_from_cart_button:hover {
  background-color: #ff5959 !important;
  border-color: #ff5959 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E") !important;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-price {
  grid-column: 4;
  grid-row: 1;
  align-self: center;
  text-align: right;
  margin: 0 !important;
  padding: 0 !important;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-price .quantity {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-price .woocommerce-Price-amount {
  color: #faca03 !important;
  font-weight: 700;
}

/* Coins / Bônus / LD — mesmo padrão do carrinho */
.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__product-name .ladycoins-item-meta {
  grid-column: 2 / -1;
  grid-row: 2;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.elementor-widget-woocommerce-menu-cart .ladycoins-item-meta__row {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  gap: 4px 6px;
  align-items: start;
  font-size: 11px;
  line-height: 1.35;
  padding: 4px 6px;
  background: rgba(89, 32, 126, 0.35);
  border: 1px solid rgba(201, 98, 255, 0.22);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.92);
}

.elementor-widget-woocommerce-menu-cart .ladycoins-item-meta__label {
  font-weight: 600;
  color: #e8d4ff;
  white-space: nowrap;
}

.elementor-widget-woocommerce-menu-cart .ladycoins-item-meta__label::after {
  content: ":";
  font-weight: 500;
  opacity: 0.7;
  margin-left: 1px;
}

.elementor-widget-woocommerce-menu-cart .ladycoins-item-meta__value p {
  margin: 0;
}

/* Subtotal + botões — tema escuro coerente */
.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__subtotal {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(17, 19, 37, 0.95) !important;
  border: 1px solid rgba(89, 32, 126, 0.5) !important;
  color: #fff;
  font-size: 14px;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__subtotal strong {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__subtotal .woocommerce-Price-amount {
  color: #faca03 !important;
  font-weight: 700;
}

/* Rodapé: mesma altura nos dois botões (texto longo quebra sem encolher o vizinho) */
.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__footer-buttons {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 10px;
  margin-top: 12px;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__footer-buttons .elementor-button {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  min-height: 48px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1.25 !important;
  padding: 12px 10px !important;
  box-sizing: border-box !important;
}

.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__footer-buttons .elementor-button-text {
  white-space: normal !important;
}

@media (max-width: 700px) {
  .elementor-widget-woocommerce-menu-cart .elementor-menu-cart__container {
    position: fixed !important;
  }
}
