/* ============================================
   BFM Store — Mi cuenta / Login (frontend)
   Pantallas clásicas de WooCommerce (shortcode [woocommerce_my_account]):
   login/registro, recuperar contraseña y el área logueada (dashboard,
   pedidos, direcciones, editar cuenta). Encolado on-demand por is_account_page().
   Reutiliza tokens de tokens.css y replica los formularios del prototipo
   (.field / .btn). Todo bajo body.bfm-store.
   ============================================ */

/* ============================================================
   1. AUTH — Login / Registro / Recuperar (split-screen de marca)
   ============================================================ */
.bfm-store .bfm-auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  min-height: 540px;
  max-width: 980px;
  margin: 40px auto 80px;
  background: #fff;
  border: 1px solid var(--bfm-line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
  overflow: hidden;
}
/* Variante centrada sin panel de marca (recuperar contraseña) */
.bfm-store .bfm-auth--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 460px;
}

/* ---------- Panel de marca (azul, con destello como el .hero/.newsletter) ---------- */
.bfm-store .bfm-auth__brand {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 48px 40px;
  background: var(--bfm-deep);
  color: #fff;
  overflow: hidden;
}
.bfm-store .bfm-auth__brand::before {
  content: '';
  position: absolute;
  right: -160px;
  top: -160px;
  width: 460px;
  height: 460px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(180, 186, 200, 0.14), transparent 60%);
}
.bfm-store .bfm-auth__brand-inner { position: relative; z-index: 1; }
.bfm-store .bfm-auth__logo {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.bfm-store .bfm-auth__claim {
  margin: 0;
  max-width: 320px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--bfm-grey-blue);
}

/* ---------- Columna del formulario ---------- */
.bfm-store .bfm-auth__main {
  display: flex;
  flex-direction: column;
  padding: 44px 44px 48px;
}
.bfm-store .bfm-auth__title {
  margin: 0 0 22px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--bfm-deep);
}

/* ---------- Pestañas CSS-only (sin JS) ---------- */
.bfm-store .bfm-auth__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bfm-store .bfm-auth__tabs {
  display: flex;
  gap: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--bfm-line);
}
.bfm-store .bfm-auth__tab {
  padding: 0 0 14px;
  margin-bottom: -1px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bfm-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.bfm-store .bfm-auth__tab:hover { color: var(--bfm-deep); }

/* Visibilidad de paneles: sin pestañas se ve el login; con pestañas, el seleccionado */
.bfm-store .bfm-auth__pane { display: block; }
.bfm-store .bfm-auth--tabs .bfm-auth__pane { display: none; }
.bfm-store .bfm-auth--tabs #bfm-tab-login:checked ~ .bfm-auth__panes .bfm-auth__pane--login,
.bfm-store .bfm-auth--tabs #bfm-tab-register:checked ~ .bfm-auth__panes .bfm-auth__pane--register {
  display: block;
}
/* Pestaña activa */
.bfm-store .bfm-auth--tabs #bfm-tab-login:checked ~ .bfm-auth__tabs .bfm-auth__tab--login,
.bfm-store .bfm-auth--tabs #bfm-tab-register:checked ~ .bfm-auth__tabs .bfm-auth__tab--register {
  color: var(--bfm-deep);
  border-bottom-color: var(--bfm-deep);
}
/* Con pestañas, el <h2> de cada panel sobra (la pestaña ya titula) */
.bfm-store .bfm-auth--tabs .bfm-auth__title { display: none; }

/* WooCommerce core enmarca form.login/register con borde+padding: lo anulamos
   (la tarjeta .bfm-auth ya es el marco) */
.bfm-store .bfm-auth form.login,
.bfm-store .bfm-auth form.register,
.bfm-store .bfm-auth form.woocommerce-ResetPassword {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
}

/* ---------- Campos (calcados de .field del prototipo) ---------- */
.bfm-store .bfm-auth .woocommerce-form-row,
.bfm-store .bfm-auth .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 18px;
}
/* En la tarjeta de auth todos los campos van a ancho completo (WC pone
   form-row-first/last al 47% con float) */
