/* ==========================================================================
   SIDE CART DRAWER (Shopify-style) — Blue theme
   ========================================================================== */

.bv-cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  visibility: hidden;
}
.bv-cart-drawer.open {
  pointer-events: all;
  visibility: visible;
}

.bv-cart-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  transition: opacity 0.35s var(--bv-ease);
  backdrop-filter: blur(4px);
}
.bv-cart-drawer.open .bv-cart-overlay { opacity: 1; }

.bv-cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: var(--bv-white);
  box-shadow: -4px 0 24px rgba(15, 23, 42, 0.15);
  transform: translateX(100%);
  transition: transform 0.4s var(--bv-ease-out);
  display: flex;
  flex-direction: column;
}
.bv-cart-drawer.open .bv-cart-panel { transform: translateX(0); }

/* Header */
.bv-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--bv-line);
  flex-shrink: 0;
}
.bv-cart-header h3 {
  font-family: var(--bv-font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--bv-ink);
  margin: 0;
}
.bv-cart-close {
  width: 36px !important;
  height: 36px !important;
  background: var(--bv-cream) !important;
  border: none !important;
  border-radius: var(--bv-radius-sm) !important;
  color: #0f172a !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}
.bv-cart-close:hover {
  background: var(--bv-blue-bg) !important;
  color: var(--bv-blue) !important;
}
.bv-cart-close svg {
  width: 20px !important;
  height: 20px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  display: block !important;
}
.bv-cart-close svg line,
.bv-cart-close svg circle {
  stroke: currentColor !important;
  fill: none !important;
}

/* Body */
.bv-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.bv-cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--bv-muted);
}
.bv-cart-empty svg {
  width: 64px;
  height: 64px;
  stroke: var(--bv-muted-light);
  fill: none;
  stroke-width: 1.25;
  margin: 0 auto 1rem;
  display: block;
}
.bv-cart-empty p {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Cart items */
.bv-cart-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.bv-cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.85rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bv-line);
}
.bv-cart-item:last-child {
  border-bottom: none;
}
.bv-cart-item-img {
  width: 72px;
  height: 72px;
  border-radius: var(--bv-radius-sm);
  overflow: hidden;
  background: var(--bv-cream);
}
.bv-cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bv-cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.bv-cart-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bv-ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bv-cart-item-name a {
  color: inherit;
  text-decoration: none;
}
.bv-cart-item-name a:hover { color: var(--bv-blue); }
.bv-cart-item-variant {
  font-size: 0.75rem;
  color: var(--bv-muted);
}
.bv-cart-item-price {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bv-blue);
  margin-top: 0.2rem;
}

/* Qty controls */
.bv-cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--bv-line);
  border-radius: var(--bv-radius-sm);
  overflow: hidden;
  margin-top: 0.4rem;
  width: fit-content;
}
.bv-cart-qty button {
  width: 28px;
  height: 28px;
  background: var(--bv-white);
  border: none;
  color: var(--bv-ink-soft);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.2s var(--bv-ease);
}
.bv-cart-qty button:hover { background: var(--bv-blue-bg); color: var(--bv-blue); }
.bv-cart-qty input,
.bv-cart-qty .bv-qty-val {
  width: 32px;
  height: 28px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  border-left: 1px solid var(--bv-line);
  border-right: 1px solid var(--bv-line);
  background: var(--bv-white);
  color: var(--bv-ink);
  -moz-appearance: textfield;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bv-cart-qty input::-webkit-outer-spin-button,
.bv-cart-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bv-cart-item-remove {
  background: none;
  border: none;
  color: var(--bv-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: flex-start;
  transition: color 0.2s var(--bv-ease);
}
.bv-cart-item-remove:hover { color: #dc2626; }
.bv-cart-item-remove svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
}

/* Footer */
.bv-cart-footer {
  border-top: 1px solid var(--bv-line);
  padding: 1.25rem 1.5rem;
  background: var(--bv-white);
  flex-shrink: 0;
}
.bv-cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.bv-cart-subtotal-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--bv-ink);
}
.bv-cart-subtotal-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bv-blue);
}
.bv-cart-note {
  font-size: 0.75rem;
  color: var(--bv-muted);
  margin-bottom: 1rem;
}
.bv-cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.bv-cart-actions .bv-btn {
  width: 100%;
  padding: 0.9rem 1rem;
}

/* Loading state */
.bv-cart-body.loading {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 480px) {
  .bv-cart-panel { width: 100vw; }
  .bv-cart-header, .bv-cart-footer { padding: 1rem; }
  .bv-cart-body { padding: 1rem; }
}
