/* ─── Gallery page ────────────────────────────────────────────── */
/* Width matches the global .container (max 1280px, 32px gutter) so the
   gallery aligns with header / About / other content pages. */
.shop-gallery {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px 80px;
}
@media (max-width: 767px) {
    .shop-gallery { padding: 0 16px 60px; }
}

/* ─── Hero block ─────────────────────────────────────────────── */
/* Compact hero: half the vertical breathing room of the original
   so the gallery grid sits closer to the fold. */
.shop-gallery__hero {
    position: relative;
    margin: 16px 0 24px;
    padding: 32px 24px 40px;
    text-align: center;
    color: #fff;
    border-radius: 14px;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(216, 71, 43, 0.35), transparent 55%),
        radial-gradient(ellipse at 70% 80%, rgba(80, 90, 110, 0.45), transparent 60%),
        linear-gradient(135deg, #14181f 0%, #1f242c 60%, #2b333d 100%);
}
.shop-gallery__hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.08) 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}
.shop-gallery__hero > * { position: relative; z-index: 1; }

.shop-gallery__hero-eyebrow {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #f0a18d;
    background: rgba(216, 71, 43, 0.18);
    border: 1px solid rgba(216, 71, 43, 0.45);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.shop-gallery__title {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 auto 8px;
    max-width: 18ch;
    color: #fff;
    text-shadow: 0 2px 18px rgba(0,0,0,0.3);
}

.shop-gallery__subtitle {
    font-size: clamp(13px, 1.2vw, 15px);
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.78);
    margin: 0 auto;
    max-width: 56ch;
}

.shop-gallery__empty {
    text-align: center;
    color: var(--shop-muted, #666);
    padding: 80px 16px;
}

/* ─── Masonry grid ────────────────────────────────────────────── */
.shop-gallery__grid {
    columns: 3;
    column-gap: 8px;
}
@media (max-width: 1023px) { .shop-gallery__grid { columns: 2; } }
@media (max-width: 479px)  { .shop-gallery__grid { columns: 1; } }

.shop-gallery__tile {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 8px;
    break-inside: avoid;
    overflow: hidden;
    border-radius: 6px;
    background: #1a1a1a;
    cursor: zoom-in;
    /* aspect-ratio is set inline (--ratio: W/H) so the layout box is reserved
       before the image decodes — masonry stops jumping. */
    aspect-ratio: var(--ratio, 1 / 1);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.shop-gallery__tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: opacity 0.35s ease;
}
.shop-gallery__tile.is-loading img {
    opacity: 0;
}
.shop-gallery__tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Shimmer skeleton — visible while .is-loading, hidden once the image arrives */
.shop-gallery__skeleton {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(110deg,
            rgba(255,255,255,0)   0%,
            rgba(255,255,255,0.06) 40%,
            rgba(255,255,255,0.12) 50%,
            rgba(255,255,255,0.06) 60%,
            rgba(255,255,255,0)  100%) 0 0 / 200% 100%,
        linear-gradient(135deg, #1f242c 0%, #2a313b 100%);
    animation: shop-gallery-shimmer 1.5s linear infinite;
    opacity: 1;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
.shop-gallery__tile:not(.is-loading) .shop-gallery__skeleton {
    opacity: 0;
}
@keyframes shop-gallery-shimmer {
    0%   { background-position: -100% 0, 0 0; }
    100% { background-position:  200% 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
    .shop-gallery__skeleton { animation: none; }
}

.shop-gallery__sentinel {
    height: 1px;
    margin-top: 32px;
}
.shop-gallery__sentinel.is-loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    border: 3px solid #ddd;
    border-top-color: #444;
    border-radius: 50%;
    margin: 24px auto 0;
    animation: shop-gallery-spin 0.8s linear infinite;
}
@keyframes shop-gallery-spin {
    to { transform: rotate(360deg); }
}

/* ─── Lightbox overlay ─────────────────────────────────────────── */
.shop-gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.96);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}
.shop-gallery-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}
.shop-gallery-lightbox__img {
    max-width: 90vw;
    /* Reserve room for the bottom CTA: 32px gap + 52px button + breathing room */
    max-height: calc(100vh - 200px);
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    margin-bottom: 24px;
}

.shop-gallery-lightbox__close,
.shop-gallery-lightbox__prev,
.shop-gallery-lightbox__next {
    position: absolute;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.shop-gallery-lightbox__close:hover,
.shop-gallery-lightbox__prev:hover,
.shop-gallery-lightbox__next:hover {
    background: rgba(255,255,255,0.18);
}
.shop-gallery-lightbox__close { top: 24px; right: 24px; }
.shop-gallery-lightbox__prev  { left: 24px;  top: 50%; transform: translateY(-50%); }
.shop-gallery-lightbox__next  { right: 24px; top: 50%; transform: translateY(-50%); }
.shop-gallery-lightbox__prev[disabled],
.shop-gallery-lightbox__next[disabled] {
    opacity: 0.3;
    cursor: default;
}

.shop-gallery-lightbox__cta,
.shop-gallery-lightbox__cta:link,
.shop-gallery-lightbox__cta:visited,
.shop-gallery-lightbox__cta:hover,
.shop-gallery-lightbox__cta:active,
.shop-gallery-lightbox__cta:focus {
    color: #fff;
    text-decoration: none;
}
.shop-gallery-lightbox__cta {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--shop-accent, #d8472b);
    padding: 14px 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    transition: transform 0.12s ease, background 0.12s ease;
}
.shop-gallery-lightbox__cta:hover {
    transform: translateX(-50%) translateY(-2px);
    background: #b73620;
}

@media (max-width: 600px) {
    .shop-gallery-lightbox__prev { left: 8px; }
    .shop-gallery-lightbox__next { right: 8px; }
    .shop-gallery-lightbox__close { top: 12px; right: 12px; }
    .shop-gallery-lightbox__cta { bottom: 16px; padding: 12px 20px; font-size: 14px; }
}

body.shop-gallery-locked { overflow: hidden; }

/* ─── Load error + retry ───────────────────────────────────────── */
.shop-gallery__error {
    text-align: center;
    padding: 32px 16px;
}
.shop-gallery__error p {
    color: var(--shop-muted, #666);
    margin: 0 0 12px;
}
.shop-gallery__retry {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 999px;
    border: 1px solid var(--shop-accent, #d8472b);
    background: transparent;
    color: var(--shop-accent, #d8472b);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.shop-gallery__retry:hover {
    background: var(--shop-accent, #d8472b);
    color: #fff;
}
