/* ==========================================
   TOUR MASTER GALLERY ADDON - ENHANCED STYLES
   Version: 2.0 con Overlay2
   Author: Beder Axel
   ========================================== */

/* Variables CSS para fácil personalización */
:root {
    --sgg-primary: #007cba;
    --sgg-primary-dark: #005a87;
    --sgg-overlay: rgba(0, 0, 0, 0.4);
    --sgg-overlay-dark: rgba(0, 0, 0, 0.6);
    --sgg-border-radius: 15px;
    --sgg-border-radius-small: 8px;
    --sgg-transition: all 0.3s ease;
    --sgg-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --sgg-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.2);
    --sgg-gradient-video: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --sgg-gradient-play: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

/* Estilos base comunes */
.sgg-gallery-wrapper {
    max-width: 100%;
    margin: auto;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    box-sizing: border-box;
}

.sgg-gallery-wrapper *,
.sgg-gallery-wrapper *::before,
.sgg-gallery-wrapper *::after {
    box-sizing: border-box;
}

/* ==========================================
   ESTILO 1: CLÁSICO (Mejorado)
   ========================================== */
.sgg-style-classic {
    max-width: 800px;
    text-align: center;
}

.sgg-style-classic .sgg-main-image {
    position: relative;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: var(--sgg-border-radius);
}

.sgg-style-classic .sgg-main-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--sgg-border-radius);
    box-shadow: var(--sgg-shadow);
    transition: transform 0.4s ease;
    display: block;
}

.sgg-style-classic .sgg-main-image:hover img {
    transform: scale(1.02);
}

.sgg-style-classic .sgg-thumbnails-wrapper {
    overflow-x: auto;
    padding: 20px 0 10px 0;
    margin-top: 15px;
    position: relative;
}

.sgg-style-classic .sgg-thumbnails {
    display: flex;
    gap: 15px;
    padding: 5px;
    min-width: min-content;
}

.sgg-style-classic .sgg-thumb {
    flex: 0 0 calc(25% - 12px);
    max-width: calc(25% - 12px);
    min-width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--sgg-border-radius-small);
    cursor: pointer;
    opacity: 0.7;
    transition: var(--sgg-transition);
    border: 3px solid transparent;
    display: block;
}

.sgg-style-classic .sgg-thumb:hover {
    opacity: 1;
    transform: translateY(-8px);
    border-color: var(--sgg-primary);
    box-shadow: 0 10px 25px rgba(0, 124, 186, 0.3);
}

.sgg-style-classic .sgg-thumb.active {
    opacity: 1;
    border-color: var(--sgg-primary);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 124, 186, 0.4);
}

.sgg-style-classic .sgg-video-thumb {
    flex: 0 0 calc(25% - 12px);
    max-width: calc(25% - 12px);
    min-width: 120px;
    height: 120px;
    background: var(--sgg-gradient-video);
    border-radius: var(--sgg-border-radius-small);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: var(--sgg-transition);
    border: 3px solid transparent;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sgg-style-classic .sgg-video-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.sgg-style-classic .sgg-video-thumb:hover::before {
    transform: translateX(100%);
}

.sgg-style-classic .sgg-video-thumb:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.sgg-style-classic .sgg-play-icon {
    font-size: 24px;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.sgg-style-classic .sgg-video-thumb span {
    font-size: 12px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

/* ==========================================
   ESTILO 2: OVERLAY (Original)
   ========================================== */
.sgg-style-overlay {
    max-width: 1200px;
}

.sgg-overlay-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: 500px;
    border-radius: var(--sgg-border-radius);
    overflow: hidden;
}

.sgg-main-image-overlay {
    position: relative;
    overflow: hidden;
    border-radius: var(--sgg-border-radius);
    box-shadow: var(--sgg-shadow);
    height: 100%;
    width: 100%;
}

.sgg-main-image-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.5s ease;
    display: block;
}

.sgg-main-image-overlay:hover img {
    transform: scale(1.05);
}

/* Overlay cuadrado en imagen principal */
.sgg-main-image-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 0, 0, 0.6);
    transform: translate(-50%, -50%);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 0;
    z-index: 5;
}

.sgg-main-image-overlay:hover::before {
    width: 100%;
    height: 100%;
}