.bfm-store .bfm-auth .form-row-first,
.bfm-store .bfm-auth .form-row-last,
.bfm-store .bfm-auth .form-row-wide {
  width: 100%;
  float: none;
}
.bfm-store .bfm-auth label {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bfm-ink-2);
  font-weight: 700;
}
.bfm-store .bfm-auth input[type="text"],
.bfm-store .bfm-auth input[type="email"],
.bfm-store .bfm-auth input[type="password"] {
  width: 100%;
  border: 1px solid var(--bfm-line-strong);
  background: #fff;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--bfm-ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bfm-store .bfm-auth input:focus {
  border-color: var(--bfm-deep);
  box-shadow: 0 0 0 3px rgba(3, 23, 71, 0.08);
}
.bfm-store .bfm-auth .required { color: var(--bfm-muted); }

/* Hint (mensaje de registro/recuperación) */
.bfm-store .bfm-auth__hint {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--bfm-muted);
}

/* Fila de envío: recordarme + botón */
.bfm-store .bfm-auth__row-submit {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 4px 0 0;
}
.bfm-store .bfm-auth .woocommerce-form-login__rememberme {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--bfm-ink-2);
  cursor: pointer;
}
.bfm-store .bfm-auth .woocommerce-form-login__rememberme input { width: auto; }

/* Botón primario (.btn.lg del prototipo) */
.bfm-store .bfm-auth .btn {
  width: 100%;
  border: 1px solid var(--bfm-deep);
  background: var(--bfm-deep);
  color: #fff;
  padding: 15px 28px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.bfm-store .bfm-auth .btn:hover {
  background: var(--bfm-deep-2);
  border-color: var(--bfm-deep-2);
}

/* Enlace "¿Olvidaste tu contraseña?" */
.bfm-store .bfm-auth .lost_password {
  margin: 14px 0 0;
  font-size: 13px;
}
.bfm-store .bfm-auth .lost_password a { color: var(--bfm-muted); }
.bfm-store .bfm-auth .lost_password a:hover { color: var(--bfm-deep); }

/* ============================================================
   2. Avisos de WooCommerce en Mi cuenta
   El estilo de los avisos (.woocommerce-message/-info/-error) está unificado
   para todo el sitio en woocommerce.css (se encola también en cuenta). Acá solo
   queda el ajuste de separación propio del layout de cuenta.
   ============================================================ */
.bfm-store.woocommerce-account .woocommerce-notices-wrapper { margin-bottom: 8px; }

/* ============================================================
   3. ÁREA LOGUEADA — Mi cuenta (nav lateral + contenido)
   ============================================================ */
.bfm-store .bfm-account {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin: 8px 0 80px;
}
/* WooCommerce core pone float + width:30%/70% a estas columnas: lo anulamos
   para que respeten la grilla .bfm-account */
.bfm-store .bfm-account .woocommerce-MyAccount-navigation,
.bfm-store .bfm-account .woocommerce-MyAccount-content {
  width: auto;
  float: none;
  margin: 0;
}

/* ---------- Navegación lateral ---------- */
.bfm-store .woocommerce-MyAccount-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bfm-store .woocommerce-MyAccount-navigation li { margin: 0; }
.bfm-store .woocommerce-MyAccount-navigation li a {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--bfm-ink-2);
  text-decoration: none;
  border-radius: var(--r-sm);
}
.bfm-store .woocommerce-MyAccount-navigation li a:hover {
  background: var(--bfm-soft);
  color: var(--bfm-deep);
}
.bfm-store .woocommerce-MyAccount-navigation li.is-active a {
  background: var(--bfm-deep);
  color: #fff;
  font-weight: 500;
}

/* ---------- Contenido ---------- */
.bfm-store .woocommerce-MyAccount-content { min-width: 0; }
.bfm-store .woocommerce-MyAccount-content h2,
.bfm-store .woocommerce-MyAccount-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--bfm-deep);
  margin-top: 0;
}
.bfm-store .woocommerce-MyAccount-content p { color: var(--bfm-ink-2); line-height: 1.65; }
.bfm-store .woocommerce-MyAccount-content a { color: var(--bfm-deep); }

