/* ==========================================================================
   NovaShop — Carrito lateral
   ========================================================================== */

body.ns-drawer-open { overflow: hidden; }

.ns-drawer[hidden] { display: none; }

.ns-drawer__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity var(--ns-t-base);
}

.ns-drawer.is-open .ns-drawer__overlay { opacity: 1; }

.ns-drawer__panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 28rem;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  box-shadow: var(--ns-shadow-2xl);
  transform: translateX(100%);
  transition: transform var(--ns-t-base);
}

.ns-drawer.is-open .ns-drawer__panel { transform: translateX(0); }

.ns-drawer__content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* Cabecera ----------------------------------------------------------------- */

.ns-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid var(--ns-stone-200);
  flex-shrink: 0;
}

.ns-drawer__title { display: flex; align-items: center; gap: 0.5rem; color: var(--ns-stone-800); }

.ns-drawer__title h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ns-stone-900);
  margin: 0;
}

.ns-drawer__count { font-weight: 500; }

.ns-drawer__close {
  display: flex;
  padding: 0.5rem;
  border: 0;
  background: none;
  border-radius: var(--ns-radius-pill);
  color: var(--ns-stone-600);
  cursor: pointer;
  transition: background-color var(--ns-t-fast);
}
.ns-drawer__close:hover { background: var(--ns-stone-100); }

/* Vacío -------------------------------------------------------------------- */

.ns-drawer__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
}

.ns-drawer__empty-icon {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: var(--ns-stone-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ns-stone-400);
  margin-bottom: 1rem;
}

.ns-drawer__empty p { color: var(--ns-stone-500); font-size: 0.875rem; margin: 0; }
.ns-drawer__empty .ns-btn { margin-top: 1.5rem; padding: 0.625rem 1.5rem; font-size: 0.875rem; }

/* Líneas ------------------------------------------------------------------- */

.ns-drawer__items {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.ns-drawer__item {
  display: flex;
  gap: 1rem;
  transition: opacity var(--ns-t-fast);
}
.ns-drawer__item.is-removing { opacity: 0.4; }

.ns-drawer__item-thumb {
  width: 5rem;
  height: 5rem;
  flex-shrink: 0;
  border-radius: var(--ns-radius-md);
  overflow: hidden;
  background: var(--ns-stone-100);
}
.ns-drawer__item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ns-drawer__item-info { flex: 1; min-width: 0; }

.ns-drawer__item-name {
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ns-drawer__item-name a { color: var(--ns-stone-900); text-decoration: none; }
.ns-drawer__item-name a:hover { color: var(--ns-emerald-600); }

.ns-drawer__item-meta,
.ns-drawer__item-meta p {
  font-size: 0.75rem;
  color: var(--ns-stone-400);
  margin: 0.125rem 0 0;
}

.ns-drawer__item-unit {
  font-size: 0.875rem;
  color: var(--ns-stone-500);
  margin: 0.125rem 0 0;
}

.ns-drawer__item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.ns-qty--sm { border-color: var(--ns-stone-200); }
.ns-qty--sm button { padding: 0.375rem; }
.ns-qty--sm input { width: 2rem; font-size: 0.875rem; }

.ns-drawer__remove {
  display: flex;
  padding: 0.375rem;
  border: 0;
  background: none;
  border-radius: var(--ns-radius-pill);
  color: var(--ns-stone-400);
  cursor: pointer;
  transition: color var(--ns-t-fast), background-color var(--ns-t-fast);
}
.ns-drawer__remove:hover { color: var(--ns-red-500); background: #fef2f2; }

.ns-drawer__item-total {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ns-stone-900);
  white-space: nowrap;
}

/* Pie ---------------------------------------------------------------------- */

.ns-drawer__foot {
  border-top: 1px solid var(--ns-stone-200);
  padding: 1.25rem;
  flex-shrink: 0;
  background: #fff;
}

.ns-drawer__subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ns-drawer__subtotal span { color: var(--ns-stone-600); font-size: 0.875rem; }
.ns-drawer__subtotal strong { font-size: 1.25rem; font-weight: 700; color: var(--ns-stone-900); }
.ns-drawer__subtotal .woocommerce-Price-amount { font-size: inherit; }

.ns-drawer__note {
  font-size: 0.75rem;
  color: var(--ns-stone-400);
  margin: 0.75rem 0 1rem;
}

/* Estado de carga ---------------------------------------------------------- */

.ns-drawer__loader {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ns-t-fast);
}
.ns-drawer.is-busy .ns-drawer__loader { opacity: 1; pointer-events: auto; }

/* Contador del icono de carrito de Blocksy, con el punto verde del diseño */
.ct-cart-item .ct-cart-badge,
.ct-header-cart .ct-cart-badge {
  background: var(--ns-emerald-600) !important;
  color: #fff !important;
  font-weight: 700;
  animation: ns-scale-in 200ms ease-out;
}
