/* =============================================
   CART DRAWER
   ============================================= */

/* ===== OVERLAY ===== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

/* ===== DRAWER ===== */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--white);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
}

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

/* ===== HEADER ===== */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.cart-header h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 20px;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-count-badge {
  background: var(--black);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--gray-200);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--gray-600);
  transition: background var(--transition), color var(--transition);
}

.cart-close:hover { background: var(--gray-100); color: var(--black); }

/* ===== ITEMS LIST ===== */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-items::-webkit-scrollbar { width: 4px; }
.cart-items::-webkit-scrollbar-track { background: transparent; }
.cart-items::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }

/* ===== EMPTY STATE ===== */
.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--gray-400);
  text-align: center;
  padding: 40px 24px;
}

.cart-empty i {
  font-size: 52px;
  color: var(--gray-200);
}

.cart-empty p {
  font-size: 15px;
  color: var(--gray-400);
}

.cart-empty a {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 28px;
  background: var(--black);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: background var(--transition);
}

.cart-empty a:hover { background: var(--gray-600); }

/* ===== CART ITEM ===== */
.cart-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 12px;
  animation: fadeUp 0.3s ease both;
}

.cart-item-img {
  width: 80px;
  height: 80px;
  background: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--gray-200);
}

.cart-item-img img {
  width: 85%;
  height: 85%;
  object-fit: contain;
}

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

.cart-item-name {
  font-size: 14px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-meta {
  font-size: 12px;
  color: var(--gray-400);
  margin: 3px 0 10px;
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cart-item-price {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Archivo Black', sans-serif;
  color: var(--black);
}

/* Mini qty control */
.mini-qty {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--white);
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.mini-qty-btn {
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.mini-qty-btn:hover { background: var(--gray-100); }

.mini-qty-val {
  min-width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}

.cart-item-remove {
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.cart-item-remove:hover { background: #fee2e2; color: #e11d48; }

/* ===== FOOTER ===== */
.cart-footer {
  border-top: 1px solid var(--gray-200);
  padding: 20px 24px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-subtotal span:first-child {
  font-size: 14px;
  color: var(--gray-600);
  font-family: 'Inter', sans-serif;
}

.cart-subtotal-price {
  font-size: 22px;
  font-weight: 700;
  font-family: 'Archivo Black', sans-serif;
  color: var(--black);
}

.cart-shipping {
  font-size: 12px;
  color: #16a34a;
  text-align: center;
  font-family: 'Inter', sans-serif;
}

.cart-shipping i { margin-right: 4px; }

.cart-checkout-btn {
  width: 100%;
  padding: 16px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  min-height: 52px;
}

.cart-checkout-btn:hover { background: var(--gray-600); transform: translateY(-1px); }

.cart-continue-btn {
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--black);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.cart-continue-btn:hover { border-color: var(--black); background: var(--gray-100); }

/* ===== BADGE ICÔNE PANIER ===== */
.cart-icon-wrap {
  position: relative;
  display: inline-flex;
}

.cart-bubble {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e11d48;
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.cart-bubble.hidden { display: none; }
.cart-bubble.pop { transform: scale(1.4); }

/* ===== TOAST ===== */
.cart-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--black);
  color: var(--white);
  padding: 13px 22px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  opacity: 0;
  white-space: nowrap;
}

.cart-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.cart-toast i { color: #4ade80; }

/* ===== AUTH PROMPT ===== */
.auth-prompt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.auth-prompt-overlay.open { opacity: 1; pointer-events: all; }

.auth-prompt {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.94);
  z-index: 401;
  width: 92%;
  max-width: 400px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-prompt.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.auth-prompt-icon {
  width: 60px;
  height: 60px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 18px;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.auth-prompt h3 {
  font-size: 20px;
  font-family: 'Archivo Black', sans-serif;
  color: var(--black);
  margin-bottom: 10px;
}

.auth-prompt p {
  font-size: 13px;
  color: var(--gray-600);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  margin-bottom: 20px;
}

.auth-prompt-product {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 20px;
  text-align: left;
}

.auth-prompt-product img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: var(--white);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.auth-prompt-product strong {
  display: block;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: var(--black);
}

.auth-prompt-product span {
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
  font-family: 'Archivo Black', sans-serif;
}

.auth-prompt-btns {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.auth-prompt-login {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  background: var(--black);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: background var(--transition), transform var(--transition);
  min-height: 48px;
}

.auth-prompt-login:hover { background: var(--gray-600); transform: translateY(-1px); }

.auth-prompt-register {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px;
  background: transparent;
  color: var(--black);
  text-decoration: none;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--gray-200);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition), background var(--transition);
  min-height: 48px;
}

.auth-prompt-register:hover { border-color: var(--black); background: var(--gray-100); }

.auth-prompt-perks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  text-align: left;
}

.auth-perk {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--gray-600);
}

.auth-perk i {
  width: 28px;
  height: 28px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--black);
  flex-shrink: 0;
}

.auth-prompt-close {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--gray-400);
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  transition: color var(--transition), background var(--transition);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-prompt-close:hover { color: var(--black); background: var(--gray-100); }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .cart-drawer { width: 100vw; }
  .cart-header { padding: 18px 16px; }
  .cart-items  { padding: 12px 16px; }
  .cart-footer { padding: 16px; }
}
