/* Checkout: una única etiqueta y sin campo de tratamiento. */
body.page-order #checkout-personal-information-step .step__title .page-title-section,
body#checkout #checkout-personal-information-step .step__title .page-title-section {
  font-size: 0 !important;
}

body.page-order #checkout-personal-information-step .step__title .page-title-section::after,
body#checkout #checkout-personal-information-step .step__title .page-title-section::after {
  content: "Datos personales" !important;
  font-size: 18px !important;
}

/* El tratamiento no se solicita en ninguna vista pública: registro, cuenta o checkout. */
html body.page-order #customer-form [aria-labelledby="field-id_gender-label"],
html body#checkout #customer-form [aria-labelledby="field-id_gender-label"],
body.page-order #customer-form .mb-3:has(> [aria-labelledby="field-id_gender-label"]),
body#checkout #customer-form .mb-3:has(> [aria-labelledby="field-id_gender-label"]),
body .mb-3:has(> [aria-labelledby="field-id_gender-label"]),
body [aria-labelledby="field-id_gender-label"],
body label[for="field-id_gender"],
body .form-group:has(input[name="id_gender"]) {
  display: none !important;
}

/* Cuenta opcional en compra como invitado: un único control estable, sin
   foco automático que haga saltar o ampliar la vista en móviles. */
body.page-order .fa-checkout-create-account,
body#checkout .fa-checkout-create-account { margin: 18px 0 0; }

body.page-order .fa-checkout-create-account__toggle,
body#checkout .fa-checkout-create-account__toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

body.page-order .fa-checkout-create-account__icon,
body#checkout .fa-checkout-create-account__icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  transition: transform .18s ease;
}

body.page-order .fa-checkout-create-account.is-expanded .fa-checkout-create-account__icon,
body#checkout .fa-checkout-create-account.is-expanded .fa-checkout-create-account__icon { transform: rotate(45deg); }

body.page-order .fa-checkout-create-account__help,
body#checkout .fa-checkout-create-account__help {
  display: none;
  margin: 8px 0 0 31px;
  color: #5b6879;
  font-size: 13px;
  line-height: 1.45;
}

body.page-order .fa-checkout-create-account.is-expanded .fa-checkout-create-account__help,
body#checkout .fa-checkout-create-account.is-expanded .fa-checkout-create-account__help { display: block; }

/* Cliente ya identificado: Hummingbird renderiza estos dos párrafos fuera del
   formulario. Al regresar desde Dirección quedaban con el estilo base del
   navegador, por lo que se integran en una tarjeta de sesión coherente con el
   resto del paso. */
body.page-order #checkout-personal-information-step .identity,
body#checkout #checkout-personal-information-step .identity {
  margin: 0;
  padding: 16px 18px 8px;
  border: 1px solid #d9e2ec;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #f7f9fc;
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
}

body.page-order #checkout-personal-information-step .identity + p,
body#checkout #checkout-personal-information-step .identity + p {
  margin: 0 0 18px;
  padding: 0 18px 16px;
  border: 1px solid #d9e2ec;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: #f7f9fc;
  color: #5b6879;
  font-size: 13px;
  line-height: 1.5;
}

body.page-order #checkout-personal-information-step .identity a,
body.page-order #checkout-personal-information-step .identity + p a,
body#checkout #checkout-personal-information-step .identity a,
body#checkout #checkout-personal-information-step .identity + p a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

body.page-order #checkout-personal-information-step .identity + p a:hover,
body#checkout #checkout-personal-information-step .identity + p a:hover {
  text-decoration: underline;
}

/* El estado de sesión llega del core como tres párrafos independientes. Se
   agrupan visualmente en una única tarjeta para que el paso no parezca una
   pieza de PrestaShop sin integrar. :has() solo se activa para el cliente
   identificado y no altera los formularios de acceso o compra como invitado. */
body.page-order #checkout-personal-information-step .step__content:has(> .step__account),
body#checkout #checkout-personal-information-step .step__content:has(> .step__account) {
  display: block !important;
  margin: 0 0 18px !important;
  padding: 22px 24px !important;
  border: 1px solid #dbe5f0 !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #f7faff 0%, #fff 72%) !important;
  box-shadow: 0 8px 22px rgba(17, 48, 88, .06) !important;
}

body.page-order #checkout-personal-information-step .step__content:has(> .step__account)::before,
body#checkout #checkout-personal-information-step .step__content:has(> .step__account)::before {
  content: "Sesión iniciada";
  display: block;
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

body.page-order #checkout-personal-information-step .step__content:has(> .step__account) > .step__account > p,
body#checkout #checkout-personal-information-step .step__content:has(> .step__account) > .step__account > p {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.page-order #checkout-personal-information-step .step__content:has(> .step__account) > .step__account > p:first-child,
body#checkout #checkout-personal-information-step .step__content:has(> .step__account) > .step__account > p:first-child {
  margin-bottom: 8px !important;
  color: var(--dark) !important;
  font-size: 15px !important;
  font-weight: 600;
}

body.page-order #checkout-personal-information-step .step__content:has(> .step__account) > .step__account > p:nth-child(2),
body#checkout #checkout-personal-information-step .step__content:has(> .step__account) > .step__account > p:nth-child(2) {
  margin-bottom: 12px !important;
  color: #42526a !important;
  font-size: 14px !important;
}

body.page-order #checkout-personal-information-step .step__content:has(> .step__account) > .step__account > p:nth-child(3),
body#checkout #checkout-personal-information-step .step__content:has(> .step__account) > .step__account > p:nth-child(3) {
  color: #64748b !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

body.page-order #checkout-personal-information-step .step__content:has(> .step__account) #checkout-continue-form,
body#checkout #checkout-personal-information-step .step__content:has(> .step__account) #checkout-continue-form {
  margin-top: 20px !important;
}

@media (max-width: 767px) {
  body.page-order #checkout-personal-information-step .step__content:has(> .step__account),
  body#checkout #checkout-personal-information-step .step__content:has(> .step__account) {
    padding: 20px !important;
  }
}

.fa-checkout-password-is-hidden { display: none !important; }

/* Safari amplía al enfocar un input cuyo tamaño calculado sea menor de 16 px.
   El selector específico cubre el campo que se revela al crear cuenta durante
   el checkout, incluso si una regla del tema padre intenta compactarlo. */
@media (max-width: 767px) {
  body.page-order #checkout-guest-form input[name="password"],
  body#checkout #checkout-guest-form input[name="password"] {
    font-size: 16px !important;
  }
}
