/* ==========================================================================
   Beshop Shopping Cart — Drawer lateral
   Todo desciende de #beshopcart_wrapper
   ========================================================================== */

#beshopcart_wrapper {
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* --- OVERLAY --- */
#beshopcart_wrapper .cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.35s ease;
}
#beshopcart_wrapper .cart-overlay.active {
  display: block;
  opacity: 1;
}

/* --- DRAWER --- */
#beshopcart_wrapper .shopping-cart-banner {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: var(--beshop-bg-card);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
#beshopcart_wrapper .shopping-cart-banner.show {
  transform: translateX(0);
}

/* --- HEADER DEL DRAWER --- */
#beshopcart_wrapper .header-cart {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--beshop-line);
  flex-shrink: 0;
}
#beshopcart_wrapper .tittle-cart p {
  margin: 0;
  font-family: var(--beshop-font-secondary), sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--beshop-text);
}
#beshopcart_wrapper .close-cart {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  transition: opacity 0.2s ease;
}
#beshopcart_wrapper .close-cart:hover {
  opacity: 0.5;
}
#beshopcart_wrapper .close-cart img,
#beshopcart_wrapper .close-cart svg {
  width: calc(18px * var(--beshop-icon-scale, 1));
  height: calc(18px * var(--beshop-icon-scale, 1));
  display: block;
}

/* --- BODY DEL DRAWER --- */
#beshopcart_wrapper .shopping-cart-banner .body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0 28px 28px;
}
#beshopcart_wrapper .shopping-cart-banner .body::-webkit-scrollbar {
  width: 4px;
}
#beshopcart_wrapper .shopping-cart-banner .body::-webkit-scrollbar-track {
  background: transparent;
}
#beshopcart_wrapper .shopping-cart-banner .body::-webkit-scrollbar-thumb {
  background: var(--beshop-line);
  border-radius: 2px;
}

/* --- LISTA DE PRODUCTOS --- */
#beshopcart_wrapper .beshopcart_listproducts {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
#beshopcart_wrapper .beshopcart_listproducts li {
  display: flex;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--beshop-line);
  gap: 16px;
}
#beshopcart_wrapper .beshopcart_listproducts li:last-child {
  border-bottom: none;
}

/* --- COLUMNAS PRODUCTO --- */
#beshopcart_wrapper .beshopcart_leftcolumn {
  flex-shrink: 0;
  width: 72px;
}
#beshopcart_wrapper .product-cart-image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
}
#beshopcart_wrapper .beshopcart_centercolumn {
  flex: 1;
  min-width: 0;
}
#beshopcart_wrapper .product-reference span{
  font-size: 12px;
}
#beshopcart_wrapper .product-name {
  display: block;
  font-family: var(--beshop-font-secondary), sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--beshop-text);
  text-decoration: none;
  line-height: 1.5;
  margin-bottom: 6px;
  /* white-space: nowrap; */
  /* overflow: hidden; */
  /* text-overflow: ellipsis; */
}
#beshopcart_wrapper .product-name:hover {
  color: var(--beshop-text-muted);
}
#beshopcart_wrapper .beshopcart_rightcolumn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
#beshopcart_wrapper .product-price {
  font-family: var(--beshop-font-secondary), sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--beshop-text);
  white-space: nowrap;
}
#beshopcart_wrapper .remove-from-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  transition: opacity 0.2s ease;
  text-decoration: none;
}
#beshopcart_wrapper .remove-from-cart:hover {
  opacity: 1;
}
#beshopcart_wrapper .remove-from-cart img,
#beshopcart_wrapper .remove-from-cart svg {
  width: calc(16px * var(--beshop-icon-scale, 1));
  height: calc(16px * var(--beshop-icon-scale, 1));
  display: block;
}

/* --- SUBTOTALES --- */
#beshopcart_wrapper .cart-subtotals {
  padding: 20px 0 0;
  margin-top: auto;
}
#beshopcart_wrapper .cart-subtotals .products {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 16px;
  border-top: 1px solid var(--beshop-line);
  padding-top: 20px;
}
#beshopcart_wrapper .label-total {
  font-family: var(--beshop-font-secondary), sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--beshop-text);
}
#beshopcart_wrapper .cart-subtotals .value {
  font-family: var(--beshop-font-secondary), sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--beshop-text);
}

/* --- BOTÓN FINALIZAR COMPRA --- */
#beshopcart_wrapper .shopping-cart-banner .beshop-gotocheck {
  display: block;
  width: 100%;
  padding: 16px 32px;
  margin-top: 16px;
  background: var(--beshop-primary);
  color: var(--beshop-primary-contrast);
  font-family: var(--beshop-font-secondary), sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--beshop-primary);
  transition: background 0.25s ease, color 0.25s ease;
  cursor: pointer;
}
#beshopcart_wrapper .beshop-gotocheck:hover {
  background: var(--beshop-bg-card);
  color: var(--beshop-text);
}

/* --- ESTADO VACÍO --- */
#beshopcart_wrapper .shopping-cart-banner .body:empty::after,
#beshopcart_wrapper .shopping-cart-banner .body-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 28px;
  font-family: var(--beshop-font-secondary), sans-serif;
  font-size: 0.75rem;
  color: var(--beshop-text-subtle);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- ICONO DEL CARRITO EN HEADER --- */
#beshopcart_wrapper .header {
  position: relative;
  display: flex;
  align-items: center;
}
#beshopcart_wrapper .beshop-icon {
  display: block;
}
#beshopcart_wrapper .beshopcart_numberproducts {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  background: var(--beshop-primary);
  color: var(--beshop-primary-contrast);
  font-family: var(--beshop-font-secondary), sans-serif;
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  text-align: center;
  border-radius: 0;
}

/* --- RESPONSIVE --- */
@media (max-width: 480px) {
  #beshopcart_wrapper .shopping-cart-banner {
    width: 100vw;
  }
}