/* Universal Base Reset */
body.pgs-standalone-gallery {
    margin: 0 !important;
    padding: 0 !important;
    background-color: #fafafa !important;
    color: #1e293b !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    -webkit-font-smoothing: antialiased;
}

.pgs-app-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Pixieset Hero Header */
.pgs-hero {
    position: relative;
    width: 100%;
    min-height: 75vh;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
}

.pgs-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

.pgs-hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    max-width: 900px;
    animation: pgsFadeIn 0.8s ease-out;
}

.pgs-hero-sub {
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    display: inline-block;
    margin-bottom: 12px;
}

.pgs-hero-title {
    font-size: clamp(34px, 5.5vw, 64px);
    font-weight: 300;
    letter-spacing: 0.5px;
    margin: 0 0 16px;
    color: #ffffff;
    line-height: 1.15;
}

.pgs-hero-meta {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
    margin-bottom: 34px;
}

.pgs-hero-divider {
    margin: 0 12px;
    opacity: 0.5;
}

.pgs-hero-scroll {
    display: inline-block;
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.45);
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.pgs-hero-scroll:hover {
    background: #ffffff;
    color: #0f172a;
    border-color: #ffffff;
}

@keyframes pgsFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Full Width Canvas */
.pgs-gallery-canvas {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 35px 24px 120px;
    box-sizing: border-box;
}

.pgs-gallery-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
}

.pgs-gallery-heading h2 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: -0.5px;
    color: #0f172a;
}

.pgs-gallery-heading p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.pgs-price-badge {
    font-size: 22px;
    font-weight: 600;
    color: #0f172a;
}

.pgs-price-badge span {
    font-size: 13px;
    font-weight: 400;
    color: #64748b;
}

.pgs-empty-notice {
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
    font-size: 16px;
}

/* Masonry Wall Container */
.pgs-masonry-wall {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

/* Individual Masonry Columns */
.pgs-masonry-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* Wall Items */
.pgs-wall-item {
    display: block;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    cursor: zoom-in;
    background: #e2e8f0;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pgs-wall-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15);
}

.pgs-wall-item.selected {
    outline: 4px solid #2563eb;
    outline-offset: -4px;
}

.pgs-wall-thumb {
    position: relative;
    width: 100%;
    line-height: 0;
}

.pgs-wall-thumb img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.pgs-wall-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Allows direct clicks to trigger lightbox on item */
}

.pgs-wall-item:hover .pgs-wall-overlay,
.pgs-wall-item.selected .pgs-wall-overlay {
    opacity: 1;
}

.pgs-check-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #ffffff;
    color: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 10;
    pointer-events: auto; /* Clickable to toggle selection */
}

.pgs-wall-item.selected .pgs-check-indicator {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.pgs-zoom-hint {
    color: #ffffff;
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    pointer-events: none;
}

/* Floating Sticky Action Bar */
.pgs-floating-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f172a;
    color: #ffffff;
    padding: 16px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.25);
    z-index: 9998;
}

.pgs-bar-info {
    font-size: 16px;
    font-weight: 500;
}

.pgs-bar-btn {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pgs-bar-btn:hover:not(:disabled) {
    background: #1d4ed8;
}

.pgs-bar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Lightbox Modal */
.pgs-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pgs-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 29, 0.95);
    backdrop-filter: blur(6px);
}

.pgs-lightbox-dialog {
    position: relative;
    z-index: 100000;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pgs-lightbox-body {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 78vh;
}

.pgs-lightbox-body img {
    max-width: 86vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    user-select: none;
}

.pgs-lightbox-close {
    position: fixed;
    top: 20px;
    right: 25px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 38px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.pgs-lightbox-close:hover { opacity: 1; }

.pgs-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: none;
    font-size: 26px;
    width: 48px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.pgs-lightbox-nav:hover { background: rgba(255, 255, 255, 0.3); }
.pgs-lightbox-prev { left: 24px; }
.pgs-lightbox-next { right: 24px; }

.pgs-lightbox-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    margin-top: 14px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 6px;
}

.pgs-lightbox-title {
    color: #e2e8f0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pgs-lightbox-select-btn {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.pgs-lightbox-select-btn.is-selected { background: #16a34a; }

/* Access Code Gate Screen */
.pgs-gate-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 80vh;
}

.pgs-gate-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 44px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.pgs-gate-card h2 { margin-top: 0; font-size: 22px; font-weight: 500; }
.pgs-gate-card p { color: #64748b; font-size: 14px; margin-bottom: 24px; }
.pgs-gate-card input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 16px;
    text-align: center;
    text-transform: uppercase;
    box-sizing: border-box;
}

.pgs-btn-primary {
    width: 100%;
    padding: 12px;
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.pgs-gate-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}