/* ============ CART ICON BADGE ============ */
.cart-icon-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 6px;
  transition: 0.3s;
  color: var(--text);
  text-decoration: none;
}

.cart-icon-wrapper:hover {
  color: var(--accent);
}

.cart-icon-wrapper i {
  font-size: 1.2rem;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  font-family: 'Manrope', sans-serif;
}

.cart-badge.show {
  display: flex;
}

/* ============ CART SIDEBAR ============ */
.cart-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s ease;
}

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

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 92vw;
  height: 100vh;
  background: var(--bg);
  z-index: 999999;
  box-shadow: -10px 0 60px rgba(0, 0, 0, 0.12);
  transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  font-family: 'Manrope', sans-serif;
}

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

.cart-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.cart-sidebar-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.cart-sidebar-header .cart-sidebar-count {
  font-size: 0.7rem;
  opacity: 0.4;
  font-weight: 400;
}

.cart-sidebar-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text);
  opacity: 0.4;
  transition: 0.3s;
  padding: 4px;
}

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

.cart-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 12px;
}

.cart-empty i {
  font-size: 3rem;
  opacity: 0.2;
}

.cart-empty p {
  font-size: 0.9rem;
  opacity: 0.5;
}

.cart-empty-btn {
  padding: 10px 28px;
  background: var(--text);
  color: #fff;
  border-radius: 50px;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  transition: 0.3s;
}

.cart-empty-btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.cart-sidebar-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  align-items: center;
  position: relative;
}

.cart-sidebar-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

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

.cart-sidebar-item-info h4 {
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-sidebar-item-info p {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 4px;
}

.cart-sidebar-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-sidebar-qty button {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  font-weight: 600;
}

.cart-sidebar-qty button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.cart-sidebar-qty span {
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-sidebar-remove {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 4px;
  transition: 0.3s;
  position: absolute;
  top: 6px;
  right: 8px;
}

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

.cart-sidebar-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  background: var(--bg);
}

.cart-sidebar-footer .cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cart-sidebar-footer .cart-total-row span:first-child {
  font-size: 0.8rem;
  opacity: 0.5;
}

.cart-sidebar-footer .cart-total-row .cart-sidebar-total {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.cart-sidebar-footer .cart-checkout-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.3s;
  text-align: center;
  text-decoration: none;
  font-family: 'Manrope', sans-serif;
}

.cart-sidebar-footer .cart-checkout-btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(164, 139, 116, 0.3);
}

.cart-sidebar-footer .cart-view-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50px;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.3s;
  text-align: center;
  text-decoration: none;
  font-family: 'Manrope', sans-serif;
  margin-top: 8px;
}

.cart-sidebar-footer .cart-view-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: 100%;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  animation: slideInRight 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  border-left: 4px solid var(--accent);
  font-size: 0.8rem;
}

.toast-success {
  border-left-color: #2e7d32;
}

.toast-error {
  border-left-color: #d32f2f;
}

.toast button {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.3;
  transition: 0.3s;
  padding: 4px;
  font-size: 0.8rem;
}

.toast button:hover {
  opacity: 1;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .cart-sidebar {
    width: 100vw;
    max-width: 100vw;
    right: -100vw;
  }
  .cart-sidebar.open {
    right: 0;
  }
  .toast-container {
    top: 70px;
    right: 10px;
    left: 10px;
    max-width: 100%;
  }
}
