/* ═══════════════════════════════════════════════════════════════════
   ONA Admin · B4: productos (vídeo), medios por sección, sedes y eventos
   Hoja propia (no tocar admin.css). Botones de 40 px y nada que desborde
   a 375 px.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Miniaturas (medios por sección y galería de producto) ───────────── */
.am-thumb {
    position: relative;
    flex: 0 0 76px;
    width: 76px;
    height: 50px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-cream-deep, #ede4d6);
    color: var(--text-muted);
}
.am-thumb__ph,
.media-lib-item .am-thumb__ph,
.am-gthumb .am-thumb__ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.am-thumb__img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
/* El vídeo tapa el icono cuando ya tiene fotograma (o póster) */
.am-thumb__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
/* En la biblioteca el vídeo se reproduce al pasar el ratón */
.media-lib-item .am-thumb__media { pointer-events: auto; }
.am-thumb__play {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(20, 14, 9, .62);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.am-thumb__play svg { margin-left: 1px; }

/* ── R12 · Medios por sección ────────────────────────────────────────── */
.am-list { display: flex; flex-direction: column; gap: 6px; }
.am-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius, 16px);
    padding: 10px 12px;
    min-width: 0;
}
/* La info crece y se queda con el sitio; las acciones bajan de línea si no caben */
.am-row__info { flex: 999 1 170px; min-width: 0; }
.am-row__title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    color: var(--text-heading);
    overflow-wrap: anywhere;
}
.am-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-top: 4px;
}
.am-row__key {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11px;
    color: var(--text-secondary);
    background: none;
    padding: 0;
    overflow-wrap: anywhere;
}
.am-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    line-height: 1.4;
    text-transform: uppercase;
    white-space: nowrap;
}
.am-badge--foto  { background: var(--ok-ink, #3f7a4c); color: #fff; }
.am-badge--video { background: var(--color-primary-darker, #5e4f3f); color: #fff; }
.am-badge--none  {
    background: var(--bg-cream-soft, #fbf6f0);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}
.am-row__acts {
    flex: 1 0 auto;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}
.am-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-heading);
    font: 600 13px/1 var(--font-family);
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.am-btn:hover { border-color: var(--color-primary-dark); background: var(--bg-cream-soft, #fbf6f0); }
.am-btn:focus-visible,
.ae-btn:focus-visible,
.am-gthumb__del:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }
.am-btn--icon { width: 40px; padding: 0; flex: 0 0 40px; }
.am-btn--danger { color: var(--color-error); }

/* ── R11 · Galería del producto (fotos y vídeos) ─────────────────────── */
.am-gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 14px 12px;
    margin: 6px 0 12px;
    padding-top: 6px;
}
.am-gthumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    background: var(--bg-cream-deep, #ede4d6);
}
.am-gthumb > img,
.am-gthumb > video { border-radius: 12px; }
.am-gthumb .am-thumb__media { position: absolute; inset: 0; }
/* Quitar: círculo de 28 px con zona táctil de 40 px */
.am-gthumb__del {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    background: var(--color-error);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    z-index: 2;
}
.am-gthumb__del::after { content: ''; position: absolute; inset: -6px; }
.am-gallery__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.am-gallery__status { margin-top: 6px; min-height: 1em; }
.am-gallery__hint { margin: 4px 0 0; }

/* ── R13 · Sedes ─────────────────────────────────────────────────────── */
.am-nomap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--color-error-bg, rgba(180, 102, 92, .12));
    color: #8f4a41;
    white-space: nowrap;
}
.lc-row__stats-line .am-linkhint { color: var(--text-secondary); }
/* Acciones de la tarjeta de sede: botones cuadrados de 40 px (dejan sitio al nombre) */
.lc-row .lc-row__acts { gap: 4px; padding-right: 2px; }
.lc-row .lc-row__acts .btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 50%;
}
.lc-row .lc-row__name { max-width: none; white-space: normal; overflow-wrap: anywhere; }

/* Formulario: pegar enlace de Google Maps */
.am-gmaps .form-label { display: flex; align-items: center; gap: 6px; }
.am-gmaps__row { display: flex; gap: 8px; flex-wrap: wrap; }
.am-gmaps__row .form-input { flex: 1 1 200px; min-width: 0; }
.am-gmaps__row .btn { flex: 0 0 auto; min-height: 40px; }
.am-gmaps__hint { margin: 4px 0 0; }
.am-gmaps__msg:empty { display: none; }
.am-gmaps__msg { margin-top: 6px; }
.am-msg {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text-heading);
}
.am-msg svg { flex-shrink: 0; margin-top: 1px; }
.am-msg--ok    { background: rgba(63, 122, 76, .10); }
.am-msg--ok svg { color: var(--ok-ink, #3f7a4c); }
.am-msg--info  { background: var(--bg-cream-soft, #fbf6f0); color: var(--text-secondary); }
.am-msg--warn  { background: rgba(200, 153, 114, .18); }
.am-msg--error { background: var(--color-error-bg, rgba(180, 102, 92, .12)); color: #8f4a41; }
.am-dirlink {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--bg-cream-soft, #fbf6f0);
    font-size: 12.5px;
    color: var(--text-secondary);
}
.am-dirlink span { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 180px; }
.am-dirlink .btn { min-height: 40px; }

/* ── R14 · Eventos del admin ─────────────────────────────────────────── */
.ae-list { display: flex; flex-direction: column; gap: 10px; }
.ae-row {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md, 20px);
    padding: 12px;
    min-width: 0;
}
.ae-row__head { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.ae-row__img { flex: 0 0 84px; height: 56px; border-radius: 10px; }
.ae-row__info { flex: 1; min-width: 0; }
.ae-row__title { font-weight: 600; color: var(--text-heading); line-height: 1.3; overflow-wrap: anywhere; }
.ae-row__meta { margin-top: 2px; }
.ae-row__state { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
/* Dos grupos de tres botones iguales: en móvil, dos filas; en ancho, una */
.ae-row__acts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}
.ae-row__group {
    flex: 1 1 290px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}
.ae-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    min-width: 0;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-heading);
    font: 600 13px/1.1 var(--font-family);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.ae-btn span { overflow: hidden; text-overflow: ellipsis; }
.ae-btn svg { flex-shrink: 0; }
.ae-btn:hover { border-color: var(--color-primary-dark); background: var(--bg-cream-soft, #fbf6f0); color: var(--text-heading); }
.ae-btn--main { background: var(--bg-cream-soft, #fbf6f0); border-color: rgba(94, 79, 63, .22); }
.ae-btn--danger, .ae-btn--danger:hover { color: var(--color-error); }
/* En el móvil, solo texto: «Despublicar» y «Ver página» caben enteros en un tercio */
@media (max-width: 480px) {
    .ae-btn svg { display: none; }
    .ae-btn { font-size: 12.5px; padding: 0 6px; }
}