/* Ícono profesional en imagen principal */
.sgg-main-image-overlay::after {
    content: '⊕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 32px;
    color: white;
    opacity: 0;
    transition: all 0.3s ease 0.1s;
    z-index: 10;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    font-weight: normal;
}

.sgg-main-image-overlay:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* GRID LATERAL - 2x2 CUADRADOS PERFECTOS */
.sgg-overlay-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    height: 100%;
    width: 400px;
}

/* CONTENEDOR DE CADA CUADRADO */
.sgg-overlay-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    background: #f5f5f5;
    transition: var(--sgg-transition);
    width: 100%;
    height: 100%;
}

.sgg-overlay-item:hover {
    transform: scale(1.02);
    box-shadow: var(--sgg-shadow);
}

/* IMÁGENES QUE LLENAN TODO EL CUADRADO */
.sgg-overlay-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.4s ease;
    display: block;
    border-radius: 12px;
}

/* OVERLAY CUADRADO QUE SE EXPANDE */
.sgg-overlay-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 5;
}

.sgg-overlay-item:hover .sgg-overlay-hover {
    opacity: 1;
}

/* Efecto de zoom en la imagen */
.sgg-overlay-item:hover img {
    transform: scale(1.1);
}

/* Ícono profesional que aparece en el centro */
.sgg-overlay-hover::before {
    content: '⊕';
    font-size: 24px;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease 0.1s;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    z-index: 10;
    font-weight: normal;
}

.sgg-overlay-item:hover .sgg-overlay-hover::before {
    opacity: 1;
    transform: scale(1);
}

/* "VIEW MORE IMAGES" - CUADRADO CON TEXTO */
.sgg-overlay-more {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    z-index: 10;
    border-radius: 12px;
    transition: background 0.3s ease;
}

.sgg-overlay-item.sgg-has-more:hover .sgg-overlay-more {
    background: rgba(0, 0, 0, 0.8);
}

.sgg-overlay-more::before {
    content: '+';
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

.sgg-overlay-more span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quitar el overlay hover normal cuando hay "more" */
.sgg-overlay-item.sgg-has-more .sgg-overlay-hover {
    display: none;
}

/* VIDEO ITEM - CUADRADO CON "WATCH VIDEO" */
.sgg-video-item {
    background: var(--sgg-gradient-video);
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    /* SIN HOVER EFFECTS */
    transition: none;
}

.sgg-video-item:hover {
    transform: none;
    box-shadow: none;
}

.sgg-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 2;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
}

.sgg-play-icon-large {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.sgg-video-placeholder span {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* QUITAR OVERLAY HOVER DEL VIDEO */
.sgg-video-item .sgg-overlay-hover {
    display: none;
}

/* ==========================================
   ESTILO 2B: OVERLAY2 (Nuevo - Lightbox directo)
   ========================================== */
.sgg-style-overlay2 {
    max-width: 1200px;
}

/* Reutilizar estilos de overlay container y grid */
.sgg-style-overlay2 .sgg-overlay-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: 500px;
    border-radius: var(--sgg-border-radius);
    overflow: hidden;
}

.sgg-style-overlay2 .sgg-overlay-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    height: 100%;
    width: 400px;
}

/* Imagen principal de overlay2 con efecto lightbox */
.sgg-style-overlay2 .sgg-main-image-overlay {
    position: relative;
    overflow: hidden;
    border-radius: var(--sgg-border-radius);
    box-shadow: var(--sgg-shadow);
    height: 100%;
    width: 100%;
    cursor: pointer;
}

.sgg-style-overlay2 .sgg-main-image-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.5s ease;
    display: block;
}

.sgg-style-overlay2 .sgg-main-image-overlay:hover img {
    transform: scale(1.05);
}

/* Overlay especial para overlay2 */
.sgg-overlay2-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--sgg-border-radius);
    z-index: 5;
}

.sgg-style-overlay2 .sgg-main-image-overlay:hover .sgg-overlay2-hover {
    opacity: 1;
}

.sgg-zoom-icon-overlay2 {
    color: white;
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    animation: bounce 0.6s ease;
}

/* Items de overlay2 con efecto lightbox */
.sgg-style-overlay2 .sgg-overlay-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    background: #f5f5f5;
    transition: var(--sgg-transition);
    width: 100%;
    height: 100%;
}

