/* Warenkorbseiten-Stile */
.cart-page {
  max-width: 900px;
  margin: 30px auto;
  padding: 1rem;
}

.cart-title {
  text-align: center;
  margin-bottom: 30px;
  color: var(--md-sys-color-primary);
}

/* Leerer Warenkorb */
.empty-cart-message {
  text-align: center;
  font-size: 1.2rem;
}

.empty-cart-actions {
  text-align: center;
  margin-top: 20px;
}

/* Warenkorb-Tabelle - nutzt table-* Klassen aus style.css */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.cart-table-header {
  border-bottom: 2px solid var(--md-sys-color-outline);
}

.cart-table th {
  padding: 10px;
}

.cart-table .th-product {
  text-align: left;
}

.cart-table .th-price,
.cart-table .th-total {
  text-align: right;
}

.cart-table .th-quantity,
.cart-table .th-action {
  text-align: center;
}

.cart-item-row {
  border-bottom: 1px solid var(--md-sys-color-surface-variant);
}

.cart-item-row td {
  padding: 10px;
}

.cart-item-image {
  width: 80px;
}

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

.cart-item-details {
  vertical-align: top;
}

.cart-item-name {
  margin: 0 0 5px 0;
  font-size: 1rem;
}

.cart-item-price,
.cart-item-total {
  text-align: right;
}

.cart-item-quantity {
  text-align: center;
}

.quantity-form {
  display: inline-flex;
  align-items: center;
}

.quantity-input {
  width: 60px;
  padding: 8px 10px; /* Updated padding */
  text-align: center;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 6px; /* Updated border-radius */
  background-color: var(--md-sys-color-surface); /* Added for consistency */
  color: var(--md-sys-color-on-surface); /* Added for consistency */
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out; /* Added transition */
}

.quantity-input:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary-container);
}

.update-quantity-btn {
  margin-left: 5px;
  padding: 6px 10px; /* Updated padding */
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: none;
  border-radius: 6px; /* Updated border-radius */
  cursor: pointer;
  font-weight: 500; /* Added font-weight */
  transition: background-color 0.2s ease-in-out, transform 0.1s ease,
    box-shadow 0.2s ease-in-out; /* Added transition */
}

.update-quantity-btn:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.update-quantity-btn:active {
  transform: translateY(0);
}

.update-quantity-icon {
  font-size: 1rem;
  vertical-align: middle;
}

.cart-item-actions {
  text-align: center;
}

.remove-item-link {
  color: var(--md-sys-color-error);
  text-decoration: none;
}

/* Unterer Bereich des Warenkorbs */

.cart-bottom-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 20px;
}

.checkout-btn {
  vertical-align: middle;
  margin-right: 5px;
  padding: 10px 20px;
}

.checkout-form {
  margin: 20px 0;
}

.paypal-checkout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white;
  border-radius: 6px;
  padding: 12px 24px;
}

/* Gutscheinbereich */
.voucher-section {
  flex-basis: 100%;
  margin-bottom: 20px;
}

.voucher-title {
  margin-top: 0;
  margin-bottom: 10px;
}

.voucher-form {
  display: flex;
}

.voucher-input {
  flex: 1;
  height: 37px; /* Gleiche Höhe wie Button */
  padding: 0 12px;
  border: 1px solid #ccc;
  border-right: none; /* Rechten Border entfernen */
  border-radius: 6px 0 0 6px !important; /* Nur links abgerundet */
  outline: none;
  font-size: 14px;
  box-sizing: border-box; /* Wichtig für korrekte Höhe */
}

.voucher-input:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary-container);
}

.voucher-apply-btn {
  padding: 0 20px; /* Padding angepasst */
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-secondary);
  border: 1px solid var(--md-sys-color-secondary); /* Border hinzugefügt */
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease,
    box-shadow 0.2s ease-in-out;
  height: 37px;
  box-sizing: border-box; /* Wichtig für korrekte Höhe */
}

.voucher-apply-btn:hover {
  background-color: var(--md-sys-color-primary-variant);
  color: var(--md-sys-color-on-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.voucher-apply-btn:active {
  transform: translateY(0);
}

.applied-voucher-info {
  margin-top: 10px;
  font-size: 0.9rem;
}

.remove-voucher-link {
  margin-left: 10px;
  color: var(--md-sys-color-error);
  text-decoration: underline;
}

.voucher-container {
  display: flex;
  justify-content: center;
  align-items: stretch; /* Gleiche Höhe */
  width: 100%;
  gap: 0; /* Kein Abstand */
}

/* Warenkorb-Zusammenfassung */
.cart-summary {
  flex-basis: 100%;
  text-align: right;
}

.cart-subtotal,
.cart-discount {
  font-size: 1.1rem;
  margin: 5px 0;
}

.cart-discount {
  color: var(--md-sys-color-primary);
}

.cart-total-divider {
  border: 0;
  border-top: 1px solid var(--md-sys-color-outline);
  margin: 10px 0;
}

.cart-total {
  font-size: 1.5rem;
  margin-top: 10px;
  color: var(--md-sys-color-primary);
}

.clear-cart-actions {
  margin-top: 20px;
}

.clear-cart-link {
  color: var(--md-sys-color-error);
  text-decoration: underline;
}

/* Mittlere Bildschirme und größer */
@media (min-width: 768px) {
  .voucher-section {
    flex-basis: 48%;
  }

  .cart-summary {
    flex-basis: 48%;
  }
}
