/* src/css/checkout.css */

/* Checkout Panel Base Styles */

.checkout-panel {
  position: fixed;
  top: 0;
  right: -100%; /* Start fully off-screen */
  width: 100%;
  max-width: 525px;
  height: 100%;
  background-color: white;
  box-shadow: -2px 0 5px rgba(0,0,0,0.5);
  transition: right 0.3s ease-in-out;
  z-index: 1000;
  overflow-y: auto;
}

.checkout-panel.open {
  right: 0; /* Slide in */
}

.checkout-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f8f9fa;
  position: sticky;
  top: 0;
  z-index: 2;
}

.checkout-panel-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}

#close-checkout {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #777;
}

#close-checkout:hover {
  color: #333;
}

/* Checkout Sections */
.checkout-section {
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.checkout-section h4 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: #333;
}

/* Product Details */
.product-details {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.product-name-price {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-weight: bold;
}

.product-description {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

/* Discount Code Section */
.discount-input-group {
  display: flex;
  margin-bottom: 10px;
}

.discount-input-group input {
  flex-grow: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
}

.discount-input-group button {
  padding: 8px 15px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.discount-input-group button:hover {
  background-color: #0069d9;
}

#discount-message {
  font-size: 0.8rem;
  margin: 5px 0;
  color: #28a745;
}

#discount-message.error {
  color: #dc3545;
}

/* Total Section */
.total-section {
  margin-top: 15px;
}

.subtotal, .discount, .total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.total {
  font-weight: bold;
  font-size: 1.1rem;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.hidden {
  display: none;
}

/* Form Styles */
.form-row {
  margin-bottom: 15px;
}

.form-row label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-row input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Card Element */
#card-element {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f9f9f9;
}

#card-errors {
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: 5px;
}

/* Submit Button */
.submit-button {
  display: block;
  width: 100%;
  padding: 12px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 20px;
  margin-left: 15px;
  margin-right: 15px;
  width: calc(100% - 30px);
}

.submit-button:hover {
  background-color: #218838;
}

/* Test Mode Banner */
.test-mode-banner {
  background: #f0ad4e;
  color: black;
  padding: 5px 10px;
  text-align: center;
  font-weight: bold;
}
