/* ==========================================================
   Fotos (galería) — diseñado primero para el celular.
   Requiere marca.css (colores y tipografía de Parchaoo).
   ========================================================== */

/* En estas páginas la barra inferior reemplaza al carrito flotante */
.btn-carrito-fotos-flotante { display: none !important; }
body.pf-con-barra .btn-whatsapp-flotante { bottom: calc(92px + env(safe-area-inset-bottom)) !important; }

.pf { padding-bottom: 6rem; }

/* ---------------- Encabezado ---------------- */
.pf-volver {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
    color: var(--pc-azul);
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
}

.pf-titulo {
    margin: 0;
    font-family: var(--pc-display);
    font-weight: 800;
    font-size: clamp(1.45rem, 5.4vw, 2.6rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--pc-tinta);
}

.pf-meta {
    margin: 0.45rem 0 0;
    color: var(--pc-tinta-suave);
    font-size: 0.9rem;
    font-weight: 600;
}

.pf-precios {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.pf-precios li {
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--pc-niebla-clara);
    color: var(--pc-tinta);
    font-size: 0.8rem;
    font-weight: 700;
}

.pf-precios li.pf-precio-pack { background: #e3f8f2; color: #05634f; }

/* ---------------- Buscar: selfie y dorsal ---------------- */
.pf-buscar {
    display: grid;
    gap: 0.6rem;
    margin: 1.2rem 0 0.9rem;
}

.pf-btn-selfie {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 54px;
    padding: 0 1rem;
    border-radius: 16px;
    background: var(--pc-azul);
    color: #ffffff !important;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(0, 72, 248, 0.25);
}

.pf-btn-selfie svg { width: 22px; height: 22px; flex-shrink: 0; }

.pf-dorsal {
    display: flex;
    gap: 0.5rem;
}

.pf-dorsal input {
    flex: 1;
    min-width: 0;
    height: 50px;
    padding: 0 1rem;
    border: 1.5px solid rgba(7, 26, 77, 0.14);
    border-radius: 14px;
    background: #ffffff;
    color: var(--pc-tinta);
    font-size: 1rem;  /* 16px: iOS no hace zoom al enfocar */
    font-weight: 700;
    outline: none;
}

.pf-dorsal input:focus { border-color: var(--pc-azul); box-shadow: 0 0 0 3px rgba(0, 72, 248, 0.15); }

.pf-dorsal button {
    height: 50px;
    padding: 0 1.1rem;
    border: none;
    border-radius: 14px;
    background: var(--pc-tinta);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
}

.pf-filtro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    background: #eef4ff;
    color: var(--pc-tinta);
    font-size: 0.88rem;
    font-weight: 700;
}

.pf-filtro a { color: var(--pc-azul); text-decoration: none; white-space: nowrap; }

.pf-ayuda {
    margin: 0 0 0.6rem;
    color: var(--pc-tinta-suave);
    font-size: 0.82rem;
}

/* ---------------- Rejilla (como la galería del celular) ---------------- */
.pf-rejilla {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    margin: 0 -1rem;  /* de borde a borde en el celular */
}

.pf-foto {
    position: relative;
    margin: 0;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--pc-niebla-clara);
}

.pf-foto-abrir {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.pf-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.18s ease;
    -webkit-user-drag: none;
    user-select: none;
}

