/* ===========================================
   TIENDA FOTOS FÚTBOL - ESTILOS DARK/DORADO
   =========================================== */

:root {
    --dorado: #c9a84c;
    --dorado-hover: #b8963e;
    --negro: #111;
    --negro-card: #1a1a1a;
    --negro-panel: #141414;
    --borde: #2a2a2a;
    --texto: #f0f0f0;
    --texto-suave: #999;
}

.tff-tienda {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px 80px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--negro);
    color: var(--texto);
}

.tff-titulo {
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--texto);
}

.tff-volver {
    display: inline-block;
    margin-bottom: 15px;
    text-decoration: none;
    color: var(--dorado);
    font-weight: 600;
    letter-spacing: 1px;
    font-size: 13px;
}

.tff-volver:hover { color: var(--dorado-hover); }

/* ---------- Carpetas por fecha ---------- */
.tff-grid-carpetas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.tff-carpeta {
    display: block;
    text-decoration: none;
    color: var(--texto);
    border-radius: 10px;
    overflow: hidden;
    background: var(--negro-card);
    border: 1px solid var(--borde);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tff-carpeta:hover {
    transform: translateY(-4px);
    border-color: var(--dorado);
    box-shadow: 0 8px 24px rgba(201,168,76,0.15);
}

.tff-carpeta-img {
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #222;
}

.tff-carpeta-img.tff-sin-imagen {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 32px;
}

.tff-carpeta-info {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid var(--borde);
}

.tff-carpeta-nombre {
    font-weight: 700;
    font-size: 14px;
    color: var(--texto);
}

.tff-carpeta-fecha {
    font-size: 12px;
    color: var(--texto-suave);
}

.tff-carpeta-cantidad {
    font-size: 12px;
    color: var(--dorado);
    font-weight: 600;
}

/* ---------- Buscador ---------- */
.tff-buscador-wrap {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tff-buscador {
    width: 100%;
    max-width: 400px;
    padding: 10px 18px;
    border: 1px solid var(--borde);
    border-radius: 25px;
    background: var(--negro-card);
    color: var(--texto);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.tff-buscador:focus { border-color: var(--dorado); }
.tff-buscador::placeholder { color: #555; }

.tff-buscador-resultado {
    font-size: 13px;
    color: var(--dorado);
    font-weight: 600;
}

.tff-foto-card.tff-oculta { display: none; }

/* ---------- Filtros de categoría ---------- */
.tff-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tff-filtro {
    padding: 7px 18px;
    border-radius: 20px;
    background: var(--negro-card);
    border: 1px solid var(--borde);
    color: var(--texto-suave);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.15s ease;
}

.tff-filtro:hover {
    border-color: var(--dorado);
    color: var(--dorado);
}

.tff-filtro.activo {
    background: var(--dorado);
    border-color: var(--dorado);
    color: #000;
}

/* ---------- Grilla de fotos ---------- */
.tff-grid-fotos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.tff-foto-card {
    background: var(--negro-card);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--borde);
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.tff-foto-card:hover {
    border-color: var(--dorado);
    transform: translateY(-2px);
}

.tff-foto-img-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.tff-foto-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.tff-foto-card:hover .tff-foto-img-wrap img {
    transform: scale(1.04);
}

.tff-precio-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--dorado);
    color: #000;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.tff-btn-agregar {
    border: none;
    background: #1a1a1a;
    color: var(--dorado);
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    border-top: 1px solid var(--borde);
    transition: background 0.15s ease, color 0.15s ease;
    text-transform: uppercase;
}

.tff-btn-agregar:hover {
    background: var(--dorado);
    color: #000;
}

.tff-btn-agregar.tff-agregado {
    background: #2a2a2a;
    color: #666;
}

/* ---------- Carrito flotante ---------- */
#tff-carrito-flotante {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

#tff-abrir-carrito {
    background: var(--dorado);
    color: #000;
    border: none;
    border-radius: 50px;
    padding: 14px 20px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(201,168,76,0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease;
}

#tff-abrir-carrito:hover { background: var(--dorado-hover); }

#tff-contador-carrito {
    background: #000;
    color: var(--dorado);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Panel del carrito ---------- */
#tff-carrito-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    max-width: 90vw;
    height: 100vh;
    background: var(--negro-panel);
    border-left: 1px solid var(--borde);
    box-shadow: -8px 0 32px rgba(0,0,0,0.6);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
}

#tff-carrito-panel.tff-oculto {
    transform: translateX(100%);
    visibility: hidden;
}

.tff-carrito-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--borde);
}

.tff-carrito-header h3 {
    color: var(--texto);
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
}

#tff-cerrar-carrito {
    border: none;
    background: none;
    color: var(--texto-suave);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease;
}

