/* =========================================================
   Latin Dance Festival El Salvador — Mi cuenta
   Rediseña: Escritorio, Direcciones, Detalles de la cuenta
   (Pedidos y Descargas no se tocan; solo comparten el contenedor
   y el menú lateral.)
   Ubicación: /wp-content/themes/TU-CHILD-THEME/ldf-mi-cuenta.css
   ========================================================= */

/* ---------- Variables (ajusta aquí los colores) ---------- */
body.woocommerce-account.logged-in {
  --ldf-gold: #f3c24f;
  --ldf-orange: #ff7a45;
  --ldf-coral: #f4603f;
  --ldf-text: #f6f0ea;
  --ldf-muted: #b8aebf;
  --ldf-surface: rgba(255, 255, 255, 0.04);
  --ldf-surface-2: rgba(8, 5, 14, 0.55);
  --ldf-line: rgba(243, 194, 79, 0.18);
  --ldf-line-strong: rgba(243, 194, 79, 0.45);
  --ldf-radius: 14px;
  --ldf-display: "Playfair Display", Georgia, serif;
}

/* ---------- Estructura: contenido a la izquierda, menú a la derecha ---------- */
body.woocommerce-account.logged-in .woocommerce {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  column-gap: clamp(24px, 4vw, 64px);
  row-gap: 0;
  align-items: start;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
  box-sizing: border-box;
}
body.woocommerce-account.logged-in .woocommerce::before,
body.woocommerce-account.logged-in .woocommerce::after {
  display: none;
}
body.woocommerce-account.logged-in .woocommerce-notices-wrapper {
  grid-column: 1 / -1;
  grid-row: 1;
}
body.woocommerce-account.logged-in .woocommerce-MyAccount-content {
  grid-column: 1;
  grid-row: 2;
  float: none;
  width: auto;
  min-width: 0;
  margin: 0;
  color: var(--ldf-text);
}
body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation {
  grid-column: 2;
  grid-row: 2;
  float: none;
  width: auto;
  margin: 0;
}

/* ---------- Menú lateral ---------- */
body.woocommerce-account .woocommerce-MyAccount-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
body.woocommerce-account .woocommerce-MyAccount-navigation li {
  margin: 0;
  padding: 0;
  border: 0;
}
body.woocommerce-account .woocommerce-MyAccount-navigation li a {
  position: relative;
  display: block;
  padding: 13px 48px 13px 18px !important;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ldf-gold);
  font-weight: 500;
  text-decoration: none;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
/* El icono queda siempre dentro de la caja (antes se cortaba en el borde) */
body.woocommerce-account .woocommerce-MyAccount-navigation li a::before {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  float: none;
  margin: 0;
  opacity: 0.7;
}
body.woocommerce-account .woocommerce-MyAccount-navigation li a:hover {
  background: rgba(243, 194, 79, 0.08);
}
body.woocommerce-account .woocommerce-MyAccount-navigation li a:focus-visible {
  outline: 2px solid var(--ldf-gold);
  outline-offset: 2px;
}
body.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
  background: rgba(243, 194, 79, 0.12);
  border-color: var(--ldf-line-strong);
  color: #fff;
}
body.woocommerce-account
  .woocommerce-MyAccount-navigation
  li.is-active
  a::before,
body.woocommerce-account .woocommerce-MyAccount-navigation li a:hover::before {
  opacity: 1;
}

/* ---------- Escritorio ---------- */
.ldf-dash__head {
  margin-bottom: 28px;
}
.ldf-dash__hello {
  margin: 0 0 6px;
  font-family: var(--ldf-display);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  color: var(--ldf-text);
}
.ldf-dash__logout {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ldf-muted);
}
.ldf-dash__logout a {
  color: var(--ldf-gold);
}
.ldf-dash__intro {
  margin: 20px 0 0;
  max-width: 56ch;
  color: var(--ldf-muted);
  line-height: 1.6;
}

