/* ═══════════════════════════════════════════════════════════
   CART SIDEBAR CSS
   ═══════════════════════════════════════════════════════════ */

/* Cart Sidebar Overlay */
#cartSidebarOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 998;
}

#cartSidebarOverlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Cart Sidebar Container */
#cartSidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#cartSidebar.open {
  transform: translateX(0);
}

/* Cart Sidebar Header */
.cart-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-solid);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.cart-sidebar-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--charcoal);
  margin: 0;
}

#closeCartBtn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--charcoal);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  border-radius: 6px;
}

#closeCartBtn:hover {
  background: var(--cream);
}

/* Cart Content */
#cartContent {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Empty Cart */
.empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.empty-cart i {
  font-size: 48px;
  color: var(--border-solid);
  margin-bottom: 16px;
}

.empty-cart p {
  font-size: 16px;
  color: var(--gray);
}

/* Cart Items List */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Single Cart Item */
.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  gap: 12px;
  border: 1px solid var(--border-solid);
  padding: 12px;
  border-radius: 6px;
  background: var(--cream);
  transition: box-shadow 0.2s ease;
}

.cart-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-item-image {
  grid-column: 1;
  height: 80px;
  overflow: hidden;
  border-radius: 4px;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Cart Item Details */
.cart-item-details {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-item-details h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.cart-item-price {
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  margin: 2px 0;
}

/* Cart Item Quantity Controls */
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.cart-item-qty button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-solid);
  background: white;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  color: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cart-item-qty button:hover {
  background: var(--charcoal);
  color: white;
  border-color: var(--charcoal);
}

.cart-item-qty span {
  font-size: 12px;
  font-weight: 600;
  color: var(--charcoal);
  min-width: 24px;
  text-align: center;
}

/* Cart Item Total & Remove */
.cart-item-total {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}

.cart-item-total p {
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal);
  margin: 0;
}

.remove-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  transition: color 0.2s ease;
}

.remove-btn:hover {
  color: #d9534f;
}

/* Cart Footer */
.cart-footer {
  border-top: 1px solid var(--border-solid);
  padding: 20px;
  flex-shrink: 0;
}

/* Cart Total */
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-solid);
}

.cart-total span {
  font-size: 13px;
  color: var(--gray);
}

.cart-total strong {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--charcoal);
}

/* Buttons */
.btn-primary,
.btn-secondary {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 12px 16px !important;
  border-radius: 4px;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  border: none !important;
}

.btn-primary {
  background: var(--charcoal) !important;
  color: white !important;
}

.btn-primary:hover {
  background: var(--gold) !important;
}

.btn-secondary {
  background: var(--cream) !important;
  color: var(--charcoal) !important;
  border: 1px solid var(--border-solid) !important;
}

.btn-secondary:hover {
  background: var(--charcoal) !important;
  color: white !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  #cartSidebar {
    width: 100%;
  }

  .cart-item {
    grid-template-columns: 70px 1fr 70px;
  }

  .cart-item-image {
    height: 70px;
  }
}

@media (max-width: 480px) {
  #cartSidebar {
    width: 100%;
  }

  .cart-item {
    grid-template-columns: 60px 1fr;
    gap: 8px;
  }

  .cart-item-image {
    grid-column: 1;
    height: 60px;
  }

  .cart-item-details {
    grid-column: 2;
  }

  .cart-item-total {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-solid);
  }

  .cart-sidebar-header h2 {
    font-size: 18px;
  }
}

/* Scrollbar Styling */
#cartContent::-webkit-scrollbar {
  width: 6px;
}

#cartContent::-webkit-scrollbar-track {
  background: var(--cream);
}

#cartContent::-webkit-scrollbar-thumb {
  background: var(--gold-light);
  border-radius: 3px;
}

#cartContent::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}