.sgg-style-overlay2 .sgg-overlay-item:hover {
    transform: scale(1.02);
    box-shadow: var(--sgg-shadow);
}

.sgg-style-overlay2 .sgg-overlay-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.4s ease;
    display: block;
    border-radius: 12px;
}

.sgg-style-overlay2 .sgg-overlay-item:hover img {
    transform: scale(1.1);
}

/* Overlay hover para overlay2 items */
.sgg-style-overlay2 .sgg-overlay-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 5;
}

.sgg-style-overlay2 .sgg-overlay-item:hover .sgg-overlay-hover {
    opacity: 1;
}

/* Ícono zoom para overlay2 items normales */
.sgg-style-overlay2 .sgg-overlay-hover .sgg-zoom-icon-overlay2 {
    color: white;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    animation: bounce 0.6s ease;
}

/* View More en overlay2 mantiene el mismo estilo */
.sgg-style-overlay2 .sgg-overlay-more {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    z-index: 10;
    border-radius: 12px;
    transition: background 0.3s ease;
}

.sgg-style-overlay2 .sgg-overlay-item.sgg-has-more:hover .sgg-overlay-more {
    background: rgba(0, 0, 0, 0.8);
}

.sgg-style-overlay2 .sgg-overlay-more::before {
    content: '+';
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

.sgg-style-overlay2 .sgg-overlay-more span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Video items en overlay2 */
.sgg-style-overlay2 .sgg-video-item {
    background: var(--sgg-gradient-video);
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    transition: none;
}

.sgg-style-overlay2 .sgg-video-item:hover {
    transform: none;
    box-shadow: none;
}

.sgg-style-overlay2 .sgg-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 2;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
}

.sgg-style-overlay2 .sgg-play-icon-large {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.sgg-style-overlay2 .sgg-video-placeholder span {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   ESTILO 3: MODERNO
   ========================================== */
.sgg-style-modern {
    max-width: 900px;
}

.sgg-modern-container {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--sgg-shadow);
    transition: var(--sgg-transition);
}

.sgg-modern-container:hover {
    box-shadow: var(--sgg-shadow-hover);
}

.sgg-modern-main {
    position: relative;
    height: 450px;
    overflow: hidden;
}

.sgg-modern-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.sgg-modern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.3) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sgg-modern-main:hover .sgg-modern-overlay {
    opacity: 1;
}

.sgg-modern-main:hover img {
    transform: scale(1.05);
}

.sgg-modern-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 25px;
    pointer-events: none;
}

.sgg-nav-prev, 
.sgg-nav-next {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 24px;
    cursor: pointer;
    transition: var(--sgg-transition);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    color: var(--sgg-primary);
    font-weight: bold;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sgg-nav-prev:hover, 
.sgg-nav-next:hover {
    background: white;
    transform: scale(1.15);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
    color: var(--sgg-primary-dark);
}

.sgg-modern-thumbs {
    display: flex;
    padding: 25px;
    gap: 20px;
    overflow-x: auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid #dee2e6;
}

.sgg-modern-thumb {
    flex: 0 0 85px;
    height: 85px;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--sgg-transition);
    border: 3px solid transparent;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sgg-modern-thumb::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sgg-modern-thumb.active::after,
.sgg-modern-thumb:hover::after {
    opacity: 0;
}

.sgg-modern-thumb.active {
    border-color: var(--sgg-primary);
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.3);
}

.sgg-modern-thumb:hover:not(.active) {
    transform: scale(1.08);
    border-color: rgba(0, 124, 186, 0.5);
}

.sgg-modern-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sgg-modern-thumb.sgg-video-thumb {
    background: var(--sgg-gradient-play);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

/* ==========================================
   ESTILO 4: CAROUSEL
   ========================================== */
.sgg-style-carousel {
    max-width: 800px;
}

.sgg-carousel-container {
    position: relative;
    background: white;
    border-radius: var(--sgg-border-radius);
    overflow: hidden;
    box-shadow: var(--sgg-shadow);
    transition: var(--sgg-transition);
}

.sgg-carousel-container:hover {
    box-shadow: var(--sgg-shadow-hover);
}

.sgg-carousel-wrapper {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.sgg-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sgg-carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
}

.sgg-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sgg-video-slide {
    background: var(--sgg-gradient-video);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sgg-video-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
}

.sgg-play-button {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 25px 45px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--sgg-transition);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

.sgg-play-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.sgg-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid #dee2e6;
}

