/* Shared address form styles (checkout modal + my account) */

#add-address-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#add-address-form div.col-span-2,
#add-address-form div.form-actions {
  grid-column: span 2;
}

#add-address-form div.form-divider {
  border-bottom: 1px solid #e0e0e0;
  padding: 8px;
}

.form-group {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9em;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: var(--wd-brd-radius, 6px);
  font-size: 1em;
  color: #333;
  background: #ffffff;
  min-height: 44px;
}

.form-group .select2-container {
  width: 100% !important;
}

.form-group .select2-container--default .select2-selection--single {
  display: flex;
  align-items: center;
  height: 44px;
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: var(--wd-brd-radius, 6px);
  font-size: 1em;
  color: #333;
  background: #ffffff;
  padding: 0 8px;
}

.form-group .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 42px;
  padding: 0;
}

.form-group .select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 50%;
  transform: translateY(-50%);
  height: auto;
}

.form-group input:focus,
.form-group select:focus,
.form-group .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--wd-primary-color, #83b735);
  background: #ffffff;
  outline: none;
  box-shadow: 0 0 0 1px var(--wd-primary-color, #83b735);
}

.form-group .required {
  color: #e53e3e;
  text-decoration: none;
}

.error-message {
  color: #e53e3e;
  font-size: 0.85em;
  margin-top: 4px;
  display: block;
  min-height: 0;
}

.form-group.error input,
.form-group.error select,
.form-group.error .select2-container--default .select2-selection--single {
  border-color: #e53e3e;
  background: #fff5f5;
  box-shadow: none;
}

.form-group.error .error-message {
  display: block !important;
}

.customer-type-group {
  margin-bottom: 0;
}

.customer-type-options {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-type-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  font-weight: 500;
  color: #333;
  flex: 1 1 140px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #e0e0e0;
  border-radius: var(--wd-brd-radius, 6px);
  background: transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.customer-type-option:has(input:checked),
.customer-type-option.is-selected {
  border-color: var(--wd-primary-color, #83b735);
  background: transparent;
  color: #1a1a1a;
}

.customer-type-option input[type="radio"] {
  width: auto;
  min-height: auto;
  margin: 0;
  padding: 0;
  accent-color: var(--wd-primary-color, #83b735);
  box-shadow: none;
}

.dir-ltr {
  direction: ltr;
  text-align: left;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.address-form-container {
  background: transparent;
  padding: 0;
  border: none;
  border-radius: 0;
}

@media (max-width: 768px) {
  #add-address-form {
    grid-template-columns: 1fr;
  }

  #add-address-form div.col-span-2,
  #add-address-form div.form-actions {
    grid-column: span 1;
  }

  .customer-type-option {
    flex: 1 1 100%;
  }
}
