/* ================================================================
   TopBeauty – Mini Cart Drawer
================================================================ */

/* Overlay */
.tbt-mc-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9800;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tbt-mc-overlay.open { display: block; opacity: 1; }

/* Drawer */
.tbt-mc-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 400px; max-width: 92vw;
  background: #fff;
  z-index: 9900;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -4px 0 30px rgba(0,0,0,0.12);
  font-family: 'Poppins', sans-serif;
}
.tbt-mc-drawer.open { transform: translateX(0); }

/* Header */
.tbt-mc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}
.tbt-mc-title {
  font-family: 'Jost', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #111;
}
.tbt-mc-count {
  font-size: 13px;
  font-weight: 400;
  color: #888;
  margin-left: 6px;
}
.tbt-mc-close {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: #f5f5f5;
  border: none; border-radius: 50%;
  cursor: pointer; color: #333;
  transition: background 0.2s;
}
.tbt-mc-close:hover { background: #e8e8e8; }
.tbt-mc-close svg { width: 14px; height: 14px; }

/* Items area */
.tbt-mc-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.tbt-mc-items::-webkit-scrollbar { width: 3px; }
.tbt-mc-items::-webkit-scrollbar-thumb { background: #e8e8e8; border-radius: 2px; }

/* Cart item */
.tbt-mc-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid #f5f5f5;
  position: relative;
  transition: background 0.2s;
}
.tbt-mc-item:hover { background: #fafafa; }
.tbt-mc-item:last-child { border-bottom: none; }

.tbt-mc-item__img {
  flex-shrink: 0;
  width: 72px; height: 72px;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  background: #f8f8f8;
  display: block;
}
.tbt-mc-item__img img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 4px;
}

.tbt-mc-item__info {
  flex: 1;
  min-width: 0;
}
.tbt-mc-item__name {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: #111;
  line-height: 1.4;
  margin-bottom: 6px;
  text-decoration: none;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tbt-mc-item__name:hover { color: rgb(16,118,189); }

.tbt-mc-item__meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tbt-mc-item__qty {
  font-size: 12px;
  color: #888;
}
.tbt-mc-item__price {
  font-size: 13px;
  font-weight: 600;
  color: #111;
}

.tbt-mc-item__remove {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: #bbb; transition: color 0.2s;
  padding: 0;
}
.tbt-mc-item__remove:hover { color: #e53e3e; }
.tbt-mc-item__remove svg { width: 14px; height: 14px; }

/* Empty state */
.tbt-mc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: #bbb;
  text-align: center;
}
.tbt-mc-empty svg {
  width: 48px; height: 48px;
  margin-bottom: 16px;
  stroke: #ddd;
}
.tbt-mc-empty p {
  font-size: 14px;
  color: #aaa;
}

/* Loading state */
.tbt-mc-items.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Footer */
.tbt-mc-footer {
  padding: 20px 24px 28px;
  border-top: 1px solid #e8e8e8;
  flex-shrink: 0;
  background: #fff;
}
.tbt-mc-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 14px;
}
.tbt-mc-subtotal span:first-child { color: #666; }
.tbt-mc-subtotal-amount {
  font-weight: 700;
  font-size: 16px;
  color: #111;
}
.tbt-mc-btn {
  display: block;
  width: 100%;
  padding: 14px;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin-bottom: 10px;
  border: none;
}
.tbt-mc-btn:last-child { margin-bottom: 0; }
.tbt-mc-btn--primary {
  background: #111;
  color: #fff;
}
.tbt-mc-btn--primary:hover { background: #333; color: #fff; }
.tbt-mc-btn--secondary {
  background: transparent;
  color: #111;
  border: 1.5px solid #ddd;
}
.tbt-mc-btn--secondary:hover { border-color: #111; }

/* Notifica aggiunta prodotto */
.tbt-mc-toast {
  position: fixed;
  bottom: 80px; right: 24px;
  background: #111;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  padding: 12px 18px;
  border-radius: 8px;
  z-index: 9950;
  transform: translateY(20px);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  max-width: 280px;
  pointer-events: none;
}
.tbt-mc-toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 480px) {
  .tbt-mc-drawer { width: 100vw; max-width: 100vw; }
}
