/* WP Buzón Papelerías — Perfil público /@handle */

.wpb-profile-wrap { max-width: 980px; margin: 0 auto; }
/* Banda negra a todo el ancho (tapa los márgenes blancos de los lados) */
.wpb-banner-band {
    position: relative;
    z-index: 1;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    background: #000;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .20);   /* sombrita profesional bajo el banner */
}

/* Foto de perfil (avatar) tipo Facebook: montada sobre el borde del banner */
.wpb-avatar-wrap {
    --av: 132px;
    position: relative;
    z-index: 2;
    line-height: 0;
    padding-left: clamp(1em, 4vw, 2em);   /* alinea con el cuerpo */
    margin-bottom: .2em;
}
.wpb-avatar-wrap.is-floating {
    margin-top: calc(var(--av) / -2);     /* mitad arriba (sobre el banner), mitad abajo */
}
.wpb-avatar {
    width: var(--av); height: var(--av);
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #fff;
    border: 4px solid #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .28);   /* sombra cae sobre la zona inferior al banner */
}
@media (max-width: 480px) { .wpb-avatar-wrap { --av: 104px; } }
/* La imagen llena el ancho (cover) como antes; lo que sobre a los lados queda negro */
.wpb-banner {
    width: 100%; max-width: 1600px; margin: 0 auto;
    aspect-ratio: 16 / 5;          /* = 1600 x 500 estándar; el banner se ve completo */
    background-color: #000;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0;
}
.wpb-profile-body { padding: 1.4em clamp(1em, 4vw, 2em) 3em; }

