/* Alfa Shop — «Mis compras». Estructura inspirada en la referencia aprobada por el propietario (filas con imagen de
   la plataforma, métricas y panel lateral), con la identidad de Alfa: negro, gris oscuro, rojo vino y rojo neón.
   Usa los tokens de styles.css y no modifica ninguna regla existente. */
.pc-page { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 22px; align-items: start; }
.pc-content { display: grid; gap: 16px; min-width: 0; }

/* ---------- Panel lateral ---------- */
.pc-side { position: sticky; top: 0; display: grid; gap: 10px; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: linear-gradient(180deg, #121216, #0b0b0d); }
.pc-identity { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.pc-identity > div { display: grid; gap: 2px; min-width: 0; }
.pc-identity b { overflow-wrap: anywhere; }
.pc-identity small { color: var(--muted); font-size: 12.5px; }
.pc-avatar { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; font-size: 22px; font-weight: 800; border: 2px solid var(--neon); color: #fff; background: radial-gradient(circle at 30% 25%, #3a0510, #0b0b0d); box-shadow: 0 0 16px rgba(255, 31, 61, .45); }
.pc-role { display: inline-flex; align-items: center; gap: 5px; width: fit-content; margin-top: 4px; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; color: #ffc3cd; border: 1px solid rgba(255, 31, 61, .5); background: rgba(109, 10, 27, .45); }
.pc-eyebrow { margin: 4px 2px 0; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--neon-soft); }
.pc-upcoming { border-radius: 14px; border: 1px solid var(--line); background: #0e0e11; }
.pc-upcoming summary { display: flex; align-items: center; gap: 8px; padding: 12px; font-weight: 800; font-size: 14px; cursor: pointer; list-style: none; }
.pc-upcoming summary::-webkit-details-marker { display: none; }
.pc-upcoming summary svg { color: var(--neon-soft); }
.pc-upcoming-item { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; text-align: left; border-top: 1px solid var(--line-soft); }
.pc-upcoming-item span { display: grid; gap: 2px; }
.pc-upcoming-item b { font-size: 14px; }
.pc-upcoming-item small, .pc-note { font-size: 12px; color: var(--muted); }
.pc-upcoming-item:hover b { color: var(--neon-soft); }
.pc-note { padding: 10px 12px 12px; border-top: 1px solid var(--line-soft); }
.pc-nav { display: flex; width: 100%; align-items: center; gap: 11px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: #0e0e11; text-align: left; color: #fff; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.pc-nav span { display: grid; flex: 1; gap: 1px; }
.pc-nav b { font-size: 14px; }
.pc-nav small { font-size: 12px; color: var(--muted); }
.pc-nav > svg:first-child { color: var(--neon-soft); }
.pc-nav:hover, .pc-nav[aria-pressed="true"] { border-color: var(--neon); box-shadow: 0 0 14px rgba(255, 31, 61, .25); }
.pc-whatsapp { border-color: #1f6b47; background: linear-gradient(180deg, rgba(18, 70, 46, .45), #0b0f0d); }
.pc-whatsapp > svg:first-child { color: #45d483; }
.pc-whatsapp:hover { border-color: #45d483; box-shadow: 0 0 14px rgba(69, 212, 131, .25); }

/* ---------- Encabezado y métricas ---------- */
.pc-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 28px 30px; overflow: hidden; border-radius: 22px; border: 1px solid rgba(255, 31, 61, .35);
  background: radial-gradient(90% 140% at 100% 0%, rgba(255, 31, 61, .22), transparent 55%), radial-gradient(70% 120% at 0% 100%, rgba(109, 10, 27, .55), transparent 60%), #0c0b0e; }
.pc-hero h1 { font-size: clamp(40px, 4.4vw, 64px); line-height: 1; letter-spacing: -.02em; }
.pc-hero h1 em { font-style: normal; color: var(--neon); text-shadow: 0 0 22px rgba(255, 31, 61, .55); }
.pc-hero p { max-width: 520px; margin-top: 10px; color: #d8d8de; font-size: 16px; }
.pc-metrics { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; }
.pc-metric { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(11, 11, 13, .82); }
.pc-metric svg { color: var(--neon-soft); filter: drop-shadow(0 0 6px rgba(255, 31, 61, .5)); }
.pc-metric span { display: grid; }
.pc-metric b { font-size: 28px; line-height: 1.05; }
.pc-metric small { font-size: 13px; color: var(--muted); }

/* ---------- Barra de búsqueda y filtros ---------- */
.pc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pc-search { display: flex; flex: 1 1 320px; align-items: center; gap: 10px; padding: 0 16px; min-height: 48px; border-radius: 999px; border: 1px solid rgba(255, 31, 61, .45); background: #0e0e11; }
.pc-search svg { color: var(--muted); }
.pc-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; }
.pc-search:focus-within { border-color: var(--neon); box-shadow: 0 0 14px rgba(255, 31, 61, .3); }
.pc-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-filter { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 15px; border-radius: 12px; border: 1px solid var(--line); background: #0e0e11; font-size: 14px; font-weight: 700; }
.pc-filter svg { color: var(--muted); }
.pc-filter.active, .pc-filter:hover { border-color: var(--neon); background: rgba(109, 10, 27, .45); box-shadow: 0 0 12px rgba(255, 31, 61, .28); }
.pc-filter.active svg { color: var(--neon-soft); }
.pc-dot { width: 9px; height: 9px; border-radius: 50%; background: #33d17a; box-shadow: 0 0 8px rgba(51, 209, 122, .8); }
.pc-sort { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 0 12px; min-height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #0e0e11; }
.pc-sort svg { color: var(--muted); transform: rotate(90deg); }
.pc-sort select { border: 0; outline: 0; background: transparent; font-size: 14px; font-weight: 700; }
.pc-sort select option { background: #0e0e11; }
.pc-filter-note { color: var(--muted); font-size: 14px; }

/* ---------- Filas de compras ---------- */
.pc-list { display: grid; gap: 12px; }
.pc-row { border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(90deg, #121216, #0d0d10); transition: border-color .15s, box-shadow .15s; }
.pc-row:hover { border-color: rgba(255, 31, 61, .55); }
.pc-row.open { border-color: var(--neon); box-shadow: 0 0 22px rgba(255, 31, 61, .22); }
.pc-main { display: grid; grid-template-columns: 150px minmax(170px, 1fr) minmax(470px, 1.6fr) 46px; align-items: center; gap: 18px; padding: 12px 16px 12px 12px; }
.pc-thumb { position: relative; display: grid; place-items: center; width: 150px; height: 88px; overflow: hidden; border-radius: 14px; border: 1px solid #2f2f36; background: linear-gradient(135deg, #3a0510, #0b0b0d); }
.pc-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pc-thumb b { position: relative; padding: 0 8px; font-size: 22px; font-weight: 900; line-height: 1; color: #fff; text-align: center; text-shadow: 0 2px 10px #000, 0 0 2px #000; overflow-wrap: anywhere; }
.pc-thumb-text b { font-size: 18px; }
.pc-title { display: grid; gap: 4px; min-width: 0; }
.pc-title h3 { font-size: 18px; }
.pc-title p { color: var(--muted); font-size: 13.5px; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 700; border: 1px solid #3c3c44; color: #d8d8de; }
.pc-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.pc-state.on { color: #4be38c; border-color: rgba(51, 209, 122, .45); background: rgba(31, 122, 69, .18); }
.pc-state.wait { color: #ffd27a; border-color: rgba(255, 210, 122, .4); background: rgba(120, 90, 20, .18); }
.pc-state.warn { color: #ff9d5c; border-color: rgba(255, 157, 92, .45); background: rgba(130, 60, 10, .18); }
.pc-state.off { color: #a8a8b2; border-color: #3c3c44; }
.pc-warranty { color: #ffc3cd; border-color: rgba(255, 31, 61, .45); background: rgba(109, 10, 27, .35); }
.pc-warranty svg { color: var(--neon-soft); }
.pc-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pc-meta span { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 9px; align-items: center; padding: 4px 12px; border-left: 1px solid var(--line); min-width: 0; }
.pc-meta svg { grid-row: span 2; color: var(--neon-soft); }
.pc-meta small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pc-meta b { font-size: 15px; white-space: nowrap; }
.pc-toggle { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid rgba(255, 31, 61, .6); background: #0e0e11; transition: transform .2s, box-shadow .15s, border-color .15s; }
.pc-toggle:hover { border-color: var(--neon); box-shadow: 0 0 14px rgba(255, 31, 61, .4); }
.pc-row.open .pc-toggle { transform: rotate(-90deg); border-color: var(--neon); background: rgba(109, 10, 27, .45); }

/* ---------- Detalle desplegado: accesos sin botón de revelado ---------- */
.pc-detail { display: grid; gap: 12px; margin: 0 14px 14px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(8, 8, 10, .75); }
.pc-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pc-detail-head h4 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.pc-detail-head h4 svg { color: var(--neon-soft); }
.pc-detail-head span { font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.pc-detail .order-credentials { margin: 0; }
.pc-detail .access-card { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0; border: 0; background: transparent; }
.pc-detail .access-group + .access-group, .pc-detail .access-card + .access-card { margin-top: 8px; }
.pc-detail .access-unit { grid-column: 1 / -1; margin: 0; color: var(--neon-soft); }
.pc-detail .access-row { grid-template-columns: 36px minmax(0, 1fr) 40px; grid-template-areas: "icon label copy" "icon value copy"; row-gap: 2px; padding: 12px; border-radius: 14px; border-color: var(--line); background: #121216; }
.pc-detail .access-row .access-icon { grid-area: icon; }
.pc-detail .access-row .access-label { grid-area: label; font-size: 12.5px; }
.pc-detail .access-row .access-value { grid-area: value; font-size: 15px; }
.pc-detail .access-row .access-copy { grid-area: copy; }
.pc-detail .access-other { grid-column: 1 / -1; }
/* El correo es el dato más largo: ocupa dos columnas para no partirse. */
.pc-detail .access-row:has([data-field="email"]) { grid-column: span 2; }
.pc-detail .access-copy-all { width: auto; justify-self: start; min-width: 240px; margin-top: 10px; }
.pc-why { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line); color: #d8d8de; }
.pc-why svg { flex: none; margin-top: 2px; color: var(--neon-soft); }
.pc-info { font-size: 13.5px; color: var(--muted); }
.pc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pc-actions .btn-outline { flex: none; }
.pc-help { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid #1f6b47; color: #c9f5dc; font-weight: 800; text-decoration: none; background: rgba(18, 70, 46, .35); }
.pc-help svg { color: #45d483; }
.pc-help:hover { border-color: #45d483; box-shadow: 0 0 14px rgba(69, 212, 131, .25); }
.pc-back { display: flex; }
.pc-empty { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; text-align: center; border-radius: 18px; border: 1px dashed var(--line); color: var(--muted); }
.pc-empty svg { color: var(--neon-soft); }
.pc-empty h3 { color: #fff; }
.pc-empty .btn-outline { flex: none; margin-top: 6px; }

/* La fila completa necesita ~920 px. Dentro de la ventana la columna puede ser más angosta que lo que indica el
   ancho de pantalla, así que el formato compacto también se activa según el ancho real de la columna. */
.pc-content { container-type: inline-size; }
@container (max-width: 940px) {
  .pc-main { grid-template-columns: 130px minmax(0, 1fr) 46px; }
  .pc-thumb { width: 130px; height: 80px; }
  .pc-meta { grid-column: 1 / -1; grid-row: 2; }
  .pc-meta span:first-child { border-left: 0; padding-left: 0; }
}

/* ---------- Pantallas medianas y celular ---------- */
@media (max-width: 1180px) {
  .pc-metrics { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .pc-main { grid-template-columns: 130px minmax(0, 1fr) 46px; }
  .pc-thumb { width: 130px; height: 80px; }
  .pc-meta { grid-column: 1 / -1; grid-row: 2; }
  .pc-meta span:first-child { border-left: 0; padding-left: 0; }
}
@media (max-width: 980px) {
  .pc-page { grid-template-columns: 1fr; }
  /* En pantallas angostas primero van las compras; el panel de cuenta queda debajo. */
  .pc-side { position: static; order: 2; }
  .pc-detail .access-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-detail .access-row:has([data-field="email"]) { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .pc-hero { padding: 20px; }
  .pc-main { grid-template-columns: 96px minmax(0, 1fr) 40px; gap: 12px; }
  .pc-thumb { width: 96px; height: 64px; }
  .pc-thumb b { font-size: 15px; }
  .pc-toggle { width: 40px; height: 40px; }
  .pc-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .pc-meta span { display: grid; grid-template-columns: 1fr; border-left: 0; padding: 8px; border-radius: 10px; background: #0e0e11; }
  .pc-meta svg { display: none; }
  .pc-meta b { font-size: 13.5px; white-space: normal; }
  .pc-metrics { gap: 8px; }
  .pc-metric { padding: 12px; }
  .pc-metric b { font-size: 22px; }
  .pc-sort { margin-left: 0; }
  .pc-detail { margin: 0 8px 8px; padding: 12px; }
  .pc-detail .access-card { grid-template-columns: 1fr; }
  .pc-detail .access-row:has([data-field="email"]) { grid-column: auto; }
  .pc-detail .access-value { word-break: break-all; }
  .pc-detail .access-copy-all { width: 100%; min-width: 0; }
}