/* Área táctil de 44px, círculo visible de 28px */
.pf-foto-check {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.pf-foto-check::before {
    content: "";
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: rgba(11, 21, 51, 0.28);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.pf-foto-check svg {
    position: relative;
    width: 16px;
    height: 16px;
    color: #ffffff;
    opacity: 0;
}

.pf-foto.is-elegida .pf-foto-check::before { background: var(--pc-azul); }
.pf-foto.is-elegida .pf-foto-check svg { opacity: 1; }
.pf-foto.is-elegida img { transform: scale(0.88); border-radius: 6px; }
.pf-foto.is-elegida { background: #dfe8ff; }

.pf-foto.is-pendiente .pf-foto-check { opacity: 0.5; pointer-events: none; }

.pf-mas {
    display: block;
    width: 100%;
    margin: 1.2rem 0 0;
    min-height: 48px;
    border: 1.5px solid rgba(0, 72, 248, 0.25);
    border-radius: 14px;
    background: #ffffff;
    color: var(--pc-azul);
    font-weight: 800;
    font-size: 0.95rem;
}

.pf-mas[disabled] { opacity: 0.6; }

/* ---------------- Barra inferior (lo elegido) ---------------- */
.pf-barra {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid rgba(7, 26, 77, 0.08);
    box-shadow: 0 -10px 30px rgba(7, 26, 77, 0.12);
    transform: translateY(110%);
    transition: transform 0.25s ease;
}

.pf-barra.is-visible { transform: translateY(0); }

.pf-barra-info { display: grid; line-height: 1.2; }
.pf-barra-info strong { font-size: 1rem; color: var(--pc-tinta); }
.pf-barra-info span { font-size: 0.85rem; font-weight: 700; color: var(--pc-tinta-suave); }

.pf-barra-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 48px;
    padding: 0 1.3rem;
    border-radius: 14px;
    background: var(--pc-azul);
    color: #ffffff !important;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    white-space: nowrap;
}

/* ---------------- Visor a pantalla completa ---------------- */
.pf-visor {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    background: #05070d;
    color: #ffffff;
    touch-action: pan-y;
}

.pf-visor[hidden] { display: none; }

.pf-visor-head,
.pf-visor-pie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
}

.pf-visor-head { padding-top: calc(0.75rem + env(safe-area-inset-top)); font-weight: 700; font-size: 0.9rem; }
.pf-visor-pie { padding-bottom: calc(0.9rem + env(safe-area-inset-bottom)); }

.pf-visor-cerrar,
.pf-visor-nav {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.pf-visor-escena {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pf-visor-escena img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transition: opacity 0.15s ease;
}

.pf-visor-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.pf-visor-prev { left: 0.6rem; }
.pf-visor-next { right: 0.6rem; }

.pf-visor-precio { font-weight: 800; font-size: 1.05rem; }
.pf-visor-precio small { display: block; font-size: 0.75rem; font-weight: 600; opacity: 0.7; }

.pf-visor-elegir {
    min-height: 50px;
    padding: 0 1.4rem;
    border: 0;
    border-radius: 14px;
    background: var(--pc-azul);
    color: #ffffff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
}

.pf-visor-elegir.is-elegida { background: var(--pc-verde); color: var(--pc-azul-noche); }

/* ---------------- Toast ---------------- */
.pf-toast {
    position: fixed;
    left: 50%;
    bottom: calc(96px + env(safe-area-inset-bottom));
    z-index: 10001;
    transform: translateX(-50%);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    background: var(--pc-tinta);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

/* ---------------- Inicio de Fotos: lista de eventos ---------------- */
.pf-inicio-buscar {
    display: flex;
    gap: 0.5rem;
    margin: 1.1rem 0 0.6rem;
}

.pf-inicio-buscar input {
    flex: 1;
    min-width: 0;
    height: 50px;
    padding: 0 1rem;
    border: 1.5px solid rgba(7, 26, 77, 0.14);
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
}

.pf-inicio-buscar input:focus { border-color: var(--pc-azul); }

.pf-inicio-buscar button {
    height: 50px;
    padding: 0 1.1rem;
    border: 0;
    border-radius: 14px;
    background: var(--pc-azul);
    color: #ffffff;
    font-weight: 800;
}

.pf-eventos {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.pf-evento a {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    align-items: center;
    gap: 0.9rem;
    padding: 0.55rem;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(7, 26, 77, 0.07);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.pf-evento a:hover { border-color: rgba(0, 72, 248, 0.3); box-shadow: 0 10px 24px rgba(7, 26, 77, 0.08); }

.pf-evento-img {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--pc-niebla-clara);
}

.pf-evento-texto { min-width: 0; }

.pf-evento-texto strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--pc-tinta);
}

.pf-evento-texto span {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--pc-tinta-suave);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pf-evento-texto .pf-evento-fotos { color: var(--pc-azul); font-weight: 800; }

.pf-evento-flecha { color: var(--pc-azul); font-size: 1.3rem; padding-right: 0.3rem; }

.pf-paginas {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.2rem;
    font-weight: 700;
    color: var(--pc-tinta-suave);
}

.pf-paginas a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 1rem;
    border-radius: 12px;
    border: 1.5px solid rgba(0, 72, 248, 0.25);
    color: var(--pc-azul);
    text-decoration: none;
}

/* ---------------- Pantallas grandes ---------------- */
@media (min-width: 640px) {
    .pf-rejilla { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
    .pf-foto { border-radius: 10px; }
    .pf-buscar { grid-template-columns: max-content minmax(0, 420px); justify-content: start; align-items: center; }
    .pf-btn-selfie { padding: 0 1.6rem; }
    .pf-eventos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .pf-rejilla { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
    .pf-foto:hover img { transform: scale(1.04); }
    .pf-foto.is-elegida:hover img { transform: scale(0.88); }
    .pf-barra { left: 50%; right: auto; bottom: 1.2rem; width: min(560px, 92vw); border-radius: 18px; transform: translate(-50%, 140%); }
    .pf-barra.is-visible { transform: translate(-50%, 0); }
    body.pf-con-barra .btn-whatsapp-flotante { bottom: 24px !important; }
    .pf-eventos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .pf-foto img, .pf-barra { transition: none; }
}

/* ---------------- Carrito ---------------- */
.pf-pack-aviso {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: #e3f8f2;
    color: #05634f;
    display: grid;
    gap: 0.2rem;
    font-size: 0.9rem;
}

.pf-pack-barra { height: 6px; margin-top: 0.45rem; border-radius: 999px; background: rgba(5, 99, 79, 0.15); overflow: hidden; }
.pf-pack-barra i { display: block; height: 100%; max-width: 100%; background: var(--pc-verde); border-radius: inherit; }

.pf-carrito-lista {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pf-carrito-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--pc-niebla-clara);
    transition: opacity 0.2s ease;
}

.pf-carrito-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pf-carrito-precio {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 0.15rem 0.45rem;
    border-radius: 8px;
    background: rgba(11, 21, 51, 0.75);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
}

.pf-carrito-quitar {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border: 0;
    background: none;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 900;
    cursor: pointer;
    z-index: 1;  /* contexto propio: el círculo queda sobre la foto */
}

.pf-carrito-quitar::before {
    content: "";
    position: absolute;
    inset: 8px;
    z-index: -1;
    border-radius: 50%;
    background: rgba(11, 21, 51, 0.65);
}

.pf-resumen {
    margin-top: 1.4rem;
    padding: 1rem;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(7, 26, 77, 0.08);
}

.pf-resumen-linea,
.pf-resumen-total {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    color: var(--pc-tinta-suave);
}

.pf-resumen-ahorro { color: #05634f; font-weight: 700; }

.pf-resumen-total {
    margin-top: 0.4rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--pc-niebla-clara);
    color: var(--pc-tinta);
    font-size: 1.05rem;
    font-weight: 800;
}

.pf-resumen-total strong { font-family: var(--pc-display); font-size: 1.3rem; }
.pf-resumen-nota { margin: 0.6rem 0 0; font-size: 0.8rem; color: var(--pc-tinta-suave); }

@media (min-width: 640px) {
    .pf-carrito-lista { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .pf-carrito-lista { grid-template-columns: repeat(8, minmax(0, 1fr)); }
    .pf-resumen { max-width: 520px; }
}

/* ---------------- Entrega (descargar) ---------------- */
.pf-entrega-head { text-align: center; }
.pf-entrega-check { width: 64px; height: 64px; margin-bottom: 0.6rem; }

.pf-entrega-ayuda {
    margin: 0 0 1rem;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    background: #eef4ff;
    color: var(--pc-tinta);
    font-size: 0.88rem;
    line-height: 1.5;
}

.pf-entrega-lista {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.pf-entrega-item {
    display: grid;
    gap: 6px;
}

.pf-entrega-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 14px;
    background: var(--pc-niebla-clara);
}

.pf-entrega-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    border-radius: 12px;
    background: var(--pc-azul);
    color: #ffffff !important;
    font-weight: 800;
    font-size: 0.92rem;
    text-decoration: none;
}

.pf-entrega-btn svg { width: 18px; height: 18px; }

/* Lo que solo tiene sentido con dedo o con ratón */
.pf-solo-raton { display: none !important; }
@media (pointer: fine) {
    .pf-solo-tactil { display: none; }
    .pf-solo-raton { display: flex !important; }
}

@media (min-width: 640px) {
    .pf-entrega-lista { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
