/**
 * Knuffelbijen Checkout Form Styles
 *
 * Dedicated CSS for checkout address forms.
 * All styles namespaced under .knuff-checkout to prevent conflicts.
 *
 * Color Palette (from style.css):
 * - Primary Orange:    #e67a3a
 * - Dark Orange:       #a63a1a
 * - Light Orange:      #f94 / #ff9944
 * - Red Accent:        #d52
 * - Error Red:         #dc3545
 * - Text Dark:         #333
 * - Text Medium:       #555
 * - Text Light:        #666
 * - Placeholder:       #999
 * - Background Light:  #f8f8f8, #f9f9f9, #fafafa
 * - Highlight Orange:  #fff4e4
 */

/* ==========================================================================
   MAIN CONTAINER
   ========================================================================== */

.knuff-checkout {
  max-width: 700px;
  margin: 0 auto;
}

.knuff-checkout *,
.knuff-checkout *::before,
.knuff-checkout *::after {
  box-sizing: border-box;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.knuff-checkout .kc-header {
  text-align: center;
  margin-bottom: 25px;
}

.knuff-checkout .kc-header h3 {
  margin: 0 0 10px 0;
  font-size: 20px;
  color: #333;
}

.knuff-checkout .kc-header .kc-notice {
  color: red;
  font-size: 14px;
  margin: 0;
}

/* ==========================================================================
   ERROR CONTAINER
   ========================================================================== */

.knuff-checkout #field_errors {
  display: none;
  background: #fff4e4;
  border: 1px solid #e67a3a;
  border-radius: 4px;
  padding: 15px 20px;
  margin-bottom: 20px;
  color: #a63a1a;
  line-height: 1.6;
}

.knuff-checkout #field_errors b {
  color: #d52;
}

/* ==========================================================================
   FORM LAYOUT
   ========================================================================== */

.knuff-checkout .kc-form {
  margin-bottom: 20px;
}

.knuff-checkout .kc-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #a63a1a;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #e67a3a;
}

.knuff-checkout .kc-section-title.is-hidden {
  display: none;
}

/* ==========================================================================
   FORM ROWS - FLEXBOX 2-COLUMN GRID
   ========================================================================== */

.knuff-checkout .kc-row {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
}

.knuff-checkout .kc-field {
  flex: 1;
  min-width: 0; /* Prevent flex items from overflowing */
}

/* ==========================================================================
   LABELS
   ========================================================================== */

.knuff-checkout .kc-field label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.knuff-checkout .kc-field label .required {
  color: red;
  margin-left: 2px;
}

.knuff-checkout .kc-field.kc-field--optional label {
  font-weight: 400;
  color: #666;
}

/* ==========================================================================
   INPUTS & SELECTS
   ========================================================================== */

.knuff-checkout .kc-field input[type="text"],
.knuff-checkout .kc-field input[type="email"],
.knuff-checkout .kc-field input[type="tel"],
.knuff-checkout .kc-field select {
  width: 100%;
  padding: 8px 10px;
  font-size: 15px;
  color: #a63a1a;
  background-color: #fff;
  border: 1px solid #e67a3a;
  border-radius: 4px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.knuff-checkout .kc-field input::placeholder {
  color: #999;
  font-size: 14px;
}

.knuff-checkout .kc-field input:focus,
.knuff-checkout .kc-field select:focus {
  outline: none;
  border-color: #a63a1a;
  box-shadow: 0 0 0 2px rgba(230, 122, 58, 0.25);
}

.knuff-checkout .kc-field input.field_error,
.knuff-checkout .kc-field select.field_error {
  border-color: #dc3545;
  background-color: #fff4e4;
}

/* Override legacy margin from style.css */
.knuff-checkout #billing_address_2,
.knuff-checkout #shipping_address_2,
.knuff-checkout #nalevering_address_2 {
  margin-left: 0 !important;
}

/* Select dropdown arrow */
.knuff-checkout .kc-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e67a3a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.knuff-checkout .kc-field select option {
  color: #e67a3a;
  background-color: #fff;
  padding: 8px;
}

/* ==========================================================================
   ADDRESS TOGGLE (CHECKBOX)
   ========================================================================== */

.knuff-checkout .kc-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 15px 0;
  cursor: pointer;
}

.knuff-checkout .kc-toggle:hover span {
  color: #a63a1a;
}

.knuff-checkout .kc-toggle img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.knuff-checkout .kc-toggle span {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
}

.knuff-checkout .kc-toggle input[type="checkbox"] {
  display: none;
}

/* ==========================================================================
   COLLAPSIBLE ADDRESS SECTIONS
   ========================================================================== */

.knuff-checkout .shipping_address,
.knuff-checkout .nalevering_address {
  display: none;
  margin-top: 15px;
}

.knuff-checkout .shipping_address.is-visible,
.knuff-checkout .nalevering_address.is-visible {
  display: block;
}

/* ==========================================================================
   HOE GEVONDEN SECTION
   ========================================================================== */

.knuff-checkout .kc-hoegevonden {
  margin-top: 25px;
  padding: 20px 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.knuff-checkout .kc-hoegevonden .kc-section-title {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 15px;
}

.knuff-checkout .kc-hoegevonden ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.knuff-checkout .kc-hoegevonden li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  padding: 0;
  width: auto;
}

.knuff-checkout .kc-hoegevonden li:hover {
  color: #a63a1a;
}

.knuff-checkout .kc-hoegevonden li img {
  width: 20px;
  height: 20px;
}

.knuff-checkout .kc-hoegevonden li input[type="text"] {
  width: 140px;
  padding: 6px 8px;
  font-size: 14px;
  color: #a63a1a;
  border: 1px solid #e67a3a;
  border-radius: 4px;
}

.knuff-checkout .kc-hoegevonden li input[type="text"]:focus {
  outline: none;
  border-color: #a63a1a;
}

/* ==========================================================================
   ACCOUNT CREATION SECTION
   ========================================================================== */

.knuff-checkout .kc-create-account {
  margin-top: 20px;
}

.knuff-checkout .kc-create-account p.create-account {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin: 0;
}

.knuff-checkout .kc-create-account .create-account {
  margin-top: 15px;
  padding: 15px;
  background: #f8f8f8;
  border-radius: 4px;
}

/* ==========================================================================
   RESPONSIVE - MOBILE
   ========================================================================== */

@media screen and (max-width: 600px) {
  .knuff-checkout {
    padding: 0 15px;
  }

  .knuff-checkout .kc-row {
    flex-direction: column;
    gap: 12px;
  }

  .knuff-checkout .kc-field input,
  .knuff-checkout .kc-field select {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .knuff-checkout .kc-toggle {
    flex-wrap: wrap;
  }

  .knuff-checkout .kc-hoegevonden ul {
    flex-direction: column;
    gap: 5px;
  }

  .knuff-checkout .kc-hoegevonden li input[type="text"] {
    width: 120px;
  }
}
