/* address-fields.css — estilo de los campos de Contacto + Dirección,
   compartido entre el checkout y /cuenta. Selectores por clase para que
   sirva a cualquier formulario (no depende de IDs concretos). */

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.field {
  display: grid;
  gap: 6px;
  padding: 15px 0 14px;
}
.field[hidden] { display: none; }
.field--full { grid-column: 1 / -1; }

.field label {
  color: var(--muted);
  font-weight: 700;
  font-size: .78rem;
  text-transform: none;
  letter-spacing: .01em;
}
.field label .opt {
  font-weight: 500;
  color: #aab0ba;
  font-size: .74rem;
  margin-left: 4px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1.5px solid rgba(17,19,21,.14);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--ui);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .01em;
  outline: none;
  min-height: 40px;
  transition: border-bottom-color .32s cubic-bezier(.4,0,.2,1), border-bottom-width .32s cubic-bezier(.4,0,.2,1), padding-bottom .32s cubic-bezier(.4,0,.2,1);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-bottom-width: 2.5px;
  border-bottom-color: #424242;
  padding-bottom: 6.5px;
  box-shadow: none;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #b8c0cc;
  font-weight: 500;
}
.field input:disabled,
.field select:disabled {
  color: #9aa3af;
  cursor: not-allowed;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2368707f' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 22px;
  cursor: pointer;
}

/* Error (accesible pero oculto visualmente el texto) */
.field-error {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.field.field--province .field-error { display: none; min-height: 0; margin-top: 0; }
.field.field--error label { color: #dc2626; }
.field.field--error input,
.field.field--error select,
.field.field--error textarea {
  border-bottom-color: #e05555 !important;
  background-image: linear-gradient(#e05555, #e05555);
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: left bottom;
}
.field.field--error input::placeholder,
.field.field--error textarea::placeholder { color: #e28a8a; opacity: 1; }
.field.field--valid input,
.field.field--valid select {
  border-bottom-color: #16a34a;
  border-bottom-width: 2.5px;
}

/* Aviso de geolocalización del CP */
.geo-disclaimer {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(180,83,9,.18);
  background: rgba(245,158,11,.08);
  color: #92400e;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.45;
}

/* Email con check de validez */
.field--email-wrap { position: relative; }
.field--email-wrap .email-check {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: #22c55e;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.field--email-wrap.is-valid .email-check { opacity: 1; }

/* Prefijo + número de teléfono */
.phone-group {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  border: 0;
  background: transparent;
  min-height: 40px;
  overflow: visible;
}
.phone-group input:not(.phone-prefix) {
  padding-left: 10px;
  flex: 1;
  min-width: 0;
  border: 0;
  border-bottom: 1.5px solid rgba(17,19,21,.14);
  border-radius: 0;
  background: transparent;
  min-height: 0;
  line-height: 1.25;
}
.phone-group input:not(.phone-prefix):focus {
  outline: none;
  border-bottom-width: 2.5px;
  border-bottom-color: #424242;
  box-shadow: none;
}
.phone-prefix {
  width: auto;
  min-width: 48px;
  max-width: 64px;
  padding: 8px 8px 8px 0 !important;
  border: 0 !important;
  border-bottom: 1.5px solid rgba(17,19,21,.14) !important;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--ui);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .01em;
  outline: none;
  text-align: center;
  flex: 0 0 auto;
  min-height: 0;
  line-height: 1.25;
  transition: border-bottom-color .32s cubic-bezier(.4,0,.2,1), border-bottom-width .32s cubic-bezier(.4,0,.2,1);
}
.phone-prefix:focus {
  color: var(--ink);
  outline: none;
  border-bottom-width: 2.5px;
  border-bottom-color: #424242;
}
