/* ===========================================
   OFPIC - Galería Mejorada v2.0
   Estilos para la galería de fotos con efectos
   =========================================== */

/* Grid de galería mejorado */
.galeria-mejorada {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px 0;
}

.galeria-mejorada .foto-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: #f5f5f5;
}

.galeria-mejorada .foto-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(244, 48, 68, 0.3);
}

.galeria-mejorada .foto-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.galeria-mejorada .foto-item:hover img {
    transform: scale(1.1);
}

/* Overlay con iconos */
.galeria-mejorada .foto-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(244, 48, 68, 0.8) 0%, rgba(214, 40, 57, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.galeria-mejorada .foto-item:hover .foto-overlay {
    opacity: 1;
}

.galeria-mejorada .foto-overlay .iconos-foto {
    display: flex;
    gap: 15px;
}

.galeria-mejorada .foto-overlay .icono-accion {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f43044;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.galeria-mejorada .foto-overlay .icono-accion:hover {
    transform: scale(1.2);
    background: #f43044;
    color: white;
}

/* Botón comprar debajo de la foto */
.galeria-mejorada .btn-comprar-foto {
    display: block;
    background: linear-gradient(135deg, #f43044 0%, #d62839 100%);
    color: white;
    text-align: center;
    padding: 12px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
}

.galeria-mejorada .btn-comprar-foto:hover {
    background: linear-gradient(135deg, #d62839 0%, #b71c1c 100%);
    color: white;
    text-decoration: none;
}

/* ===========================================
   Fancybox Personalizado
   =========================================== */

/* Barra de herramientas superior */
.fancybox-toolbar-ofpic {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    z-index: 99999;
}

.fancybox-toolbar-ofpic .btn-tool {
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.fancybox-toolbar-ofpic .btn-tool:hover {
    background: #f43044;
}

.fancybox-toolbar-ofpic .btn-tool.active {
    background: #f43044;
}

/* Contador de fotos */
.fancybox-contador {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 99999;
}

/* Thumbnails inferiores */
.fancybox-thumbs-ofpic {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    display: flex;
    justify-content: center;
    gap: 8px;
    overflow-x: auto;
    z-index: 99998;
}

.fancybox-thumbs-ofpic img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.fancybox-thumbs-ofpic img:hover,
.fancybox-thumbs-ofpic img.active {
    opacity: 1;
    border-color: #f43044;
}

/* Info de la foto */
.fancybox-info-foto {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    z-index: 99997;
}

/* Botón comprar en lightbox */
.fancybox-btn-comprar {
    position: absolute;
    bottom: 90px;
    right: 20px;
    background: linear-gradient(135deg, #f43044 0%, #d62839 100%);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 99999;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244, 48, 68, 0.4);
}

.fancybox-btn-comprar:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #d62839 0%, #b71c1c 100%);
    color: white;
    text-decoration: none;
}

/* Slideshow progress bar */
.slideshow-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: #f43044;
    z-index: 99999;
    transition: width 0.1s linear;
}

/* Navegación mejorada */
.fancybox-nav span {
    visibility: visible !important;
    background: rgba(244, 48, 68, 0.8) !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
}

.fancybox-nav:hover span {
    background: #f43044 !important;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.galeria-mejorada .foto-item {
    animation: fadeInUp 0.5s ease forwards;
}

.galeria-mejorada .foto-item:nth-child(1) { animation-delay: 0.05s; }
.galeria-mejorada .foto-item:nth-child(2) { animation-delay: 0.1s; }
.galeria-mejorada .foto-item:nth-child(3) { animation-delay: 0.15s; }
.galeria-mejorada .foto-item:nth-child(4) { animation-delay: 0.2s; }
.galeria-mejorada .foto-item:nth-child(5) { animation-delay: 0.25s; }

/* Responsive */
@media (max-width: 768px) {
    .galeria-mejorada {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .galeria-mejorada .foto-item img {
        height: 150px;
    }
    
    .fancybox-thumbs-ofpic {
        display: none;
    }
    
    .fancybox-btn-comprar {
        bottom: 20px;
        right: 10px;
        left: 10px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .galeria-mejorada {
        grid-template-columns: 1fr;
    }
    
    .galeria-mejorada .foto-item img {
        height: 200px;
    }
}

/* Vista lista alternativa */
.galeria-lista {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.galeria-lista .foto-item {
    display: flex;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.galeria-lista .foto-item img {
    width: 200px;
    height: 150px;
    object-fit: cover;
}

.galeria-lista .foto-info {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Toggle vista */
.galeria-toggle-vista {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

.galeria-toggle-vista button {
    padding: 8px 15px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.galeria-toggle-vista button.active,
.galeria-toggle-vista button:hover {
    border-color: #f43044;
    color: #f43044;
}

/* Loading skeleton */
.foto-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    height: 200px;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
