/* Nav cart + cart sidebar (linked from CartSidebar.astro) */
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: rgba(45, 27, 78, 0.06);
  color: #2d1b4e;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.nav-cart-btn:hover {
  background: rgba(124, 82, 184, 0.14);
  color: #7c52b8;
}

.nav-cart-btn svg {
  display: block;
  flex-shrink: 0;
}

.nav-cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 50%;
  background: #7c52b8;
  color: #fff;
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  box-sizing: border-box;
}

.nav-cart-badge.is-hidden {
  display: none;
}

/* Overlay */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar panel */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  background: #fdf8f3;
  z-index: 1000;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open {
  transform: translateX(0);
}

@media (max-width: 640px) {
  .cart-sidebar {
    width: 100%;
  }
}

/* Header */
.cart-sidebar-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  padding-right: 56px;
  border-bottom: 1px solid #e8e0d5;
  flex-shrink: 0;
}

.cart-sidebar-title {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  font-weight: 600;
  color: #2d1b4e;
  margin: 0;
  line-height: 1.25;
  padding-right: 8px;
}

.cart-sidebar-close {
  position: absolute;
  top: 24px;
  right: 24px;
  border: none;
  background: transparent;
  width: auto;
  height: auto;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #7c52b8;
}

.cart-sidebar-close:hover {
  opacity: 0.85;
}

/* Scrollable body */
.cart-sidebar-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-sidebar-empty {
  margin: 0;
  padding: 32px 24px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  color: #999;
  line-height: 1.5;
  text-align: center;
}

.cart-sidebar-body:has(#cart-sidebar-items:empty) .cart-sidebar-empty {
  flex: 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cart-sidebar-empty[style*="display: none"] {
  display: none !important;
}

#cart-sidebar-items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#cart-sidebar-items:empty {
  flex: 0 0 0;
  min-height: 0;
  overflow: hidden;
}

/* Footer */
.cart-sidebar-footer {
  flex-shrink: 0;
  padding: 24px;
  border-top: 1px solid #e8e0d5;
}

.cart-sidebar-footer.is-hidden {
  display: none;
}

.cart-sidebar-total-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.cart-sidebar-total-label {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #2d1b4e;
}

.cart-sidebar-total-amount {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  font-weight: 600;
  color: #7c52b8;
  letter-spacing: -0.02em;
}

.cart-sidebar-disclaimer {
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-style: italic;
  color: #999;
  margin: 0 0 16px;
  line-height: 1.4;
}

.btn-cart-checkout {
  width: 100%;
  padding: 14px 20px;
  border-radius: 100px;
  border: none;
  background: #7c52b8;
  color: #fff;
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}

.btn-cart-checkout:hover:not(:disabled) {
  opacity: 0.95;
}

.btn-cart-checkout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Simple line items (confetti-cart.js without shop-tier) */
.cart-line-item {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 24px;
  border-bottom: 1px solid #f0ebe4;
}

.cart-line-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #f5f0ea;
}

.cart-line-name {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #2d1b4e;
}

.cart-line-price {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #c9a84c;
  margin-top: 4px;
}

/* shop-tier cart rows */
#cart-sidebar-items .cart-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  color: #999;
  padding: 32px 24px;
  margin: 0;
  min-height: 120px;
}

#cart-sidebar-items .cart-item-row {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 24px;
  padding-right: 40px;
  border-bottom: 1px solid #f0ebe4;
}

#cart-sidebar-items .cart-item-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f0ea;
  flex-shrink: 0;
}

#cart-sidebar-items .cart-item-info {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}

#cart-sidebar-items .cart-item-name {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #2d1b4e;
}

#cart-sidebar-items .cart-item-price {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #c9a84c;
  margin-top: 4px;
}

#cart-sidebar-items .cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

#cart-sidebar-items .cart-item-total {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #c9a84c;
}

#cart-sidebar-items .qty-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  color: #2d1b4e;
}

#cart-sidebar-items .qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #e8e0d5;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #2d1b4e;
}

#cart-sidebar-items .qty-btn:hover {
  background: #f7f3ef;
}

#cart-sidebar-items .cart-remove {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 18px;
  line-height: 1;
  border: none;
  background: none;
  color: #999;
  cursor: pointer;
  padding: 4px;
  text-decoration: none;
}

#cart-sidebar-items .cart-remove:hover {
  color: #666;
}