.sgg-carousel-prev, 
.sgg-carousel-next {
    background: var(--sgg-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 20px;
    cursor: pointer;
    transition: var(--sgg-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0, 124, 186, 0.3);
}

.sgg-carousel-prev:hover, 
.sgg-carousel-next:hover {
    background: var(--sgg-primary-dark);
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.4);
}

.sgg-carousel-indicators {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sgg-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: var(--sgg-transition);
    position: relative;
}

.sgg-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transition: var(--sgg-transition);
}

.sgg-indicator.active {
    background: var(--sgg-primary);
    transform: scale(1.3);
}

.sgg-indicator.active::after {
    opacity: 1;
}

.sgg-indicator:hover:not(.active) {
    background: #bbb;
    transform: scale(1.1);
}

/* ==========================================
   ESTILO 5: MASONRY
   ========================================== */
.sgg-style-masonry {
    max-width: 1000px;
}

.sgg-masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: 200px;
    gap: 20px;
    padding: 25px 0;
}

.sgg-masonry-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--sgg-border-radius);
    cursor: pointer;
    background: #f5f5f5;
    transition: var(--sgg-transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sgg-masonry-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--sgg-shadow-hover);
}

.sgg-masonry-item.sgg-tall {
    grid-row: span 2;
}

.sgg-masonry-item.sgg-wide {
    grid-column: span 2;
}

.sgg-masonry-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.sgg-masonry-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--sgg-overlay-dark);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.sgg-masonry-item:hover .sgg-masonry-overlay {
    opacity: 1;
}

.sgg-masonry-item:hover img {
    transform: scale(1.15);
}

.sgg-zoom-icon {
    color: white;
    font-size: 28px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.sgg-video-masonry {
    background: var(--sgg-gradient-play);
    position: relative;
}

.sgg-video-masonry::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 1s ease;
}

.sgg-video-masonry:hover::before {
    transform: translateX(100%);
}

.sgg-video-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    z-index: 2;
}

.sgg-play-icon-masonry {
    font-size: 36px;
    margin-bottom: 12px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.sgg-video-content span {
    font-size: 16px;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* ==========================================
   SCROLLBAR PERSONALIZADO
   ========================================== */
.sgg-thumbnails-wrapper::-webkit-scrollbar,
.sgg-modern-thumbs::-webkit-scrollbar {
    height: 8px;
}

.sgg-thumbnails-wrapper::-webkit-scrollbar-track,
.sgg-modern-thumbs::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.sgg-thumbnails-wrapper::-webkit-scrollbar-thumb,
.sgg-modern-thumbs::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--sgg-primary), var(--sgg-primary-dark));
    border-radius: 4px;
    transition: var(--sgg-transition);
}

.sgg-thumbnails-wrapper::-webkit-scrollbar-thumb:hover,
.sgg-modern-thumbs::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--sgg-primary-dark), var(--sgg-primary));
}

