.am-live-cart-toggle {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: auto;
  border: none;
  padding: 8px;
  padding-right: 0;
  cursor: pointer;
  font-size: 1rem;
  color: #292929;

  svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  &:hover {
    background-color: transparent;
    color: #292929;
  }
}

.am-live-cart-toggle .am-cart-count {
  margin-left: .5rem;
  font-weight: 700;
  position: absolute;
  background: #F86C44;
  border-radius: 50%;
  height: 1rem;
  width: 1rem;
  color: white;
  top: 2px;
  z-index: 10;
  font-size: 0.75rem;
  right: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Inter", Sans-serif;
}

.am-live-cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 1190;
}

.am-live-cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 380px;
  max-width: 100%;
  background: #fff;
  z-index: 1201;
  transform: translateX(110%);
  transition: transform .28s cubic-bezier(.2, .9, .2, 1);
  box-shadow: -8px 0 24px rgba(0, 0, 0, .12);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.am-live-cart-panel.open {
  transform: translateX(0);
}

.am-live-cart-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #eee;
}

.am-live-cart-panel__header h3 {
  margin-bottom: 0;
}

.am-live-cart-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: black;

  &:hover,
  &:focus {
    background-color: transparent;
    color: black;
  }
}

.am-live-cart-content {
  padding: 1rem;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* El wrapper directo que genera woocommerce_mini_cart() */
#am-live-cart-content>div,
.widget_shopping_cart_content>div {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

/* Solo la lista de productos scrollea */
#am-live-cart-content .woocommerce-mini-cart {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.am-cart-benefits-bar {
  padding: 0 1rem 8px;
  border-radius: 4px;
}

.am-cart-benefits {
  border: 1px solid #000;
  background: #fff;
  padding: 0.5rem 0.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
  border-radius: 4px;
}

.am-cart-benefits__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #000;
}

.am-cart-benefits__content {
  margin: 0;
  font-size: 0.85rem;
  color: #000;
}

.am-cart-benefits__text {
  margin: 0;
  font-size: 0.85rem;
  color: #000;

  .amount {
    font-weight: 700;
  }
}

.am-cart-benefits__bar-wrap {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
}

.am-cart-benefits__bar {
  height: 8px;
  border: 1px solid #a2a2a2;
  background: #fff;
  overflow: hidden;
  border-radius: 4px;
  width: 100%;
}

.am-cart-benefits__bar-fill {
  height: 100%;
  width: 0;
  background: #F86C44;
  transition: width 300ms ease;
}

.am-cart-benefits__marker {
  position: absolute;
  left: 60%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #000;
  color: #fff;
  width: 3rem;
  height: 2rem;
  border-radius: 10px;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.am-cart-benefits__marker-amount {
  position: absolute;
  left: 60%;
  bottom: -33px;
  transform: translate(-50%, -100%);
  font-size: 0.7rem;
  font-weight: 700;
  color: #000;
  background: #fff;
  padding: 0 0.25rem;
  line-height: 1;
  z-index: 2;
}

.am-cart-benefits--empty {
  border-style: dashed;
  opacity: 0.9;
}

#am-live-cart-content .elementor-button--view-cart {
  background: transparent;
  border: 1px solid #262626;
  color: #262626;

  &:hover {
    background-color: #fefefe;
  }
}

#am-live-cart-content .elementor-button--checkout {
  background-color: #F86C44;
  border: 1px solid #F86C44;
  color: white;

  &:hover {
    background-color: #E66037;
  }
}

#am-live-cart-content .quantity {
  color: #000;
}

/* Ítems del mini carrito estándar de WooCommerce */
#am-live-cart-content .woocommerce-mini-cart-item {
  position: relative;
}

#am-live-cart-content .remove_from_cart_button {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.9rem;
  line-height: 1;
  color: #262626;
  text-decoration: none;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;

  /* El enlace viene vacío desde WooCommerce, se agrega el símbolo por CSS */
  &::before {
    content: '✕';
  }

  &:hover {
    color: #292929;
    background: #f0f0f0;
  }
}

/* Mini cart items */
#am-live-cart-content .woocommerce-mini-cart {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#am-live-cart-content .elementor-menu-cart__product {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
  position: relative;
}

#am-live-cart-content .elementor-menu-cart__product:last-child {
  border-bottom: none;
  padding-bottom: 0.5rem;
}

/* Imagen */
#am-live-cart-content .elementor-menu-cart__product>a:first-of-type {
  flex-shrink: 0;
}

#am-live-cart-content .elementor-menu-cart__product img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  max-width: 80px;
}

/* Nombre del producto (el texto dentro del <a> que contiene la imagen) */
#am-live-cart-content .elementor-menu-cart__product>a:first-of-type {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
  color: #292929;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Contenedor de datos (nombre + cantidad) */
#am-live-cart-content .elementor-menu-cart__product .product-details {
  flex: 1;
  min-width: 0;
}

/* Estilo del nombre del producto (el texto del link después de la img) */
#am-live-cart-content .elementor-menu-cart__product>a:not(.remove) {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: #292929;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

#am-live-cart-content .elementor-menu-cart__product .quantity {
  font-size: 0.8rem;
  font-weight: 400;
  color: #555;
  margin-top: 0.25rem;
}

#am-live-cart-content .elementor-menu-cart__product .quantity .woocommerce-Price-amount {
  font-weight: 700;
  color: #292929;
}

/* Botón eliminar */
#am-live-cart-content .elementor-menu-cart__product .remove_from_cart_button {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 1rem;
  line-height: 1;
  color: #aaa;
  text-decoration: none;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;

  &:hover {
    color: #292929;
    background: #f0f0f0;
  }
}

#am-live-cart-content .elementor-menu-cart__subtotal {
  border-top: 1px solid #eee;
  padding: 8px 0;
  flex-direction: row;
  gap: 8px;
}

#am-live-cart-content .elementor-menu-cart__footer-buttons {
  flex-direction: row;
  gap: 8px;
  max-height: fit-content;
}

#am-live-cart-content .elementor-menu-cart__footer-buttons a {
  padding: 0;
  flex: 1;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Total */
#am-live-cart-content .woocommerce-mini-cart__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  font-size: 0.95rem;
  font-weight: 700;
}

#am-live-cart-content .woocommerce-mini-cart__total .woocommerce-Price-amount {
  font-weight: 700;
}

/* Botones del footer del carrito */
#am-live-cart-content .woocommerce-mini-cart__buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

/* Mobile: panel full width from right */
@media (max-width:600px) {
  .am-live-cart-panel {
    width: 100%;
  }

  /* When toggle is static, no floating offsets are needed on mobile. */
}

/* Below cart content styles */
.am-cart-below-content {
  padding: 1rem;
  border-top: 1px solid #eee;
}

.am-cart-below-content .sugerencias-carrito .item-sugerido h3 {
  font-size: 1.125rem;
  margin: 0;
  margin-bottom: 8px;
}

.am-cart-below-content .sugerencias-carrito .item-content {
  display: flex;
  gap: 8px;
}

.am-cart-below-content .sugerencias-carrito .item-content img {
  max-width: 90px;
}

.am-cart-below-content .sugerencias-carrito .item-content h4 {
  margin: 0;
  font-size: 1.175rem;
}

.am-cart-below-content .sugerencias-carrito .item-content a.button {
  color: #292929;
  font-family: "Inter", Sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  border-bottom: 1px solid black;
  padding: 8px;
}

.item-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
