/* =============================================
   CART ICON & BADGE
   ============================================= */

.cart-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  background: transparent;
  border: none;
  color: rgb(34, 30, 28);
  transition: color 0.3s ease;
  margin-left: auto;
  margin-right: 12px;
}

.cart-icon-wrapper:hover {
  color: rgb(139, 72, 82);
}

.cart-icon-wrapper svg {
  width: 24px;
  height: 24px;
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 0px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgb(139, 72, 82);
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  padding: 0 4px;
  pointer-events: none;
  transform: scale(0);
  transition: transform 0.2s ease;
}

.cart-badge.show {
  transform: scale(1);
}

/* =============================================
   CART OVERLAY
   ============================================= */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

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

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: #FBFAF9;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

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

/* Header */
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #d2d2d2;
  flex-shrink: 0;
}

.cart-drawer-header h2 {
  font-family: Cormorant Garamond, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: rgb(34, 30, 28);
  margin: 0;
}

.cart-drawer-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgb(125, 124, 124);
  padding: 4px;
  transition: color 0.3s ease;
}

.cart-drawer-close:hover {
  color: rgb(34, 30, 28);
}

/* Items area */
.cart-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

/* Empty state */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  text-align: center;
  color: rgb(125, 124, 124);
}

.cart-empty svg {
  width: 64px;
  height: 64px;
  color: #d2d2d2;
}

.cart-empty p {
  font-family: Inter, sans-serif;
  font-size: 1rem;
  color: rgb(125, 124, 124);
}

.cart-empty a {
  font-family: Inter, sans-serif;
  font-size: 0.9rem;
  color: rgb(139, 72, 82);
  text-decoration: underline;
}

/* Cart item */
.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

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

.cart-item-name {
  font-family: Inter, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgb(34, 30, 28);
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.cart-item-price {
  font-family: Inter, sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: rgb(125, 124, 124);
  margin: 0;
}

/* Quantity controls */
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #d2d2d2;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: rgb(34, 30, 28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.qty-btn:hover {
  border-color: rgb(139, 72, 82);
  color: rgb(139, 72, 82);
}

.qty-value {
  font-family: Inter, sans-serif;
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
  font-weight: 500;
  color: rgb(34, 30, 28);
}

.cart-item-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgb(180, 180, 180);
  padding: 4px;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.cart-item-remove:hover {
  color: rgb(200, 60, 60);
}

/* Footer / totals */
.cart-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid #d2d2d2;
  flex-shrink: 0;
  background: #FBFAF9;
}

.cart-totals {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-family: Inter, sans-serif;
  font-size: 0.9rem;
  color: rgb(125, 124, 124);
}

.cart-total-row.total {
  font-size: 1.05rem;
  font-weight: 600;
  color: rgb(34, 30, 28);
  border-top: 1px solid #d2d2d2;
  padding-top: 8px;
}

.cart-btn-checkout {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 100px;
  background: rgb(139, 72, 82);
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-bottom: 10px;
}

.cart-btn-checkout:hover {
  background: rgb(110, 54, 64);
}

.cart-btn-continue {
  width: 100%;
  padding: 12px;
  border: 1px solid #d2d2d2;
  border-radius: 100px;
  background: transparent;
  color: rgb(34, 30, 28);
  font-family: Inter, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cart-btn-continue:hover {
  border-color: rgb(139, 72, 82);
  color: rgb(139, 72, 82);
}

/* =============================================
   ADD-TO-CART BUTTON ON PRODUCT CARDS
   ============================================= */

.btn-add-cart {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid rgb(34, 30, 28);
  border-radius: 100px;
  background: transparent;
  color: rgb(34, 30, 28);
  font-family: Inter, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.btn-add-cart:hover {
  background: rgb(34, 30, 28);
  color: #fff;
}

.btn-add-cart.added {
  background: rgb(139, 72, 82);
  border-color: rgb(139, 72, 82);
  color: #fff;
  pointer-events: none;
}

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */

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

  .cart-icon-wrapper {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    margin-right: 0;
  }

  .cart-item-img {
    width: 50px;
    height: 50px;
  }
}