/* ---------- Direcciones (listado) ---------- */
body.woocommerce-edit-address .woocommerce-MyAccount-content > p {
  margin: 0 0 28px;
  color: var(--ldf-muted);
  line-height: 1.6;
}
.ldf-addresses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.ldf-address {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  padding: 28px;
  background: var(--ldf-surface);
  border: 1px solid var(--ldf-line);
  border-radius: var(--ldf-radius);
}
.ldf-address__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ldf-address__title {
  margin: 0;
  font-family: var(--ldf-display);
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--ldf-text);
}
.ldf-address__edit {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--ldf-line-strong);
  border-radius: 999px;
  color: var(--ldf-gold);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
}
.ldf-address__edit:hover,
.ldf-address__edit:focus-visible {
  background: var(--ldf-gold);
  color: #1a1020;
}
.ldf-address__body {
  margin: 0;
  padding: 18px 20px;
  background: var(--ldf-surface-2);
  border-radius: 10px;
  color: var(--ldf-text);
  font-style: normal;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.ldf-address__body--empty {
  color: var(--ldf-muted);
}

/* ---------- Formularios: Detalles de la cuenta y editar dirección ---------- */
body:is(.woocommerce-edit-account, .woocommerce-edit-address)
  .woocommerce-MyAccount-content
  form
  :is(h2, h3) {
  margin: 0 0 20px;
  font-family: var(--ldf-display);
  font-size: 1.5rem;
  color: var(--ldf-text);
}

/* Rejilla de 2 columnas */
body.woocommerce-edit-account .woocommerce-EditAccountForm,
body.woocommerce-edit-address .woocommerce-address-fields__field-wrapper {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
body.woocommerce-edit-account .woocommerce-EditAccountForm {
  padding: clamp(20px, 3vw, 32px);
  background: var(--ldf-surface);
  border: 1px solid var(--ldf-line);
  border-radius: var(--ldf-radius);
}
body.woocommerce-edit-account .woocommerce-EditAccountForm::before,
body.woocommerce-edit-account .woocommerce-EditAccountForm::after,
body.woocommerce-edit-address
  .woocommerce-address-fields__field-wrapper::before,
body.woocommerce-edit-address
  .woocommerce-address-fields__field-wrapper::after {
  display: none;
}
body.woocommerce-edit-account .woocommerce-EditAccountForm > *,
body.woocommerce-edit-address .woocommerce-address-fields__field-wrapper > * {
  grid-column: 1 / -1;
  float: none !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
}
body.woocommerce-edit-account .woocommerce-EditAccountForm > .form-row-first,
body.woocommerce-edit-address
  .woocommerce-address-fields__field-wrapper
  > .form-row-first {
  grid-column: 1;
}
body.woocommerce-edit-account .woocommerce-EditAccountForm > .form-row-last,
body.woocommerce-edit-address
  .woocommerce-address-fields__field-wrapper
  > .form-row-last {
  grid-column: 2;
}
body.woocommerce-edit-account .woocommerce-EditAccountForm > .clear {
  display: none;
}

/* Etiquetas y campos */
body:is(.woocommerce-edit-account, .woocommerce-edit-address)
  .woocommerce-MyAccount-content
  form
  label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ldf-text);
}
body:is(.woocommerce-edit-account, .woocommerce-edit-address)
  .woocommerce-MyAccount-content
  form
  .required {
  color: var(--ldf-orange);
  border: 0;
  text-decoration: none;
}
body:is(.woocommerce-edit-account, .woocommerce-edit-address)
  .woocommerce-MyAccount-content
  form
  :is(
    input.input-text,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    textarea,
    select
  ) {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ldf-text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  font: inherit;
  box-shadow: none;
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}
body:is(.woocommerce-edit-account, .woocommerce-edit-address)
  .woocommerce-MyAccount-content
  form
  :is(input, textarea, select):focus {
  outline: none;
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--ldf-gold);
  box-shadow: 0 0 0 3px rgba(243, 194, 79, 0.22);
}
body:is(.woocommerce-edit-account, .woocommerce-edit-address)
  .woocommerce-MyAccount-content
  form
  input::placeholder {
  color: rgba(184, 174, 191, 0.7);
}
body:is(.woocommerce-edit-account, .woocommerce-edit-address)
  .woocommerce-MyAccount-content
  form
  select
  option {
  background: #1b1226;
  color: var(--ldf-text);
}
/* Autocompletar del navegador (evita el fondo blanco) */
body:is(.woocommerce-edit-account, .woocommerce-edit-address)
  .woocommerce-MyAccount-content
  form
  input:-webkit-autofill {
  -webkit-text-fill-color: var(--ldf-text);
  caret-color: var(--ldf-text);
  box-shadow: 0 0 0 1000px #1b1226 inset;
}
/* Texto de ayuda bajo "Nombre visible" */
body.woocommerce-edit-account .woocommerce-EditAccountForm span > em {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  font-style: normal;
  color: var(--ldf-muted);
}

/* Cambio de contraseña */
body.woocommerce-edit-account .woocommerce-EditAccountForm fieldset {
  display: grid;
  gap: 18px;
  min-width: 0;
  margin: 6px 0 0;
  padding: 24px;
  background: var(--ldf-surface-2);
  border: 1px solid var(--ldf-line);
  border-radius: var(--ldf-radius);
}
body.woocommerce-edit-account .woocommerce-EditAccountForm fieldset legend {
  padding: 0 10px;
  font-family: var(--ldf-display);
  font-size: 1.15rem;
  color: var(--ldf-text);
}
body.woocommerce-edit-account .woocommerce-EditAccountForm fieldset > p {
  margin: 0;
}
body.woocommerce-edit-account .password-input {
  position: relative;
  display: block;
}
body.woocommerce-edit-account .password-input input {
  padding-right: 52px;
}
body.woocommerce-edit-account .show-password-input {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--ldf-muted);
  cursor: pointer;
}
body.woocommerce-edit-account .show-password-input:hover,
body.woocommerce-edit-account .show-password-input.display-password {
  color: var(--ldf-gold);
}