.wpb-profile-head { margin-bottom: 1.6em; }
.wpb-profile-name { margin: 0 0 .1em; line-height: 1.15; }
.wpb-profile-handle { margin: 0 0 .6em; color: #6b7280; font-weight: 600; }
.wpb-profile-about { margin: 0; color: #374151; }

.wpb-profile-cols {
    display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.6em; align-items: start;
}
@media (max-width: 720px) { .wpb-profile-cols { grid-template-columns: 1fr; } }

.wpb-contact-list { list-style: none; margin: 0; padding: 0; }
.wpb-contact-list li { padding: .45em 0; border-bottom: 1px solid #f0f1f3; }
.wpb-contact-list a { text-decoration: none; }
.wpb-map { display: block; width: 100%; border-radius: 10px; min-height: 280px; }
.wpb-no-map { color: #9ca3af; font-style: italic; }

/* Botones "Cómo llegar" / Waze bajo el mapa */
.wpb-nav-btns { display: flex; gap: .6em; margin-top: .7em; flex-wrap: wrap; }
.wpb-nav-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45em;
    flex: 1 1 auto; box-sizing: border-box;
    padding: .6em 1em; border-radius: 9px; font-weight: 600; font-size: .95em;
    text-decoration: none; border: 1px solid transparent; transition: filter .15s, background .15s;
}
.wpb-nav-ico { width: 1.2em; height: 1.2em; flex-shrink: 0; }
.wpb-nav-gmaps { background: #1a73e8; color: #fff; }
.wpb-nav-gmaps:hover { background: #1669d6; color: #fff; }
.wpb-nav-waze { background: #33ccff; color: #06283d; }
.wpb-nav-waze:hover { filter: brightness(.95); color: #06283d; }

/* Formulario de subida (Fase 2) */
.wpb-upload-box {
    margin-top: 2em; padding: 1.4em; border: 2px dashed #c7ccd3; border-radius: 12px;
    background: #fafbfc;
}
.wpb-upload-box h2 { margin-top: 0; }
.wpb-upload-box .wpb-field { margin-bottom: 1em; }
.wpb-upload-box label { display: block; font-weight: 600; margin-bottom: .35em; }
.wpb-upload-box input[type="file"],
.wpb-upload-box textarea {
    width: 100%; box-sizing: border-box; padding: .6em .7em;
    border: 1px solid #cfd4da; border-radius: 6px;
}
.wpb-upload-btn {
    background: #2563eb; color: #fff; border: 0; border-radius: 8px;
    padding: .7em 1.4em; font-size: 1em; font-weight: 600; cursor: pointer;
}
.wpb-upload-btn:disabled { opacity: .6; cursor: default; }
.wpb-upload-progress { height: 8px; background: #e5e7eb; border-radius: 6px; overflow: hidden; margin-top: .8em; display: none; }
.wpb-upload-progress > span { display: block; height: 100%; width: 0; background: #2563eb; transition: width .2s; }
.wpb-upload-result { margin-top: 1em; padding: 1em; border-radius: 8px; background: #ecfdf5; border: 1px solid #a7f3d0; display: none; }
.wpb-upload-result.is-error { background: #fef2f2; border-color: #fecaca; }
.wpb-link-row { display: flex; gap: .5em; margin-top: .5em; }
.wpb-link-row input { flex: 1; padding: .5em; border: 1px solid #cfd4da; border-radius: 6px; }

/* Aceptación de términos (debajo del selector de archivo) */
.wpb-consent-field { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15em .4em; }
.wpb-consent { display: inline-flex; align-items: baseline; gap: .45em; margin: 0; font-weight: 400; cursor: pointer; }
.wpb-consent input { margin: 0; transform: translateY(2px); flex-shrink: 0; }
.wpb-terms-open {
    background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
    color: #2563eb; font: inherit; font-weight: 600; text-decoration: underline;
}
.wpb-terms-open:hover { color: #1d4ed8; }
.wpb-consent-field.is-required { color: #b91c1c; }
.wpb-consent-field.is-required .wpb-consent input { outline: 2px solid #b91c1c; outline-offset: 2px; border-radius: 2px; }

/* Modal de términos de uso / privacidad */
.wpb-terms-dialog { max-width: 600px; }
.wpb-terms-body { max-height: 50vh; overflow: auto; padding-right: .4em; }
.wpb-terms-body h3 { margin: 1em 0 .35em; font-size: 1.02em; }
.wpb-terms-body h3:first-child { margin-top: 0; }
.wpb-terms-body p { margin: 0 0 .6em; color: #374151; line-height: 1.5; }
.wpb-terms-list { margin: 0 0 .8em; padding-left: 1.2em; }
.wpb-terms-list li { margin: 0 0 .4em; color: #374151; line-height: 1.45; }
.wpb-terms-actions { margin: 1.1em 0 0; }
.wpb-terms-accept { width: 100%; }

.wpb-history { margin-top: 2em; }
.wpb-history h3 { margin-bottom: .6em; }
.wpb-history-list { list-style: none; margin: 0; padding: 0; }
.wpb-history-item {
    display: flex; gap: .6em 1em; align-items: center; flex-wrap: wrap;
    padding: .7em .8em; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: .5em;
}
.wpb-history-item .wpb-hi-meta { flex: 1 1 auto; min-width: 0; }
.wpb-hi-thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.wpb-hi-ext { display: flex; align-items: center; justify-content: center; background: #eef2ff; color: #1e3a8a; font-weight: 700; font-size: .7em; }
.wpb-history-item .wpb-hi-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpb-history-item .wpb-hi-sub { font-size: .85em; color: #6b7280; }
.wpb-countdown { font-variant-numeric: tabular-nums; font-weight: 600; }
.wpb-countdown.is-expired { color: #b91c1c; }
.wpb-history-empty { color: #9ca3af; }

/* Honeypot anti-spam (oculto a humanos) */
.wpb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Botones pequeños */
.wpb-mini-btn {
    display: inline-block; background: #eef2ff; color: #1e3a8a; border: 1px solid #c7d2fe;
    border-radius: 6px; padding: .35em .7em; font-size: .85em; cursor: pointer; text-decoration: none;
}
.wpb-mini-btn:hover { background: #e0e7ff; }
.wpb-hi-act { display: flex; gap: .4em; flex-shrink: 0; flex-wrap: wrap; }

/* Responsive: en móvil, los botones bajan a una línea completa debajo del archivo */
@media (max-width: 560px) {
    .wpb-history-item .wpb-hi-meta { flex: 1 1 0; }
    .wpb-hi-act { flex: 1 1 100%; justify-content: flex-start; }
    .wpb-hi-act .wpb-mini-btn { flex: 1 1 auto; text-align: center; }
}

/* Buzón global de la web (shortcode / bloque) */
.wpb-web-buzon { margin: 1.2em 0; }
.wpb-web-buzon .wpb-cta { width: auto; display: inline-flex; }
.wpb-web-list { margin: 1.2em 0; }
.wpb-web-list .wpb-history { margin-top: 0; }

/* Botón CTA (sobre el mapa) */
.wpb-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    width: 100%; box-sizing: border-box; margin-bottom: .8em;
    /* Por defecto usa el color principal del tema; si el tema no lo expone, azul de respaldo.
       Se puede sobrescribir con la variable --wpb-btn-bg (bloque / perfil). */
    background: var(--wpb-btn-bg, var(--wp--preset--color--primary, #2563eb));
    color: var(--wpb-btn-fg, #fff);
    border: 0; border-radius: var(--wpb-btn-radius, 10px);
    padding: .75em 1.1em; font-size: 1em; font-weight: 600; cursor: pointer;
}
.wpb-cta:hover { filter: brightness(.93); color: var(--wpb-btn-fg, #fff); }
.wpb-cta-ico { width: 1.25em; height: 1.25em; flex-shrink: 0; }

/* Modal */
.wpb-modal[hidden] { display: none; }
.wpb-modal {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.wpb-modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .6); }
.wpb-modal-dialog {
    position: relative; background: #fff; border-radius: 14px;
    max-width: 520px; width: 100%; max-height: 90vh; overflow: auto;
    padding: 1.6em 1.6em 1.8em; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.wpb-modal-close {
    position: absolute; top: .4em; right: .55em; background: none; border: 0;
    font-size: 1.9em; line-height: 1; cursor: pointer; color: #6b7280;
}
.wpb-modal-close:hover { color: #111; }
.wpb-modal-intro { color: #6b7280; margin-top: 0; }
body.wpb-modal-open { overflow: hidden; }

/* Selector de archivo compatible con el tema */
.wpb-file-pick { display: flex; align-items: center; gap: .7em; cursor: pointer; flex-wrap: wrap; }
.wpb-file-btn {
    display: inline-block; background: #eef2ff; color: #1e3a8a; border: 1px solid #c7d2fe;
    border-radius: 8px; padding: .55em .95em; font-weight: 600; white-space: nowrap;
}
.wpb-file-pick:hover .wpb-file-btn { background: #e0e7ff; }
.wpb-file-name { color: #6b7280; font-size: .92em; word-break: break-all; }

/* Vista previa del archivo */
.wpb-upload-preview[hidden] { display: none; }
.wpb-upload-preview {
    display: flex; align-items: center; gap: .8em; margin: .2em 0 1em;
    padding: .6em; border: 1px solid #e5e7eb; border-radius: 10px; background: #fafbfc;
}
.wpb-pv-img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.wpb-pv-file {
    width: 64px; height: 64px; border-radius: 8px; background: #eef2ff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wpb-pv-ext { font-weight: 700; color: #1e3a8a; font-size: .85em; }
.wpb-pv-meta { min-width: 0; }
.wpb-pv-meta strong { display: block; word-break: break-all; }
.wpb-pv-meta span { color: #6b7280; font-size: .85em; }

/* Vista de una subida /@handle@token */
.wpb-view-card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.4em; }
.wpb-view-preview { margin-bottom: 1em; }
.wpb-view-preview img { max-width: 100%; max-height: 420px; border-radius: 8px; display: block; }

/* Dos columnas: archivo + (QR / compartir) */
.wpb-view-cols { display: grid; grid-template-columns: 1fr auto; gap: 1.8em; align-items: start; }
@media (max-width: 680px) { .wpb-view-cols { grid-template-columns: 1fr; } }
.wpb-view-side { text-align: center; }
.wpb-qr { display: inline-block; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; }
.wpb-qr-box { width: 200px; height: 200px; }
.wpb-qr-box img, .wpb-qr-box canvas { display: block; width: 200px !important; height: 200px !important; }
.wpb-share-btns { display: flex; flex-direction: column; gap: .5em; margin-top: .9em; }
.wpb-share-wa { display: flex; align-items: center; justify-content: center; gap: .5em; background: #25D366; color: #fff; border: 0; border-radius: 8px; padding: .7em 1em; font-weight: 600; text-decoration: none; }
.wpb-share-wa:hover { background: #1ebe5b; color: #fff; }
.wpb-wa-ico { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.wpb-share-copy { padding: .7em 1em; text-align: center; }

/* Modal de compartir (desde el historial) */
.wpb-share-modal { max-width: 360px; }
.wpb-share-modal-body { text-align: center; }
.wpb-share-modal-body .wpb-qr { margin: 0 auto; }
.wpb-share-modal-body .wpb-share-btns { margin: 1.1em auto 0; max-width: 280px; }
.wpb-view-name { font-size: 1.1em; margin: 0 0 .4em; }
.wpb-view-size { color: #6b7280; font-weight: 400; }
.wpb-view-desc { color: #374151; margin: 0 0 .8em; }
.wpb-view-meta { color: #6b7280; margin: 0 0 1.1em; }
a.wpb-upload-btn { text-decoration: none; display: inline-block; }
