/* Accessibility */
.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 1rem;
  padding: 0.5rem;
  z-index: 999;
}

/* Fieldset Accessibility */
fieldset {
    border: none;
    box-shadow: none;
    background: transparent;
    margin: 0;
    padding: 0;
}

legend {
    display: block;
    width: 100%;
    padding: 0;
    margin-bottom: 0;
}

/* visually-hidden helper */
.visually-hidden {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Form Focus Styling */
input:focus,
button:focus,
a:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;  
}

/* Focus visible for form elements */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Error message styling */
.form-group input.error,
.form-group input[aria-invalid="true"] {
    border-color: #eb1313;
    background: #fff5f5;
}

.error-message {
    display: block;
    min-height: 18px;
    margin-top: 6px;
    color: #d11a2a;
    font-size: 13px;
}

/* Valid state styling */
input:invalid:not(:placeholder-shown) {
    border-color: #111;
}

input:valid:not(:placeholder-shown) {
    border-color: #4caf50;
}

* {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: Arial, sans-serif;
      background: #f6f6f6;
      color: #111;
    }

    .checkout-section {
      padding: 50px 0;
    }

    .checkout-container {
      width: 92%;
      max-width: 1450px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 32px;
      align-items: start;
    }

    .checkout-left, 
    .checkout-right { /* Styling for both sides of the checkout page: cart summary and form */
      background: #fff;
      border-radius: 20px;
      padding: 28px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    }

    .checkout-left h2, 
    .checkout-right h2 { /* Heading styling for both sides: "Dein Warenkorb" and "Checkout" */
      margin: 0 0 24px;
      font-size: 24px;
    }

    .form-instruction { /* Instruction text below the checkout heading: * Für den Test müssen keine echten persönlichen Daten eingegeben werden. */
      font-size: 14px;
      font-style: italic;
      color: #AA0909;
      margin-top: -12px;
      margin-bottom: 18px;
    }
    .checkout-cart-item { /* Cart item styling: product image, name, price, etc. */
      display: flex;
      gap: 16px;
      align-items: flex-start;
      border-bottom: 1px solid #eee;
      padding: 18px 0;
    }

    .checkout-cart-item img { /* Product image styling */
      width: 92px;
      height: 92px;
      object-fit: contain;
      background: #f5f5f5;
      border-radius: 12px;
      flex-shrink: 0;
    }

    .checkout-cart-info { /* Product info container */
      flex: 1;
    }

    .checkout-cart-info h3 { /* Product name */
      margin: 0 0 8px;
      font-size: 20px;
    }

    .checkout-cart-info small { /* Product details like color, size, etc. */
      display: block;
      color: #666;
      margin-bottom: 10px;
    }

    .checkout-cart-actions { /* Container for quantity controls and remove button */
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 10px;
    }

    .qty-control { /* Quantity control buttons: + and - */
      display: inline-flex;
      align-items: center;
      gap: 10px;
      border: 1px solid #ddd;
      border-radius: 10px;
      padding: 4px 8px;
    }

    .qty-control button { /* Quantity control buttons: + and - */
      border: none;
      background: transparent;
      font-size: 18px;
      width: 28px;
      height: 28px;
      cursor: pointer;
    }

    .remove-checkout-item { /* Remove button for cart items: entfernen*/
      border: none;
      background: transparent;
      color: #d11a2a;
      font-weight: 700;
      cursor: pointer;
      padding: 0;
    }

    .checkout-item-price { /* Price styling for cart items: Preis */
      font-size: 16px;
      font-weight: 700;
      white-space: nowrap;
      min-width: 100px;
      text-align: right;
    }

    .checkout-summary { /* Summary section styling: Zusammenfassung */
      margin-top: 24px;
      border-top: 1px solid #eee;
      padding-top: 20px;
    }

    .summary-row { /* Summary row styling: Zwischensumme, Versandkosten, etc. */
      display: flex;
      justify-content: space-between;
      margin-bottom: 14px;
      font-size: 16px;
    }

    .summary-row.total { /* Total price row in summary: Gesamtpreis*/
      margin-top: 16px;
      font-size: 18px;
      font-weight: 700;
    }

    .empty-checkout { /* Empty cart message: "Dein Warenkorb ist leer.*/
      color: #585858;
      padding: 20px 0;
      font-size: 16px;
    }

    .checkout-form {
      display: block;
    }

    .form-group {
      margin-bottom: 18px;
    }

    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }

    .form-group label {
      display: block;
      font-weight: 600;
      margin-bottom: 8px;
    }

    .form-group input {
      width: 100%;
      height: 52px;
      border: 1px solid #d8d8d8;
      border-radius: 12px;
      padding: 0 14px;
      font-size: 16px;
      outline: none;
      transition: 0.2s ease;
    }

    .form-group input:focus {
      /*border-color: #0066cc; */
      outline: 2px solid #0066cc;   
    }

    .form-group input.error { /* Error state for form inputs */
      border-color: #d11a2a;
      background: #fff5f5;
    }

    .error-message {
      display: block;
      min-height: 18px;
      margin-top: 6px;
      color: #d11a2a;
      font-size: 13px;
    }

    .pay-now-btn {
      width: 100%;
      height: 54px;
      border: none;
      border-radius: 14px;
      background: #111;
      color: #fff;
      font-size: 17px;
      font-weight: 700;
      cursor: pointer;
      margin-top: 10px;
    }

    .pay-now-btn:hover {
      opacity: 0.92;
    }

    @media (max-width: 960px) {
      .checkout-container {
        grid-template-columns: 1fr;
      }

      .form-row {
        grid-template-columns: 1fr;
      }

      .checkout-cart-item {
        flex-direction: column;
      }

      .checkout-item-price {
        text-align: left;
      }
    }

    /* RESPONSIVE*/
    @media (max-width: 1024px) {
  .checkout-container {
    grid-template-columns: 1fr;
  }

  .checkout-products,
  .checkout-form-wrap {
    padding: 24px;
  }

  .checkout-products h2,
  .checkout-form-wrap h2 {
    font-size: 28px;
  }

  .checkout-product-info h3,
  .checkout-product-info p {
    font-size: 18px;
  }

  .summary-row.total {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .checkout-page {
    padding: 40px 0;
  }

  .checkout-container {
    width: 92%;
    gap: 24px;
  }

  .form-row,
  .form-row:last-of-type {
    grid-template-columns: 1fr;
  }

  .checkout-product-item {
    align-items: flex-start;
  }

  .checkout-product-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .checkout-products h2,
  .checkout-form-wrap h2 {
    font-size: 24px;
  }

  .form-group label {
    font-size: 16px;
  }

  .form-group input,
  .form-group select {
    height: 52px;
    font-size: 16px;
  }

  .pay-now-btn {
    height: 54px;
    font-size: 18px;
  }
}