/* Armería Gil · cuenta de cliente (entrar, registro, recuperar, Mi cuenta). Prefijo .ac-. Solo var(--…). */

/* Entrar / registro / recuperar ------------------------------------------------------ */
.ac-auth {
  display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px);
  align-items: stretch; max-width: 1200px; padding-block: clamp(24px, 4vw, 56px) clamp(40px, 6vw, 80px);
}
.ac-auth-main { display: grid; gap: 16px; align-content: start; }
.ac-card { display: grid; gap: 22px; padding: clamp(24px, 4vw, 40px); background: var(--surface); border-radius: var(--r-lg); }
.ac-head { display: grid; gap: 8px; }
.ac-title { font-family: var(--font-display); font-weight: var(--fw-display); font-variation-settings: "wdth" var(--wdth-display); letter-spacing: var(--ls-display); font-size: var(--fs-2xl); line-height: 1.1; }
.ac-sub { color: var(--text-muted); font-size: var(--fs-sm); max-width: 44ch; }
.ac-form { display: grid; gap: 16px; }
.ac-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ac-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ac-label-row label { font-size: var(--fs-sm); font-weight: 600; }
.ac-label-row a { font-size: var(--fs-xs); color: var(--text-muted); text-underline-offset: 3px; }
.ac-label-row a:hover { color: var(--text); }
.ac-form .btn { margin-top: 4px; }
.ac-error { padding: 10px 14px; border-radius: var(--r-md); background: var(--danger-bg); color: var(--danger); font-size: var(--fs-sm); font-weight: 600; }
.ac-error a { color: inherit; }
.ac-legal { font-size: var(--fs-xs); color: var(--text-muted); }
.ac-legal a { color: inherit; text-underline-offset: 2px; }
.ac-alt { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 0 4px; font-size: var(--fs-sm); color: var(--text-muted); }
.ac-alt a:not(.link) { color: var(--text); font-weight: 600; text-underline-offset: 3px; }
.field.has-error > label { color: var(--danger); }

.ac-photo { position: relative; min-height: 520px; margin: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--encina-800); }
.ac-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ac-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 32px 28px;
  background: linear-gradient(180deg, rgba(20, 29, 23, 0), rgba(20, 29, 23, .78));
  color: var(--hueso); font-family: var(--font-display); font-weight: var(--fw-display); font-variation-settings: "wdth" var(--wdth-display); letter-spacing: var(--ls-display); font-size: var(--fs-xl); line-height: 1.15;
}
@media (max-width: 900px) {
  .ac-auth { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .ac-photo { display: none; }
}
@media (max-width: 480px) { .ac-row { grid-template-columns: minmax(0, 1fr); } }

/* Mi cuenta: área propia (tienda/cuenta/_area.html). Prefijos .ax- (marco) y .ao- (pedidos). ---------- */
.ax-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.ax-main { flex: 1; }
.ax-shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }

/* Barra superior */
.ax-bar { background: var(--encina-900); color: var(--hueso); }
.ax-bar-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.ax-brand { display: block; flex: none; }
.ax-brand img { display: block; height: 40px; width: auto; }
.ax-back {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 0 0 24px;
  border-left: 1px solid rgba(251, 251, 248, .16); color: rgba(251, 251, 248, .72);
  font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.ax-back:hover { color: var(--hueso); }
.ax-bar-end { display: flex; align-items: center; gap: 14px; margin-left: auto; min-width: 0; }
.ax-cart.cart-btn { margin-right: 0; padding: 0 10px; height: 40px; color: var(--hueso); }
.ax-sep { width: 1px; height: 22px; background: rgba(251, 251, 248, .16); }
.ax-user { font-size: var(--fs-sm); font-weight: 600; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-bar-end form { display: contents; }
.ax-out {
  height: 32px; padding: 0 12px; border: 1px solid rgba(251, 251, 248, .28); border-radius: var(--r-sm);
  background: transparent; color: var(--hueso); font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer;
}
.ax-out:hover { background: rgba(251, 251, 248, .08); border-color: rgba(251, 251, 248, .5); }
.ax-bar a:focus-visible, .ax-out:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.ax-flash { display: grid; gap: 8px; padding-top: 20px; }

/* Pie mínimo */
.ax-foot { margin-top: 72px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--fs-xs); }
.ax-foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 20px; }
.ax-foot a { color: inherit; text-underline-offset: 2px; }
.ax-foot a:hover { color: var(--text); }
.ax-foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }

