.sg-gallery {
    max-width: 1600px;
    margin: 0 auto;
    padding: 48px 0;
    text-align: center;
}

.sg-gallery__header {
    padding: 0 20px;
}

.sg-gallery__title {
    font-size: 28px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 8px;
}

.sg-gallery__subtitle {
    color: #777;
    margin: 0 0 20px;
}

.sg-gallery__actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.sg-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #111;
    background: #fff;
    color: #111;
    transition: all .2s ease;
}

.sg-btn--solid {
    background: #111;
    color: #fff;
}

.sg-btn--solid:hover {
    opacity: .85;
    color: #fff;
}

.sg-btn--outline:hover {
    background: #111;
    color: #fff;
}

.sg-btn--block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Full-bleed: the track breaks out of the page container edge-to-edge,
   regardless of the theme's max-width/padding wrapping this section. */
.sg-gallery__track-wrap {
    position: relative;
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}

.sg-gallery__track {
    --sg-tile: clamp(150px, 20vw, 320px);
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, var(--sg-tile));
    grid-auto-columns: var(--sg-tile);
    gap: 4px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    width: 100%;
}

.sg-gallery__track::-webkit-scrollbar {
    display: none;
}

.sg-tile {
    position: relative;
    grid-row: span 1;
    grid-column: span 1;
    padding: 0;
    margin: 0;
    border: 0;
    cursor: pointer;
    overflow: hidden;
    background: #f2f2f2;
    scroll-snap-align: start;
}

.sg-tile--large {
    grid-row: span 2;
    grid-column: span 2;
}

/* Arrows float on top of the images instead of taking their own track
   space, with a blurred translucent circle so they read clearly on any
   photo. */
.sg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
    color: #111;
}

.sg-arrow:hover {
    background: rgba(255, 255, 255, .55);
}

.sg-arrow--prev {
    left: 16px;
}

.sg-arrow--next {
    right: 16px;
}

/* Mobile: same masonry grid, just smaller tiles — no structural change,
   so this can't break the desktop layout the way a nested-grid approach
   could. Paging through 5-photo batches is handled in JS (see
   shoppable-gallery.js), which scrolls to each "large tile" boundary. */
@media (max-width: 767px) {
    .sg-gallery__header {
        padding: 0 16px;
    }

    .sg-gallery__track {
        --sg-tile: clamp(120px, 38vw, 170px);
    }
}

.sg-tile__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.sg-tile:hover .sg-tile__image {
    transform: scale(1.05);
}

.sg-tile__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sg-tile__tag-dot {
    position: absolute;
    left: 12px;
    bottom: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .4);
}

.sg-gallery__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
}

.sg-gallery__dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ccc;
    display: inline-block;
    cursor: pointer;
}

.sg-gallery__dots span.is-active {
    background: #111;
}

/* Lightbox */
.sg-lightbox,
.sg-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
}

.sg-lightbox.is-open,
.sg-modal.is-open {
    display: block;
}

.sg-lightbox__overlay,
.sg-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 18, 15, .92);
}

.sg-lightbox__inner {
    position: relative;
    z-index: 1;
    display: flex;
    max-width: 1000px;
    width: 92%;
    max-height: 88vh;
    margin: 6vh auto;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.sg-lightbox__media {
    flex: 1 1 60%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.sg-lightbox__panel {
    flex: 1 1 40%;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    overflow-y: auto;
}

.sg-lightbox__product img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
}

.sg-lightbox__product-name {
    font-weight: 600;
    margin: 4px 0;
}

.sg-lightbox__product-price {
    color: #777;
    margin-bottom: 14px;
}

.sg-lightbox__no-product {
    color: #999;
    font-size: 14px;
}

.sg-lightbox__caption {
    color: #333;
    font-size: 14px;
}

.sg-lightbox__handle {
    color: #999;
    font-size: 13px;
}

.sg-lightbox__close,
.sg-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
}

.sg-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.sg-lightbox__nav--prev {
    left: -22px;
}

.sg-lightbox__nav--next {
    right: -22px;
}

@media (max-width: 767px) {
    .sg-lightbox__inner {
        flex-direction: column;
        max-height: 92vh;
        overflow-y: auto;
    }

    .sg-lightbox__nav--prev {
        left: 6px;
    }

    .sg-lightbox__nav--next {
        right: 6px;
    }
}

/* Submission modal */
.sg-modal__inner {
    position: relative;
    z-index: 1;
    max-width: 460px;
    width: 92%;
    margin: 6vh auto;
    background: #fff;
    padding: 34px 28px;
    max-height: 88vh;
    overflow-y: auto;
    text-align: left;
}

.sg-modal__inner h3 {
    margin: 0 0 6px;
}

.sg-modal__hint {
    color: #777;
    font-size: 13px;
    margin: 0 0 20px;
}

.sg-form-group {
    margin-bottom: 14px;
}

.sg-form-group label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
    color: #444;
}

.sg-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.sg-form-message {
    font-size: 13px;
    margin-bottom: 10px;
}

.sg-form-message.is-success {
    color: #1a7f37;
}

.sg-form-message.is-error {
    color: #c0392b;
}