/* Botones de guardar */
body:is(.woocommerce-edit-account, .woocommerce-edit-address)
  .woocommerce-MyAccount-content
  form
  :is(button[name="save_account_details"], button[name="save_address"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  margin-top: 8px;
  padding: 0 34px;
  background: linear-gradient(100deg, var(--ldf-coral), var(--ldf-orange));
  color: #fff;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(244, 96, 63, 0.28);
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    filter 0.15s;
}
body:is(.woocommerce-edit-account, .woocommerce-edit-address)
  .woocommerce-MyAccount-content
  form
  :is(button[name="save_account_details"], button[name="save_address"]):hover {
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgba(244, 96, 63, 0.38);
}
body:is(.woocommerce-edit-account, .woocommerce-edit-address)
  .woocommerce-MyAccount-content
  form
  :is(button[name="save_account_details"], button[name="save_address"]):active {
  transform: translateY(1px);
}
body:is(.woocommerce-edit-account, .woocommerce-edit-address)
  .woocommerce-MyAccount-content
  form
  :is(
    button[name="save_account_details"],
    button[name="save_address"]
  ):focus-visible {
  outline: 2px solid var(--ldf-gold);
  outline-offset: 3px;
}

/* País / Departamento (select2 de WooCommerce) */
body.woocommerce-edit-address
  .select2-container--default
  .select2-selection--single {
  display: flex;
  align-items: center;
  height: 48px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}
body.woocommerce-edit-address
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  padding-left: 14px;
  line-height: normal;
  color: var(--ldf-text);
}
body.woocommerce-edit-address
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  top: 0;
  right: 8px;
  height: 46px;
}
body.woocommerce-edit-address
  .select2-container--default.select2-container--open
  .select2-selection--single,
body.woocommerce-edit-address
  .select2-container--default.select2-container--focus
  .select2-selection--single {
  border-color: var(--ldf-gold);
}
body.woocommerce-edit-address .select2-dropdown {
  background: #1b1226;
  color: var(--ldf-text);
  border: 1px solid var(--ldf-line-strong);
  border-radius: 10px;
  overflow: hidden;
}
body.woocommerce-edit-address .select2-search--dropdown .select2-search__field {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ldf-text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}
body.woocommerce-edit-address
  .select2-container--default
  .select2-results__option--highlighted,
body.woocommerce-edit-address
  .select2-container--default
  .select2-results__option--highlighted[aria-selected] {
  background: rgba(243, 194, 79, 0.18);
  color: #fff;
}
body.woocommerce-edit-address
  .select2-container--default
  .select2-results__option[aria-selected="true"],
body.woocommerce-edit-address
  .select2-container--default
  .select2-results__option--selected {
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Tablet y móvil ---------- */
@media (max-width: 900px) {
  body.woocommerce-account.logged-in .woocommerce {
    grid-template-columns: minmax(0, 1fr);
  }
  body.woocommerce-account.logged-in .woocommerce-MyAccount-navigation {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 28px;
  }
  body.woocommerce-account.logged-in .woocommerce-MyAccount-content {
    grid-column: 1;
    grid-row: 3;
  }
  body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  body.woocommerce-account .woocommerce-MyAccount-navigation li a {
    padding: 10px 16px !important;
    border-color: var(--ldf-line);
    border-radius: 999px;
  }
  body.woocommerce-account .woocommerce-MyAccount-navigation li a::before {
    display: none;
  }
}
@media (max-width: 640px) {
  .ldf-addresses {
    grid-template-columns: minmax(0, 1fr);
  }
  .ldf-address {
    padding: 20px;
  }
  body.woocommerce-edit-account .woocommerce-EditAccountForm > .form-row-first,
  body.woocommerce-edit-account .woocommerce-EditAccountForm > .form-row-last,
  body.woocommerce-edit-address
    .woocommerce-address-fields__field-wrapper
    > .form-row-first,
  body.woocommerce-edit-address
    .woocommerce-address-fields__field-wrapper
    > .form-row-last {
    grid-column: 1 / -1;
  }
  body.woocommerce-edit-account .woocommerce-EditAccountForm fieldset {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.woocommerce-account * {
    transition: none !important;
  }
}