/* Rejilla: navegación lateral + contenido */
.ax-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); align-items: start; padding-top: clamp(28px, 3.5vw, 48px); }
.ax-nav { position: sticky; top: 24px; display: grid; gap: 2px; }
.ax-nav > a {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border-radius: var(--r-sm); color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
  box-shadow: inset 2px 0 0 transparent;
}
.ax-nav > a:hover { color: var(--text); background: rgba(20, 29, 23, .04); }
.ax-nav > a.is-active { color: var(--text); background: var(--surface); box-shadow: inset 2px 0 0 var(--laton-500); }
.ax-nav-n { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; color: var(--text-soft); }
.ax-nav-help { margin-top: 20px; padding: 18px 14px 0; border-top: 1px solid var(--border); font-size: var(--fs-xs); line-height: 1.7; color: var(--text-muted); }
.ax-nav-help a { color: var(--text); font-weight: 600; text-decoration: none; }
.ax-nav-help a:hover { text-decoration: underline; }

.ax-content { min-width: 0; display: grid; gap: 16px; align-content: start; }
.ax-hello { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; margin-bottom: 8px; }
.ax-hello h1 {
  font-family: var(--font-display); font-weight: var(--fw-display); font-variation-settings: "wdth" var(--wdth-display);
  letter-spacing: var(--ls-display); font-size: clamp(2rem, 3.4vw, 2.875rem); line-height: 1.05;
}
.ax-hello p { color: var(--text-muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }

/* Avisos: solo si hay algo que hacer */
.ax-alert { border-radius: var(--r-lg); }
.ax-alert h2 { font-size: var(--fs-md); font-weight: 700; line-height: 1.3; }
.ax-alert-verify { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 14px 16px 14px 22px; background: var(--warn-bg); color: var(--text); font-size: var(--fs-sm); }
.ax-alert-verify strong { color: var(--warn); }

.ax-alert-ready {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: 24px 48px; align-items: start;
  padding: 28px 32px; background: var(--encina-800); color: var(--hueso);
}
.ax-ready-head { display: flex; gap: 16px; align-items: flex-start; }
.ax-ready-mark { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(217, 195, 147, .4); color: var(--laton-300); }
.ax-alert-ready h2 { font-family: var(--font-display); font-weight: var(--fw-display); font-variation-settings: "wdth" var(--wdth-display); letter-spacing: var(--ls-display); font-size: var(--fs-lg); line-height: 1.2; }
.ax-ready-head p { margin-top: 6px; font-size: var(--fs-sm); color: rgba(251, 251, 248, .68); }
.ax-ready-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 32px; padding-left: 32px; border-left: 1px solid rgba(251, 251, 248, .14); }
.ax-ready-grid h3 { margin-bottom: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--laton-300); }
.ax-ready-grid p, .ax-ready-grid li { font-size: var(--fs-sm); line-height: 1.6; }
.ax-ready-grid ul { list-style: none; display: grid; gap: 4px; }
.ax-ready-grid li { display: flex; gap: 10px; align-items: baseline; }
.ax-ready-grid li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--laton-500); transform: translateY(-2px); }
.ax-ready-link { display: inline-block; margin-top: 6px; color: var(--laton-300); font-size: var(--fs-sm); font-weight: 600; text-underline-offset: 3px; }
.ax-ready-link:hover { color: var(--hueso); }