#tff-cerrar-carrito:hover { color: var(--dorado); }

#tff-carrito-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
}

#tff-carrito-items::-webkit-scrollbar { width: 4px; }
#tff-carrito-items::-webkit-scrollbar-track { background: #1a1a1a; }
#tff-carrito-items::-webkit-scrollbar-thumb { background: var(--borde); border-radius: 2px; }

.tff-item-carrito {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--borde);
}

.tff-item-carrito img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--borde);
    flex-shrink: 0;
}

.tff-item-info { flex: 1; }

.tff-item-nombre {
    font-size: 13px;
    font-weight: 600;
    color: var(--texto);
    margin-bottom: 3px;
}

.tff-item-precio {
    font-size: 13px;
    color: var(--dorado);
    font-weight: 700;
}

.tff-item-quitar {
    border: none;
    background: none;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.15s ease;
}

.tff-item-quitar:hover { color: #c0392b; }

.tff-carrito-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--borde);
    background: #0d0d0d;
}

.tff-carrito-footer p {
    font-size: 15px;
    margin: 0 0 12px;
    color: var(--texto);
    display: flex;
    justify-content: space-between;
}

.tff-carrito-footer p strong { color: var(--dorado); }

#tff-btn-checkout {
    width: 100%;
    background: #25D366;
    color: #fff;
    border: none;
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#tff-btn-checkout:hover { background: #1fb955; }

.tff-carrito-vacio {
    text-align: center;
    color: #444;
    padding: 40px 10px;
    font-size: 14px;
}

@media (max-width: 600px) {
    .tff-grid-fotos {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .tff-grid-carpetas {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* ---------- Carrusel de trabajos ---------- */
.tff-carrusel-wrap {
    padding: 50px 0;
    background: #0d0d0d;
    overflow: hidden;
}

.tff-carrusel-titulo {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.tff-carrusel-label {
    font-size: 10px;
    letter-spacing: 4px;
    color: #c9a84c;
    display: block;
    margin-bottom: 8px;
}

.tff-carrusel-h2 {
    font-size: 24px;
    color: #fff;
    margin: 0;
    font-weight: 500;
}

.tff-carrusel-outer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
}

.tff-carrusel-track-wrap {
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
}

.tff-carrusel-track {
    display: flex;
    gap: 12px;
    transition: transform 0.4s ease;
    will-change: transform;
}

.tff-carrusel-slide {
    flex: 0 0 calc(25% - 9px);
    min-width: 0;
}

.tff-carrusel-img-wrap {
    position: relative;
    aspect-ratio: 3/2;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    cursor: pointer;
}

.tff-carrusel-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.tff-carrusel-img-wrap:hover img {
    transform: scale(1.06);
}

.tff-carrusel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.tff-carrusel-img-wrap:hover .tff-carrusel-overlay {
    opacity: 1;
}

.tff-carrusel-partido {
    font-size: 11px;
    color: #c9a84c;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.tff-carrusel-precio {
    font-size: 14px;
    color: #fff;
    font-weight: 700;
}

.tff-carrusel-btn {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #c9a84c;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tff-carrusel-btn:hover {
    background: #c9a84c;
    color: #000;
    border-color: #c9a84c;
}

.tff-carrusel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.tff-carrusel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #333;
    cursor: pointer;
    transition: background 0.2s ease;
    border: none;
}

.tff-carrusel-dot.activo {
    background: #c9a84c;
}

@media (max-width: 768px) {
    .tff-carrusel-slide {
        flex: 0 0 calc(50% - 6px);
    }
}

@media (max-width: 480px) {
    .tff-carrusel-slide {
        flex: 0 0 calc(100%);
    }
}

/* ---------- Lightbox ---------- */
/* ===== LIGHTBOX ===== */
.tff-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    transition: opacity 0.25s ease;
}

.tff-lightbox.tff-oculto {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.tff-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.96);
    cursor: pointer;
}

/* Botón cerrar — esquina superior derecha */
.tff-lightbox-cerrar {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 100001;
    background: rgba(255,255,255,0.12);
    border: 1px solid #555;
    color: #fff;
    font-size: 26px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}
.tff-lightbox-cerrar:hover { background: #c9a84c; color: #000; border-color: #c9a84c; }

/* Contenido: flechas + imagen alineadas horizontalmente */
.tff-lightbox-contenido {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 56px 10px 44px;
    box-sizing: border-box;
    pointer-events: none;
}

.tff-lightbox-contenido > * {
    pointer-events: all;
}

/* Imagen centrada */
.tff-lightbox-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-width: 0;
    position: relative;
}

#tff-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
    transition: opacity 0.2s ease;
}

