/* Cart toggle button */
.cart-toggle-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-count {
  display: inline-block;
  background: #d32f2f;
  color: white;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.75rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar */
.cart-sidebar {
  position: fixed;
  right: -400px;
  top: 0;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

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

.cart-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.cart-sidebar-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.cart-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
}

.cart-items-container {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-title {
  font-weight: bold;
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
}

.cart-item-price {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.cart-item-quantity button {
  background: #f0f0f0;
  border: 1px solid #ddd;
  width: 24px;
  height: 24px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 0.75rem;
}

.cart-item-remove {
  color: #d32f2f;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.85rem;
}

.cart-empty-message {
  text-align: center;
  color: #999;
  padding: 2rem 1rem;
}

/* Footer */
.cart-sidebar-footer {
  border-top: 1px solid #e0e0e0;
  padding: 1.5rem;
  background: #f9f9f9;
}

.cart-summary {
  margin-bottom: 1.5rem;
}

.cart-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.cart-line.cart-total {
  font-weight: bold;
  font-size: 1.1rem;
  border-top: 1px solid #ddd;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cart-actions button {
  padding: 0.75rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #0056b3;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: #007bff;
  border: 1px solid #007bff;
}

.btn-secondary:hover {
  background: #f0f0f0;
}

/* Shipping selector */
.shipping-selector {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
}

.shipping-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: bold;
}

.shipping-selector select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Overlay behind sidebar */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
  display: none;
}

.cart-overlay.open {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }
}
