/* Styles for the Bestello order form */

/* CSS Variables for consistent styling */
:root {
  --bestello-primary-color: #333;
  --bestello-border-color: #ddd;
  --bestello-bg-color: #f9f9f9;
  --bestello-hover-color: #f0f0f0;
  --bestello-success-color: #4caf50;
  --bestello-error-color: #f44336;
  --bestello-input-bg: #fff;
  --bestello-spacing-sm: 5px;
  --bestello-spacing-md: 10px;
  --bestello-spacing-lg: 20px;
  --bestello-transition: all 0.2s ease;
}

/* Base form styling */
#bestello-order-form {
  color: var(--bestello-primary-color);
  max-width: 800px;
  margin: 0 auto;
}

/* Section styling */
#bestello-order-form h3 {
  margin-top: var(--bestello-spacing-lg);
  margin-bottom: var(--bestello-spacing-md);
  border-bottom: 1px solid var(--bestello-border-color);
  padding-bottom: var(--bestello-spacing-sm);
}

/* Message display */
.bestello-form-message {
  margin-bottom: var(--bestello-spacing-lg);
}

/* Product styling */
.bestello-product-item {
  margin-bottom: var(--bestello-spacing-md);
  padding: var(--bestello-spacing-md);
  border-bottom: 1px solid var(--bestello-border-color);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.bestello-product-item:hover {
  background-color: var(--bestello-hover-color);
}

.bestello-single-product {
  padding: var(--bestello-spacing-md);
  border: 1px solid var(--bestello-border-color);
  background-color: var(--bestello-bg-color);
  margin-bottom: var(--bestello-spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bestello-product-info {
  display: flex;
  align-items: center;
  gap: var(--bestello-spacing-sm);
}

.bestello-quantity-control {
  display: flex;
  align-items: center;
  gap: var(--bestello-spacing-sm);
}

.bestello-product-name {
  font-weight: bold;
}

.bestello-single-product .bestello-product-quantity {
  margin-left: var(--bestello-spacing-md);
  font-style: italic;
  display: none; /* Hide the static quantity text */
}

/* Input styling */
#bestello-order-form input[type="text"],
#bestello-order-form input[type="email"],
#bestello-order-form input[type="tel"],
#bestello-order-form textarea,
#bestello-order-form input[type="number"] {
  border: 1px solid var(--bestello-border-color);
  padding: 8px 12px;
  width: 100%;
  background-color: var(--bestello-input-bg);
  transition: var(--bestello-transition);
  box-sizing: border-box;
}

#bestello-order-form input[type="text"]:focus,
#bestello-order-form input[type="email"]:focus,
#bestello-order-form input[type="tel"]:focus,
#bestello-order-form textarea:focus,
#bestello-order-form input[type="number"]:focus {
  border-color: var(--bestello-primary-color);
  outline: none;
}

#bestello-order-form label {
  display: block;
  margin-bottom: 4px;
}

.bestello-quantity-input {
  width: 60px !important;
  text-align: center;
}

.bestello-quantity-input:disabled {
  background-color: #eee;
  cursor: not-allowed;
}

/* Order summary styling */
.bestello-order-summary {
  background-color: var(--bestello-bg-color);
  padding: var(--bestello-spacing-lg);
  margin-top: var(--bestello-spacing-lg);
  border: 1px solid var(--bestello-border-color);
}

.bestello-order-summary hr {
  border: 0;
  border-top: 1px solid var(--bestello-border-color);
  margin: var(--bestello-spacing-md) 0;
}

.bestello-order-summary p {
  margin: var(--bestello-spacing-sm) 0;
  display: flex;
  justify-content: space-between;
}

/* Message field */
#bestello-message {
  resize: vertical;
  min-height: 100px;
}

/* Error and success messages */
.bestello-errors {
  color: var(--bestello-error-color);
  border: 1px solid var(--bestello-error-color);
  padding: var(--bestello-spacing-md);
  margin-bottom: var(--bestello-spacing-lg);
  list-style-position: inside;
}

.bestello-success {
  color: var(--bestello-success-color);
  border: 1px solid var(--bestello-success-color);
  padding: var(--bestello-spacing-md);
  margin-bottom: var(--bestello-spacing-lg);
}

.required {
  color: var(--bestello-error-color);
}

/* Submit button */
#bestello-order-form input[type="submit"] {
  background-color: var(--bestello-primary-color);
  color: white;
  padding: 12px 24px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  margin-top: var(--bestello-spacing-lg);
  transition: var(--bestello-transition);
}

#bestello-order-form input[type="submit"]:hover {
  opacity: 0.9;
}

#bestello-order-form input[type="submit"]:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Two-column layout for Your Details section */
.bestello-user-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: var(--bestello-spacing-md);
}

.bestello-field-full {
  grid-column: 1 / -1;
}

/* Responsive design */
@media (max-width: 768px) {
  .bestello-user-details-grid {
    grid-template-columns: 1fr;
    grid-gap: 0;
  }
  
  .bestello-product-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .bestello-product-item label,
  .bestello-product-item input[type="number"] {
    margin-top: var(--bestello-spacing-sm);
  }
}

/* Thank you page styling */
.bestello-thank-you {
  max-width: 800px;
  margin: 0 auto;
}

.bestello-order-details-summary h2 {
  margin-top: var(--bestello-spacing-lg);
  margin-bottom: var(--bestello-spacing-md);
}

.bestello-order-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--bestello-spacing-lg);
}

.bestello-order-table th,
.bestello-order-table td {
  padding: var(--bestello-spacing-md);
  text-align: left;
  border: 1px solid var(--bestello-border-color);
}

.bestello-order-table th {
  background-color: var(--bestello-bg-color);
}

.bestello-payment-instructions {
  margin-top: var(--bestello-spacing-lg);
  padding: var(--bestello-spacing-lg);
  background-color: var(--bestello-bg-color);
  border: 1px solid var(--bestello-border-color);
}