.ax-alert-pay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: 20px 48px; align-items: center; padding: 24px 32px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--laton-300); }
.ax-pay-head p { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-muted); }
.ax-pay { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 16px 28px; margin: 0; }
.ax-pay dt { font-size: var(--fs-xs); color: var(--text-muted); }
.ax-pay dd { margin: 2px 0 0; font-size: var(--fs-base); font-weight: 700; overflow-wrap: anywhere; }
.ax-pay-iban .num { white-space: nowrap; }
.ax-copy { margin-left: 6px; padding: 2px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; vertical-align: 1px; }
.ax-copy:hover { border-color: var(--pizarra-400); }

/* Secciones */
.ax-section { scroll-margin-top: 24px; }
#pedidos { margin-top: 16px; }
.ax-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.ax-section-head h2 { font-family: var(--font-display); font-weight: var(--fw-display); font-variation-settings: "wdth" var(--wdth-display); letter-spacing: var(--ls-display); font-size: var(--fs-xl); line-height: 1.15; }
.ax-section-head span { font-size: var(--fs-sm); color: var(--text-muted); }

/* Pedidos */
.ao-list { list-style: none; display: grid; gap: 14px; }
.ao { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.ao-top {
  display: grid; grid-template-columns: 148px minmax(130px, 170px) minmax(0, 1fr) auto minmax(110px, auto);
  grid-template-areas: "thumbs id names meta total"; gap: 16px 32px; align-items: center; padding: 22px 28px;
}
.ao-thumbs { grid-area: thumbs; display: flex; align-items: center; }
.ao-thumbs > * { flex: none; width: 64px; height: 64px; border-radius: var(--r-md); border: 3px solid var(--surface); background: var(--piedra-100); object-fit: cover; }
.ao-thumbs > * + * { margin-left: -22px; }
.ao-noimg { display: grid; place-items: center; color: var(--monte-300); }
.ao-thumbs > .ao-more { display: grid; place-items: center; width: 44px; background: var(--encina-800); color: var(--hueso); font-size: var(--fs-xs); font-weight: 700; }
.ao-id { grid-area: id; }
.ao-id h3 { font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.ao-id p { margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); }
.ao-names { grid-area: names; font-size: var(--fs-sm); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ao-q { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ao-dot { color: var(--text-soft); }
.ao-meta { grid-area: meta; display: flex; gap: 28px; margin: 0; }
.ao-meta dt { font-size: var(--fs-xs); color: var(--text-muted); }
.ao-meta dd { margin: 2px 0 0; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.ao-total { grid-area: total; text-align: right; font-size: var(--fs-lg); font-weight: 700; white-space: nowrap; }

.ao-bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 48px; align-items: center; padding: 18px 28px 20px; border-top: 1px solid var(--border-soft); }
.ao-actions { display: flex; gap: 8px; align-items: center; }
.ao-actions form { display: contents; }
.ao-repeat svg { flex: none; }

/* Pista de estado: Recibido, Pagado, Preparando, Listo/Enviado, Entregado */
.ao-track { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 880px; }
.ao-track li { position: relative; display: grid; gap: 1px; align-content: start; padding: 24px 12px 0 0; font-size: var(--fs-xs); color: var(--text-soft); }
.ao-track li::before { content: ""; position: absolute; top: 7px; left: 16px; right: 2px; height: 2px; border-radius: 2px; background: var(--border); }
.ao-track li:last-child::before { display: none; }
.ao-node { position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--border); }
.ao-step { font-weight: 600; line-height: 1.3; }
.ao-date { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.ao-track .is-done { color: var(--text-muted); }
.ao-track .is-done::before { background: var(--laton-500); }
.ao-track .is-done .ao-node { background: var(--laton-500); box-shadow: none; }
.ao-track .is-done .ao-node::after { content: ""; position: absolute; left: 5.5px; top: 3px; width: 4px; height: 7px; border: solid var(--encina-900); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
.ao-track .is-current { color: var(--text); }
.ao-track .is-current .ao-step { font-weight: 700; }
.ao-track .is-current .ao-node { background: var(--laton-500); box-shadow: 0 0 0 4px var(--laton-100), 0 0 0 5px var(--laton-300); }
.ao-track .is-current .ao-node::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--encina-900); }
.ao-track .is-current .ao-date { color: var(--text-muted); }

.ao-now { display: none; }
.ao-cancelled { display: flex; align-items: center; gap: 14px; max-width: 880px; font-size: var(--fs-sm); font-weight: 600; color: var(--danger); }
.ao-cancelled span { order: 2; flex: 1; height: 2px; border-radius: 2px; background: var(--danger-bg); }
.ao.is-cancelled .ao-thumbs > img { filter: grayscale(1); opacity: .6; }
.ao.is-cancelled .ao-total { color: var(--text-muted); text-decoration: line-through; text-decoration-thickness: 1px; }

.ao-empty { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 24px; align-items: center; padding: 28px 32px; background: var(--surface); border-radius: var(--r-lg); }
.ao-empty-mark { color: var(--monte-300); }
.ao-empty h3 { font-size: var(--fs-md); font-weight: 700; }
.ao-empty p { margin-top: 4px; font-size: var(--fs-sm); color: var(--text-muted); max-width: 60ch; }

/* Mis datos y contraseña */
.ax-panel { padding: 26px 32px 28px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.ax-duo { display: grid; gap: 16px; align-items: start; margin-top: 32px; }
@media (min-width: 1281px) { .ax-duo { grid-template-columns: minmax(0, 1fr) 400px; } }
.ax-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.ax-panel-head h2 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em; }
.ax-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px 32px; margin: 0; font-size: var(--fs-sm); }
.ax-data dt { font-size: var(--fs-xs); color: var(--text-muted); }
.ax-data dd { margin: 3px 0 0; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.ax-data .is-empty { color: var(--text-soft); font-weight: 400; }
.ax-toggle > summary { list-style: none; margin-top: 22px; }
.ax-toggle > summary::-webkit-details-marker { display: none; }
.ax-toggle[open] > summary { display: none; }
#clave .ax-toggle > summary { margin-top: 0; }
#clave .ax-panel-head { margin-bottom: 14px; }
.ax-panel:has(> .ax-toggle[open]) > .ax-data { display: none; }
.ax-form { max-width: 720px; }
.ax-form-narrow { max-width: 420px; }
.ax-note { font-size: var(--fs-xs); color: var(--text-muted); margin-top: -6px; }
.ax-form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 4px; }

/* Responsive */
@media (max-width: 1280px) {
  .ao-top { grid-template-columns: 148px minmax(0, 1fr) auto; grid-template-areas: "thumbs id total" "thumbs names meta"; gap: 6px 28px; }
  .ao-names { -webkit-line-clamp: 1; }
  .ax-alert-ready, .ax-alert-pay { grid-template-columns: minmax(0, 1fr); }
  .ax-ready-grid { padding-left: 0; border-left: 0; padding-top: 20px; border-top: 1px solid rgba(251, 251, 248, .14); }
}
@media (max-width: 1000px) {
  .ax-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 0; }
  .ax-nav {
    position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; margin-inline: calc(var(--gutter) * -1); padding: 10px var(--gutter);
    background: var(--bg); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
  }
  .ax-nav::-webkit-scrollbar { display: none; }
  .ax-nav > a { flex: none; min-height: 36px; box-shadow: none; border-radius: var(--r-pill); }
  .ax-nav > a.is-active { background: var(--encina-800); color: var(--hueso); box-shadow: none; }
  .ax-nav > a.is-active .ax-nav-n { color: var(--laton-300); }
  .ax-nav-help { display: none; }
  .ax-content { padding-top: 28px; }
  .ax-section { scroll-margin-top: 72px; }
  .ao-bottom { grid-template-columns: minmax(0, 1fr); }
  .ao-actions { justify-content: flex-end; }
}
@media (max-width: 680px) {
  .ax-bar-in { gap: 14px; height: 56px; }
  .ax-brand img { height: 34px; }
  .ax-back { padding-left: 14px; }
  .ax-user, .ax-sep { display: none; }
  .ax-bar-end { gap: 6px; }
  .ax-cart.cart-btn { padding: 0 8px; }

  .ao-top { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "thumbs total" "id id" "names names" "meta meta"; gap: 10px 16px; padding: 18px; }
  .ao-thumbs > * { width: 56px; height: 56px; }
  .ao-id { margin-top: 4px; }
  .ao-names { -webkit-line-clamp: 2; color: var(--text-muted); }
  .ao-meta { gap: 24px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
  .ao-meta dd { white-space: normal; }
  .ao-bottom { padding: 16px 18px 18px; }
  .ao-now { display: flex; align-items: baseline; gap: 4px; margin-bottom: 12px; font-size: var(--fs-sm); }
  .ao-now span { margin-left: auto; font-size: var(--fs-xs); color: var(--text-soft); }
  .ao-track li { padding: 16px 0 0; }
  .ao-track .ao-step, .ao-track .ao-date { display: none; }
  .ao-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .ao-actions .btn { width: 100%; min-height: 40px; }
  .ao-actions > a:only-child { grid-column: 1 / -1; }

  .ax-alert-ready, .ax-alert-pay { padding: 22px 20px; }
  .ax-ready-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ax-pay { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ax-pay-iban { grid-column: 1 / -1; }
  .ax-pay-iban .num { white-space: normal; }
  .ax-panel { padding: 22px 20px; }
  .ao-empty { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; }
  .ax-foot { margin-top: 48px; }
}
@media (max-width: 400px) { .ax-back span { display: none; } .ax-back::after { content: "Tienda"; } }

/* Privacidad: descargar mis datos, ofertas por email y eliminar la cuenta */
.ax-priv { margin-top: 16px; }
.ax-priv .ax-panel-head { margin-bottom: 6px; }
.ax-priv-policy { font-size: var(--fs-sm); color: var(--text-muted); text-underline-offset: 3px; }
.ax-priv-policy:hover { color: var(--text); }
.ax-priv-list { list-style: none; display: grid; }
.ax-priv-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 32px; align-items: center;
  padding-block: 18px; border-top: 1px solid var(--border-soft);
}
.ax-priv-row:first-child { border-top: 0; }
.ax-priv-text h3 { font-size: var(--fs-base); font-weight: 700; }
.ax-priv-text p { margin-top: 2px; font-size: var(--fs-sm); color: var(--text-muted); max-width: 68ch; }
.ax-priv-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ax-priv-block { grid-column: 1 / -1; padding: 10px 14px; border-radius: var(--r-md); background: var(--warn-bg); font-size: var(--fs-sm); }
.ax-priv-confirm { justify-self: end; }
.ax-priv-confirm > summary { margin-top: 0; }
.ax-priv-confirm[open] { grid-column: 1 / -1; justify-self: stretch; }
.ax-priv-confirm form { padding: 18px 20px; border-radius: var(--r-md); background: var(--danger-bg); }
.ax-btn-danger { color: var(--danger); border-color: var(--danger); }
.ax-btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.ax-btn-danger-solid { background: var(--danger); border-color: var(--danger); color: var(--hueso); }
.ax-btn-danger-solid:hover { background: var(--danger); filter: brightness(.92); color: var(--hueso); }
@media (max-width: 680px) {
  .ax-priv-row { grid-template-columns: minmax(0, 1fr); }
  .ax-priv-actions, .ax-priv-confirm { justify-content: flex-start; justify-self: start; }
  .ax-priv-confirm form { padding: 16px; }
}
