
.pg-gallery-container {
    display: flex; 
    gap: 30px; 
    font-family: Arial, sans-serif; 
    margin: 20px 0;
    align-items: flex-start;
}

/* Category Header Box */
.pg-category-header-box {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.pg-cat-header-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.pg-cat-header-desc {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

/* Sidebar Estándar Desktop */
.pg-sidebar {
    width: 280px; 
    min-width: 280px; 
    flex-shrink: 0; 
    border-radius: 4px; 
    padding: 25px 20px;
    background-color: var(--pg-sb-bg, #000);
    color: var(--pg-sb-text, #fff);
    box-sizing: border-box;
}

.pg-sidebar-title {
    color: inherit; 
    font-size: 16px; 
    font-weight: bold; 
    margin-bottom: 20px;
    padding-bottom: 10px; 
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pg-mobile-toggle-icon {
    display: none;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.pg-categories { list-style: none; padding: 0; margin: 0; }

.pg-cat-item {
    padding: 12px 15px; 
    cursor: pointer; 
    font-size: 14px; 
    font-weight: 600;
    transition: all 0.2s ease; 
    margin-bottom: 5px; 
    border-radius: 2px;
}

.pg-cat-item.active, .pg-cat-item:hover {
    background-color: var(--pg-accent, #E1FF00);
    color: #000000 !important;
}

/* Main Content Area */
.pg-main-content { 
    flex: 1 1 auto; 
    min-width: 0; 
    display: flex; 
    flex-direction: column; 
}

/* Type Filters Container with Navigation Arrows */
.pg-type-filters-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    width: 100%;
}

.pg-type-filters { 
    display: flex; 
    flex-wrap: nowrap; 
    overflow-x: auto; 
    gap: 10px; 
    padding: 5px 0;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
}
.pg-type-filters::-webkit-scrollbar { display: none; }

.pg-type-nav-btn {
    background: var(--pg-btn-bg, #000);
    color: #ffffff;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.pg-type-nav-btn:hover {
    background-color: var(--pg-accent, #E1FF00);
    color: #000000 !important;
}

.pg-type-prev { margin-right: 8px; }
.pg-type-next { margin-left: 8px; }

.pg-type-btn {
    background-color: var(--pg-btn-bg, #000);
    color: #fff; 
    border: none; 
    padding: 10px 22px; 
    font-weight: bold;
    font-size: 13px; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.2s ease;
    white-space: nowrap;
    flex: 0 0 auto;
}

.pg-type-btn.active, .pg-type-btn:hover {
    background-color: var(--pg-accent, #E1FF00);
    color: #000000 !important;
}

/* Cards, Titles, Description & Overlays */
.pg-card {
    position: relative; 
    background: #f5f5f5; 
    border-radius: 6px; 
    overflow: hidden;
    height: 100%; 
    display: flex;
    cursor: pointer;
}

.pg-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pg-card-info-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.82);
    color: #ffffff;
    padding: 8px 12px;
    text-align: center;
    z-index: 2;
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pg-card-title {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-card-description {
    font-size: 11px;
    font-weight: 400;
    color: #cbd5e1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.pg-card-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.65); display: flex; flex-direction: column;
    justify-content: center; align-items: center; gap: 15px;
    opacity: 0; transition: opacity 0.3s ease; backdrop-filter: blur(2px);
    z-index: 3;
}

/* Desktop Hover */
@media (min-width: 769px) {
    .pg-card:hover .pg-card-overlay { opacity: 1; }
}

.pg-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: 50px; font-weight: bold; font-size: 14px;
    text-decoration: none; cursor: pointer; border: none; transition: transform 0.2s;
}

.pg-btn:hover { transform: scale(1.05); }
.pg-btn svg { width: 18px; height: 18px; }
.pg-wa-btn { background: #25D366; color: white !important; }
.pg-zoom-btn { background: #ffffff; color: #000000; width: 45px; height: 45px; padding: 0; border-radius: 50%; }

/* Layouts Base (Desktop) */
.layout-grid .pg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.layout-grid .pg-card { aspect-ratio: 1 / 1; }

.layout-masonry .pg-grid { column-count: 3; column-gap: 15px; }
.layout-masonry .pg-grid-item { break-inside: avoid; margin-bottom: 15px; }
.layout-masonry .pg-card { display: block; height: auto; }

.layout-carousel .pg-grid {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 15px;
    padding-bottom: 15px; scrollbar-width: thin; scrollbar-color: var(--pg-accent) #f0f0f0;
}
.layout-carousel .pg-grid-item { flex: 0 0 calc(33.333% - 10px); scroll-snap-align: start; }
.layout-carousel .pg-card { aspect-ratio: 1 / 1; }

.pg-grid-item { transition: opacity 0.3s ease; }
.pg-grid-item.pg-hide { display: none !important; }

/* Empty State */
.pg-empty-message {
    background: #f8fafc; border: 2px dashed #cbd5e1; padding: 50px 20px;
    text-align: center; border-radius: 8px; color: #64748b; width: 100%;
    box-sizing: border-box; margin-top: 5px;
}
.pg-empty-message svg { stroke: #94a3b8; margin-bottom: 10px; }
.pg-empty-message p { margin: 0; font-size: 15px; font-weight: 600; color: #475569; }

/* Pagination Controls */
.pg-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 30px; flex-wrap: wrap; }
.pg-page-btn {
    background-color: var(--pg-btn-bg, #000); color: #ffffff; border: none;
    min-width: 38px; height: 38px; padding: 0 12px; border-radius: 6px;
    font-weight: bold; font-size: 14px; cursor: pointer; transition: all 0.2s ease;
}
.pg-page-btn.active, .pg-page-btn:hover { background-color: var(--pg-accent, #E1FF00); color: #000000 !important; }

/* Lightbox Modal Enriched with Arrows, Captions & Swipe Hint */
#pg-lightbox {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 999999; display: none; align-items: center; justify-content: center;
}
#pg-lightbox.active { display: flex; }
.pg-lb-bg { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.88); cursor: pointer; }
.pg-lb-content {
    position: relative; max-width: 90vw; max-height: 90vh; text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    z-index: 2;
}
.pg-lb-content img { max-width: 100%; max-height: 65vh; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.6); object-fit: contain; }

.pg-lb-info {
    display: flex; flex-direction: column; gap: 4px; max-width: 600px;
}
.pg-lb-caption { color: #ffffff; font-size: 17px; font-weight: bold; }
.pg-lb-description { color: #cbd5e1; font-size: 13px; font-weight: normal; line-height: 1.4; }

.pg-lb-actions { display: flex; gap: 10px; align-items: center; margin-top: 5px; }
.pg-lb-close {
    position: absolute; top: -45px; right: 0; background: none; border: none; color: #fff;
    font-size: 38px; cursor: pointer; line-height: 1; padding: 0; z-index: 10;
}

/* Nav Arrows for Desktop */
.pg-lb-nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.2); color: #ffffff; border: none;
    width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
    font-size: 24px; font-weight: bold; display: flex; align-items: center; justify-content: center;
    z-index: 10; transition: background 0.2s, transform 0.2s; backdrop-filter: blur(4px);
}
.pg-lb-nav-btn:hover { background: rgba(255,255,255,0.4); transform: translateY(-50%) scale(1.1); }
.pg-lb-prev { left: -65px; }
.pg-lb-next { right: -65px; }

/* Swipe Gesture Hint Overlay */
.pg-lb-swipe-hint {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px;
    color: #ffffff; font-size: 15px; font-weight: bold; border-radius: 8px;
    z-index: 15; pointer-events: none; opacity: 1; transition: opacity 0.8s ease;
}
.pg-lb-swipe-hint.fade-out { opacity: 0; }
.pg-swipe-hand-icon {
    width: 50px; height: 50px; stroke: var(--pg-accent, #E1FF00);
    animation: pgSwipeAnim 1.6s infinite ease-in-out;
}

@keyframes pgSwipeAnim {
    0%, 100% { transform: translateX(-20px); }
    50% { transform: translateX(20px); }
}

/* Mobile UX (< 768px) */
@media (max-width: 768px) {
    .pg-gallery-container { flex-direction: column; align-items: stretch; gap: 15px; }
    .pg-sidebar { width: 100%; min-width: 100%; padding: 15px; }
    
    .pg-sidebar-title { font-size: 14px; margin-bottom: 10px; padding-bottom: 5px; }

    .pg-gallery-container[data-mobile-cat-style="scroll"] .pg-categories {
        display: flex !important; overflow-x: auto !important; white-space: nowrap !important;
        gap: 8px !important; padding-bottom: 5px !important; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .pg-gallery-container[data-mobile-cat-style="scroll"] .pg-categories::-webkit-scrollbar { display: none; }
    .pg-gallery-container[data-mobile-cat-style="scroll"] .pg-cat-item {
        flex: 0 0 auto !important; margin-bottom: 0 !important; padding: 8px 14px !important;
        font-size: 13px !important; border-radius: 6px !important;
    }

    .pg-gallery-container[data-mobile-cat-style="accordion"] .pg-mobile-toggle-icon { display: inline-block; }
    .pg-gallery-container[data-mobile-cat-style="accordion"] .pg-sidebar-title { cursor: pointer; user-select: none; }
    .pg-gallery-container[data-mobile-cat-style="accordion"] .pg-categories { display: none; margin-top: 10px; }
    .pg-gallery-container[data-mobile-cat-style="accordion"].pg-mobile-open .pg-categories { display: block !important; }
    .pg-gallery-container[data-mobile-cat-style="accordion"].pg-mobile-open .pg-mobile-toggle-icon { transform: rotate(180deg); }

    .pg-gallery-container.layout-grid[data-mobile-cols="1"] .pg-grid { grid-template-columns: 1fr !important; }
    .pg-gallery-container.layout-grid[data-mobile-cols="2"] .pg-grid { grid-template-columns: repeat(2, 1fr) !important; }
    
    .pg-gallery-container.layout-masonry[data-mobile-cols="1"] .pg-grid { column-count: 1 !important; }
    .pg-gallery-container.layout-masonry[data-mobile-cols="2"] .pg-grid { column-count: 2 !important; }

    .pg-gallery-container.layout-carousel[data-mobile-cols="1"] .pg-grid-item { flex: 0 0 100% !important; }
    .pg-gallery-container.layout-carousel[data-mobile-cols="2"] .pg-grid-item { flex: 0 0 calc(50% - 7.5px) !important; }
    
    .pg-lb-nav-btn { display: none !important; }
    .pg-card-overlay { display: none !important; }
}
