/* ============================================================
   FLORA77 - Cart Drawer (cart-drawer.css)
   Desktop side drawer + mobile bottom sheet
   ============================================================ */

/* ── Desktop Overlay ── */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  backdrop-filter: blur(2px);
}

/* ── Desktop Drawer ── */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-card, #1a1a2e);
  border-left: 1px solid var(--border, rgba(255,255,255,0.08));
  z-index: 2001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}

.cart-drawer.open { right: 0; }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}

.cart-drawer-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #e8e8f0);
  margin: 0;
}

.cart-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--bg-surface, #16213e);
  color: var(--text-muted, #6b6b80);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cart-drawer-close:hover {
  background: var(--bg-hover, #1e1e3a);
  color: var(--text-primary, #e8e8f0);
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

.cart-preview-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-secondary, #a0a0b8);
}

.cart-preview-total strong {
  font-size: 18px;
  color: var(--accent, #22c55e);
}

.cart-preview-actions {
  display: flex;
  gap: 8px;
}

.btn-cart-page, .btn-checkout {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-cart-page {
  background: var(--bg-surface, #16213e);
  color: var(--text-primary, #e8e8f0);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
}

.btn-cart-page:hover { border-color: var(--accent, #22c55e); color: var(--accent, #22c55e); }

.btn-checkout {
  background: linear-gradient(135deg, var(--accent, #22c55e), var(--accent-dark, #16a34a));
  color: #fff;
  border: none;
}

.btn-checkout:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow, rgba(34,197,94,0.3));
}

/* ── Cart Preview Items ── */
.cart-preview-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-preview-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-surface, #16213e);
  border-radius: 10px;
  align-items: center;
}

.cart-preview-img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-primary, #0a0a1a);
}

.cart-preview-img-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--bg-primary, #0a0a1a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.cart-preview-info { flex: 1; min-width: 0; }

.cart-preview-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #e8e8f0);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-preview-meta {
  font-size: 12px;
  color: var(--text-muted, #6b6b80);
}

.cart-preview-subtotal {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #22c55e);
  white-space: nowrap;
}

.cart-preview-empty, .cart-preview-loading, .cart-preview-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #6b6b80);
  font-size: 14px;
}

.cart-preview-empty span { font-size: 40px; display: block; margin-bottom: 12px; }

/* ── Mobile Bottom Sheet ── */
.cart-sheet {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

.cart-sheet[hidden] { display: none; }

.cart-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.cart-sheet-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: var(--bg-card, #1a1a2e);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-sheet.active .cart-sheet-content { transform: translateY(0); }

.cart-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--text-muted, #6b6b80);
  border-radius: 2px;
  margin: 12px auto 4px;
  opacity: 0.5;
}

.cart-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}

.cart-sheet-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #e8e8f0);
  margin: 0;
}

.cart-sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--bg-surface, #16213e);
  color: var(--text-muted, #6b6b80);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-sheet-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

@media (min-width: 769px) {
  .cart-sheet { display: none !important; }
}

@media (max-width: 768px) {
  .cart-drawer, .cart-drawer-overlay { display: none !important; }
}