#tff-lightbox-img.cargando { opacity: 0; }

/* Spinner */
.tff-lightbox-spinner {
    position: absolute;
    width: 36px;
    height: 36px;
    border: 3px solid #333;
    border-top-color: #c9a84c;
    border-radius: 50%;
    animation: tff-spin 0.7s linear infinite;
    display: none;
}
.tff-lightbox-img-wrap.cargando .tff-lightbox-spinner { display: block; }

@keyframes tff-spin { to { transform: rotate(360deg); } }

/* Flechas */
.tff-lightbox-prev,
.tff-lightbox-next {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid #555;
    color: #c9a84c;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.tff-lightbox-prev:hover,
.tff-lightbox-next:hover { background: #c9a84c; color: #000; border-color: #c9a84c; }

/* Título abajo */
.tff-lightbox-titulo {
    position: fixed;
    bottom: 12px;
    left: 0;
    right: 0;
    text-align: center;
    color: #c9a84c;
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: 600;
    margin: 0;
    z-index: 100001;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 20px;
}

.tff-carrusel-ver {
    font-size: 11px;
    color: #fff;
    opacity: 0.8;
    margin-top: 4px;
    display: block;
}

.tff-lightbox-trigger { cursor: pointer; }

/* ---------- Carrusel 3D ---------- */
.tff-carrusel-wrap {
    padding: 50px 0;
    background: #0d0d0d;
    overflow: hidden;
}

.tff-carrusel-3d-outer {
    position: relative;
    height: 380px;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tff-carrusel-3d-track {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.tff-carrusel-3d-slide {
    position: absolute;
    width: 240px;
    height: 320px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid #2a2a2a;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.tff-carrusel-3d-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.tff-carrusel-3d-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tff-carrusel-3d-slide.tff-slide-centro .tff-carrusel-3d-overlay {
    opacity: 1;
}

.tff-carrusel-3d-slide .tff-carrusel-partido {
    font-size: 12px;
    color: #c9a84c;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tff-carrusel-3d-slide .tff-carrusel-ver {
    font-size: 11px;
    color: #fff;
    opacity: 0.7;
    margin-top: 3px;
}

/* Slide CENTRO */
.tff-slide-centro {
    transform: translate(-50%, -50%) translateZ(0px) rotateY(0deg) !important;
    opacity: 1 !important;
    z-index: 5;
    border-color: #c9a84c;
    box-shadow: 0 24px 80px rgba(201,168,76,0.2);
}

/* Slide IZQUIERDA 1 */
.tff-slide-izq1 {
    transform: translate(-50%, -50%) translateX(-260px) translateZ(-120px) rotateY(25deg) !important;
    opacity: 0.5 !important;
    z-index: 3;
}

/* Slide IZQUIERDA 2 */
.tff-slide-izq2 {
    transform: translate(-50%, -50%) translateX(-460px) translateZ(-250px) rotateY(35deg) !important;
    opacity: 0.25 !important;
    z-index: 2;
}

/* Slide DERECHA 1 */
.tff-slide-der1 {
    transform: translate(-50%, -50%) translateX(260px) translateZ(-120px) rotateY(-25deg) !important;
    opacity: 0.5 !important;
    z-index: 3;
}

/* Slide DERECHA 2 */
.tff-slide-der2 {
    transform: translate(-50%, -50%) translateX(460px) translateZ(-250px) rotateY(-35deg) !important;
    opacity: 0.25 !important;
    z-index: 2;
}

/* Slides ocultos */
.tff-slide-oculto {
    opacity: 0 !important;
    pointer-events: none;
    z-index: 1;
}

.tff-carrusel-3d-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(201,168,76,0.15);
    border: 1px solid #c9a84c;
    color: #c9a84c;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.tff-carrusel-3d-btn:hover {
    background: #c9a84c;
    color: #000;
}

.tff-carrusel-3d-btn.tff-3d-prev { left: 16px; }
.tff-carrusel-3d-btn.tff-3d-next { right: 16px; }

@media (max-width: 600px) {
    .tff-carrusel-3d-outer { height: 280px; }
    .tff-carrusel-3d-slide { width: 170px; height: 230px; }
    .tff-slide-izq1 { transform: translate(-50%, -50%) translateX(-180px) translateZ(-80px) rotateY(25deg) !important; }
    .tff-slide-izq2 { transform: translate(-50%, -50%) translateX(-320px) translateZ(-180px) rotateY(35deg) !important; }
    .tff-slide-der1 { transform: translate(-50%, -50%) translateX(180px) translateZ(-80px) rotateY(-25deg) !important; }
    .tff-slide-der2 { transform: translate(-50%, -50%) translateX(320px) translateZ(-180px) rotateY(-35deg) !important; }
}