/* Para Firefox */
.sgg-thumbnails-wrapper,
.sgg-modern-thumbs {
    scrollbar-width: thin;
    scrollbar-color: var(--sgg-primary) rgba(0, 0, 0, 0.05);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Large Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .sgg-overlay-container,
    .sgg-style-overlay2 .sgg-overlay-container {
        grid-template-columns: 1fr 350px;
        height: 450px;
    }
    
    .sgg-overlay-grid,
    .sgg-style-overlay2 .sgg-overlay-grid {
        width: 350px;
    }
    
    .sgg-masonry-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Tablets (768px) */
@media (max-width: 768px) {
    .sgg-overlay-container,
    .sgg-style-overlay2 .sgg-overlay-container {
        grid-template-columns: 1fr;
        grid-template-rows: 300px auto;
        height: auto;
        gap: 15px;
    }
    
    .sgg-overlay-grid,
    .sgg-style-overlay2 .sgg-overlay-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: 90px;
        gap: 8px;
        height: 90px;
        width: 100%;
    }
    
    .sgg-overlay-item,
    .sgg-style-overlay2 .sgg-overlay-item {
        height: 90px;
    }
    
    .sgg-overlay-more::before,
    .sgg-style-overlay2 .sgg-overlay-more::before {
        font-size: 24px;
        margin-bottom: 4px;
    }
    
    .sgg-overlay-more span,
    .sgg-style-overlay2 .sgg-overlay-more span {
        font-size: 10px;
    }
    
    .sgg-play-icon-large,
    .sgg-style-overlay2 .sgg-play-icon-large {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .sgg-video-placeholder span,
    .sgg-style-overlay2 .sgg-video-placeholder span {
        font-size: 10px;
    }
    
    .sgg-style-classic .sgg-thumb,
    .sgg-style-classic .sgg-video-thumb {
        flex: 0 0 calc(33.333% - 10px);
        max-width: calc(33.333% - 10px);
        min-width: 100px;
        height: 100px;
    }
    
    .sgg-masonry-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        grid-auto-rows: 150px;
        gap: 15px;
    }
    
    .sgg-modern-main,
    .sgg-carousel-wrapper {
        height: 300px;
    }
    
    .sgg-modern-thumbs {
        padding: 20px;
        gap: 15px;
    }
    
    .sgg-modern-thumb {
        flex: 0 0 70px;
        height: 70px;
    }
    
    .sgg-carousel-controls {
        padding: 20px;
        gap: 15px;
    }
    
    .sgg-nav-prev, 
    .sgg-nav-next {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .sgg-carousel-prev,
    .sgg-carousel-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* Mobile (480px) */
@media (max-width: 480px) {
    .sgg-style-classic .sgg-thumb,
    .sgg-style-classic .sgg-video-thumb {
        flex: 0 0 calc(50% - 8px);
        max-width: calc(50% - 8px);
        min-width: 80px;
        height: 80px;
    }
    
    .sgg-style-classic .sgg-thumbnails {
        gap: 8px;
        padding: 5px 10px;
    }
    
    .sgg-overlay-container,
    .sgg-style-overlay2 .sgg-overlay-container {
        grid-template-rows: 220px auto;
        gap: 12px;
    }
    
    .sgg-overlay-grid,
    .sgg-style-overlay2 .sgg-overlay-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 70px);
        gap: 6px;
        height: 146px;
    }
    
    .sgg-overlay-item,
    .sgg-style-overlay2 .sgg-overlay-item {
        height: 70px;
        border-radius: 8px;
    }
    
    .sgg-overlay-item img,
    .sgg-style-overlay2 .sgg-overlay-item img,
    .sgg-overlay-hover,
    .sgg-style-overlay2 .sgg-overlay-hover,
    .sgg-overlay-more,
    .sgg-style-overlay2 .sgg-overlay-more,
    .sgg-video-placeholder,
    .sgg-style-overlay2 .sgg-video-placeholder {
        border-radius: 8px;
    }
    
    .sgg-overlay-more::before,
    .sgg-style-overlay2 .sgg-overlay-more::before {
        font-size: 20px;
        margin-bottom: 2px;
    }
    
    .sgg-overlay-more span,
    .sgg-style-overlay2 .sgg-overlay-more span {
        font-size: 8px;
    }
    
    .sgg-play-icon-large,
    .sgg-style-overlay2 .sgg-play-icon-large {
        width: 30px;
        height: 30px;
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .sgg-video-placeholder span,
    .sgg-style-overlay2 .sgg-video-placeholder span {
        font-size: 8px;
    }
    
    .sgg-masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 120px;
        gap: 10px;
        padding: 15px 10px;
    }
    
    .sgg-modern-main,
    .sgg-carousel-wrapper {
        height: 220px;
    }
    
    .sgg-modern-thumbs {
        padding: 15px 10px;
        gap: 10px;
    }
    
    .sgg-modern-thumb {
        flex: 0 0 60px;
        height: 60px;
        border-radius: 10px;
    }
    
    .sgg-modern-nav {
        padding: 0 15px;
    }
    
    .sgg-nav-prev, 
    .sgg-nav-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .sgg-carousel-controls {
        padding: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .sgg-carousel-prev,
    .sgg-carousel-next {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .sgg-indicator {
        width: 10px;
        height: 10px;
    }
    
    .sgg-play-button {
        padding: 15px 25px;
        font-size: 14px;
    }
}