/* Welcome card del dashboard */
.bfm-store .bfm-account__welcome {
  margin-bottom: 28px;
  padding: 22px 24px;
  background: var(--bfm-soft);
  border: 1px solid var(--bfm-line);
  border-radius: var(--r-sm);
}
.bfm-store .bfm-account__welcome p { margin: 0 0 8px; font-size: 14px; }
.bfm-store .bfm-account__welcome p:last-child { margin-bottom: 0; }

/* ---------- Tablas (pedidos, descargas) ---------- */
.bfm-store .woocommerce-MyAccount-content table.shop_table,
.bfm-store .woocommerce-MyAccount-content table.woocommerce-orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 0 0 24px;
}
.bfm-store .woocommerce-MyAccount-content .shop_table th {
  text-align: left;
  padding: 10px 12px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bfm-muted);
  border-bottom: 1px solid var(--bfm-line-strong);
}
.bfm-store .woocommerce-MyAccount-content .shop_table td {
  padding: 12px;
  border-bottom: 1px solid var(--bfm-line);
  color: var(--bfm-ink-2);
}

/* ---------- Botones dentro del contenido ---------- */
.bfm-store .woocommerce-MyAccount-content .button,
.bfm-store .woocommerce-MyAccount-content .woocommerce-button {
  display: inline-block;
  background: var(--bfm-deep);
  color: #fff;
  border: 1px solid var(--bfm-deep);
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.bfm-store .woocommerce-MyAccount-content .button:hover,
.bfm-store .woocommerce-MyAccount-content .woocommerce-button:hover { background: var(--bfm-deep-2); }

/* ---------- Formularios de cuenta (editar cuenta / direcciones) ---------- */
.bfm-store .woocommerce-MyAccount-content form .woocommerce-form-row,
.bfm-store .woocommerce-MyAccount-content form p.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 16px;
}
.bfm-store .woocommerce-MyAccount-content form label {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bfm-ink-2);
  font-weight: 700;
}
.bfm-store .woocommerce-MyAccount-content form input[type="text"],
.bfm-store .woocommerce-MyAccount-content form input[type="email"],
.bfm-store .woocommerce-MyAccount-content form input[type="tel"],
.bfm-store .woocommerce-MyAccount-content form input[type="password"],
.bfm-store .woocommerce-MyAccount-content form select {
  width: 100%;
  border: 1px solid var(--bfm-line-strong);
  background: #fff;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--bfm-ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bfm-store .woocommerce-MyAccount-content form input:focus,
.bfm-store .woocommerce-MyAccount-content form select:focus {
  border-color: var(--bfm-deep);
  box-shadow: 0 0 0 3px rgba(3, 23, 71, 0.08);
}
.bfm-store .woocommerce-MyAccount-content fieldset {
  margin: 24px 0 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--bfm-line);
  padding-top: 20px;
}
.bfm-store .woocommerce-MyAccount-content fieldset legend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--bfm-deep);
  padding: 0;
}

/* ============================================================
   4. Ocultar el título de página del tema en /mi-cuenta/
   (el contexto lo dan el split-screen o la nav lateral)
   ============================================================ */
.bfm-store.woocommerce-account .page-header,
.bfm-store.woocommerce-account header.page-header,
.bfm-store.woocommerce-account .elementor-page-title { display: none; }

/* ============================================================
   5. Responsive
   ============================================================ */
@media (max-width: 860px) {
  .bfm-store .bfm-auth {
    grid-template-columns: 1fr;
    max-width: 460px;
  }
  /* El panel de marca pasa a banner superior compacto */
  .bfm-store .bfm-auth__brand {
    align-items: flex-start;
    padding: 28px;
  }
  .bfm-store .bfm-auth__brand::before { width: 280px; height: 280px; right: -120px; top: -120px; }
  .bfm-store .bfm-auth__claim { max-width: none; }
  .bfm-store .bfm-auth__main { padding: 32px 28px 36px; }

  .bfm-store .bfm-account {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .bfm-store .woocommerce-MyAccount-navigation {
    border-bottom: 1px solid var(--bfm-line);
    padding-bottom: 8px;
  }
}
