body.topshop-gallery-view {
    --topshop-gallery-bg: oklch(11.5% 0.028 246);
    --topshop-gallery-panel: oklch(15.5% 0.034 246);
    --topshop-gallery-ink: oklch(96% 0.008 232);
    --topshop-gallery-muted: oklch(76% 0.018 232);
    --topshop-gallery-line: color-mix(in oklch, var(--topshop-gallery-ink) 16%, transparent);
    background: var(--topshop-gallery-bg);
    color: var(--topshop-gallery-ink);
}

body.topshop-gallery-view .site-top-bar,
body.topshop-gallery-view .site-header-right,
body.topshop-gallery-view .site-header-right-link,
body.topshop-gallery-view .header-cart,
body.topshop-gallery-view .header-cart-contents {
    display: none !important;
}

body.topshop-gallery-view .site-header {
    position: sticky;
    top: 0;
    z-index: 120;
    width: 100%;
    height: 72px !important;
    min-height: 72px !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 2rem !important;
    margin: 0 !important;
    padding: 0 max(1rem, calc((100vw - 1180px) / 2)) !important;
    border-bottom: 1px solid var(--topshop-gallery-line) !important;
    background: color-mix(in oklch, var(--topshop-gallery-bg) 91%, transparent) !important;
    backdrop-filter: blur(18px) saturate(115%);
    -webkit-backdrop-filter: blur(18px) saturate(115%);
}

body.topshop-gallery-view .site-header > .site-container {
    grid-column: 1;
    grid-row: 1;
    position: static !important;
    width: max-content !important;
    min-height: 72px !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.topshop-gallery-view .site-header > .sticky-wrapper {
    grid-column: 2;
    grid-row: 1;
    position: static !important;
    width: 100% !important;
    min-height: 72px !important;
    margin: 0 !important;
}

body.topshop-gallery-view .site-header-left,
body.topshop-gallery-view .site-header-branding {
    width: auto !important;
    min-height: 72px !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.topshop-gallery-view .site-title,
body.topshop-gallery-view .site-title a {
    color: var(--topshop-gallery-ink) !important;
    font-family: var(--topshop-font-display);
    font-size: clamp(1.25rem, 1.7vw, 1.55rem) !important;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

body.topshop-gallery-view .site-description,
body.topshop-gallery-view .breadcrumbs {
    display: none !important;
}

body.topshop-gallery-view .main-navigation,
body.topshop-gallery-view .main-navigation.header-stick.stuck,
body.topshop-gallery-view .main-navigation .site-container {
    min-height: 72px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.topshop-gallery-view .main-navigation .site-container {
    width: 100% !important;
    justify-content: flex-end !important;
    padding: 0 !important;
}

body.topshop-gallery-view .main-navigation a {
    min-height: 44px !important;
    padding-inline: 0.7rem !important;
    border: 0 !important;
    background: transparent !important;
    color: color-mix(in oklch, var(--topshop-gallery-ink) 78%, transparent) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
}

body.topshop-gallery-view .main-navigation a:hover,
body.topshop-gallery-view .main-navigation a:focus-visible,
body.topshop-gallery-view .main-navigation .current-menu-item > a {
    color: var(--topshop-gallery-ink) !important;
}

body.topshop-gallery-view .main-navigation .qtranxs-lang-menu > a {
    width: 42px !important;
    min-width: 42px !important;
    padding: 0 !important;
    justify-content: center !important;
    border: 1px solid color-mix(in oklch, var(--topshop-color-accent) 56%, transparent) !important;
    background: color-mix(in oklch, var(--topshop-color-accent) 18%, transparent) !important;
    color: transparent !important;
    font-size: 0 !important;
}

body.topshop-gallery-view .main-navigation .qtranxs-lang-menu > a::before {
    color: var(--topshop-gallery-ink);
    font-size: 0.72rem;
    font-weight: 800;
}

body.topshop-gallery-view .main-navigation .qtranxs-lang-menu-en > a::before { content: "EN"; }
body.topshop-gallery-view .main-navigation .qtranxs-lang-menu-ru > a::before { content: "RU"; }
body.topshop-gallery-view .main-navigation .qtranxs-lang-menu-et > a::before { content: "ET"; }

body.topshop-gallery-view .main-navigation .qtranxs-lang-menu > a::after,
body.topshop-gallery-view .main-navigation .qtranxs-lang-menu > a img,
body.topshop-gallery-view .main-navigation .qtranxs-lang-menu > a span {
    display: none !important;
}

body.topshop-gallery-view .main-navigation ul ul {
    top: calc(100% - 1px) !important;
    right: 0 !important;
    left: auto !important;
    min-width: 10rem !important;
    padding: 0.35rem !important;
    border: 1px solid var(--topshop-gallery-line) !important;
    background: color-mix(in oklch, var(--topshop-gallery-bg) 92%, black) !important;
    box-shadow: 0 8px 18px color-mix(in oklch, black 22%, transparent) !important;
}

body.topshop-gallery-view .site-content.site-container,
body.topshop-gallery-view .site-content.content-has-sidebar,
body.topshop-gallery-view .site-content.content-no-sidebar {
    width: 100% !important;
    max-width: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.topshop-gallery {
    width: min(1180px, calc(100% - 2rem));
    margin-inline: auto;
    padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(4.5rem, 8vw, 7rem);
}

.topshop-gallery-intro {
    width: min(100%, 1020px);
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
    gap: clamp(2rem, 7vw, 7rem);
    align-items: end;
    margin-inline: auto;
    margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.topshop-gallery-context {
    margin: 0 0 0.8rem;
    color: var(--topshop-color-accent);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.4;
}

.topshop-gallery-intro h1 {
    max-width: 13ch;
    margin: 0;
    color: var(--topshop-gallery-ink);
    font-family: var(--topshop-font-display);
    font-size: clamp(3rem, 6.6vw, 5.75rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: 0;
    text-wrap: balance;
}

.topshop-gallery-lead {
    max-width: 38rem;
    margin: 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--topshop-gallery-line);
    color: var(--topshop-gallery-muted);
    font-size: clamp(1rem, 1.3vw, 1.1rem);
    line-height: 1.7;
    text-wrap: pretty;
}

.topshop-gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(0.65rem, 1.2vw, 1rem);
}

.topshop-gallery-item {
    min-width: 0;
    margin: 0;
    background: var(--topshop-gallery-panel);
}

.topshop-gallery-item--wide { grid-column: span 8; }
.topshop-gallery-item--narrow { grid-column: span 4; }
.topshop-gallery-item--third { grid-column: span 4; }
.topshop-gallery-item--half { grid-column: span 6; }

.topshop-gallery-trigger {
    position: relative;
    width: 100%;
    display: block;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: oklch(9% 0.022 246);
    color: inherit;
    cursor: zoom-in;
}

.topshop-gallery-item--wide .topshop-gallery-trigger { aspect-ratio: 2 / 1; }
.topshop-gallery-item--narrow .topshop-gallery-trigger { aspect-ratio: 1 / 1; }
.topshop-gallery-item--third .topshop-gallery-trigger { aspect-ratio: 4 / 3; }
.topshop-gallery-item--half .topshop-gallery-trigger { aspect-ratio: 16 / 10; }

.topshop-gallery-trigger picture,
.topshop-gallery-trigger img {
    width: 100%;
    height: 100%;
    display: block;
}

.topshop-gallery-trigger img {
    object-fit: cover;
    filter: saturate(0.78) contrast(1.04);
    transition: filter 220ms var(--topshop-ease-out), transform 220ms var(--topshop-ease-out);
}

.topshop-gallery-trigger:hover img,
.topshop-gallery-trigger:focus-visible img {
    filter: saturate(0.96) contrast(1.02);
    transform: scale(1.012);
}

.topshop-gallery-trigger:focus-visible {
    outline: 3px solid var(--topshop-color-focus);
    outline-offset: 3px;
}

.topshop-gallery-expand {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in oklch, white 34%, transparent);
    background: color-mix(in oklch, var(--topshop-gallery-bg) 80%, transparent);
    color: white;
    font-size: 1rem;
    line-height: 1;
}

.topshop-gallery-cta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-top: clamp(4rem, 8vw, 7rem);
    padding-top: clamp(2rem, 4vw, 3rem);
    border-top: 1px solid var(--topshop-gallery-line);
}

.topshop-gallery-cta h2 {
    max-width: 22ch;
    margin: 0;
    color: var(--topshop-gallery-ink);
    font-family: var(--topshop-font-display);
    font-size: clamp(1.75rem, 3.5vw, 3.1rem);
    font-weight: 750;
    line-height: 1.08;
    letter-spacing: 0;
    text-wrap: balance;
}

.topshop-gallery-cta p {
    margin: 0.85rem 0 0;
    color: var(--topshop-gallery-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.topshop-gallery-cta > a {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0.8rem 1.2rem;
    background: var(--topshop-color-accent);
    color: white;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
    transition: background-color 180ms var(--topshop-ease-out);
}

.topshop-gallery-cta > a:hover,
.topshop-gallery-cta > a:focus-visible {
    background: color-mix(in oklch, var(--topshop-color-accent) 82%, white);
    color: white;
}

.topshop-gallery-cta > a:focus-visible {
    outline: 3px solid var(--topshop-color-focus);
    outline-offset: 3px;
}

.topshop-gallery-dialog {
    width: min(92vw, 1440px);
    max-width: none;
    height: min(88vh, 960px);
    max-height: none;
    padding: 3.5rem 4.5rem 1.5rem;
    border: 1px solid var(--topshop-gallery-line);
    border-radius: 0;
    background: var(--topshop-gallery-bg);
    color: var(--topshop-gallery-ink);
}

.topshop-gallery-dialog::backdrop {
    background: color-mix(in oklch, black 82%, transparent);
    backdrop-filter: blur(4px);
}

.topshop-gallery-dialog figure {
    width: 100%;
    height: 100%;
    margin: 0;
}

.topshop-gallery-dialog img {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: block;
    object-fit: contain;
}

.topshop-gallery-dialog button {
    position: absolute;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--topshop-gallery-line);
    border-radius: 0;
    background: var(--topshop-gallery-panel);
    color: var(--topshop-gallery-ink);
    font-size: 1.25rem;
    cursor: pointer;
}

.topshop-gallery-dialog button:hover,
.topshop-gallery-dialog button:focus-visible {
    border-color: var(--topshop-color-accent);
    color: white;
}

.topshop-gallery-dialog button:focus-visible {
    outline: 3px solid var(--topshop-color-focus);
    outline-offset: 2px;
}

.topshop-gallery-close { top: 0.75rem; right: 0.75rem; }
.topshop-gallery-prev { left: 0.75rem; top: calc(50% - 1.375rem); }
.topshop-gallery-next { right: 0.75rem; top: calc(50% - 1.375rem); }

body.topshop-gallery-view .site-footer {
    border-top: 1px solid var(--topshop-gallery-line);
    background: var(--topshop-gallery-panel);
    color: var(--topshop-gallery-muted);
}

@media screen and (max-width: 900px) {
    .topshop-gallery-intro {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .topshop-gallery-lead {
        max-width: 44rem;
    }

    .topshop-gallery-item--wide,
    .topshop-gallery-item--half {
        grid-column: span 12;
    }

    .topshop-gallery-item--narrow,
    .topshop-gallery-item--third {
        grid-column: span 6;
    }
}

@media screen and (max-width: 768px) {
    body.topshop-gallery-view .site-header {
        height: 64px !important;
        min-height: 64px !important;
        grid-template-columns: minmax(0, 1fr) 68px !important;
        gap: 0.5rem !important;
        padding-inline: 1rem !important;
    }

    body.topshop-gallery-view .site-header > .site-container,
    body.topshop-gallery-view .site-header-left,
    body.topshop-gallery-view .site-header-branding {
        min-height: 64px !important;
    }

    body.topshop-gallery-view .site-header > .sticky-wrapper,
    body.topshop-gallery-view .main-navigation,
    body.topshop-gallery-view .main-navigation .site-container {
        width: 68px !important;
        min-width: 68px !important;
        max-width: 68px !important;
        min-height: 64px !important;
    }

    .topshop-gallery {
        padding-top: 2.75rem;
    }

    .topshop-gallery-cta {
        align-items: flex-start;
        flex-direction: column;
    }

    .topshop-gallery-dialog {
        width: 100vw;
        height: 100dvh;
        padding: 4rem 1rem 1rem;
        border: 0;
    }

    .topshop-gallery-prev { left: 0.5rem; }
    .topshop-gallery-next { right: 0.5rem; }
}

@media screen and (max-width: 560px) {
    .topshop-gallery-grid {
        grid-template-columns: 1fr;
    }

    .topshop-gallery-item--wide,
    .topshop-gallery-item--narrow,
    .topshop-gallery-item--third,
    .topshop-gallery-item--half {
        grid-column: 1;
    }

    .topshop-gallery-item .topshop-gallery-trigger {
        aspect-ratio: 4 / 3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topshop-gallery-trigger img,
    .topshop-gallery-cta > a {
        transition-duration: 1ms !important;
    }

    .topshop-gallery-trigger:hover img,
    .topshop-gallery-trigger:focus-visible img {
        transform: none;
    }
}

/* Gallery direction refinement - 2026-07-19 */
body.topshop-gallery-view {
    --topshop-gallery-bg: oklch(9.7% 0.028 246);
    --topshop-gallery-panel: oklch(14.2% 0.034 246);
    --topshop-gallery-ink: oklch(96% 0.008 232);
    --topshop-gallery-muted: oklch(73% 0.018 232);
    --topshop-gallery-line: color-mix(in oklch, var(--topshop-gallery-ink) 20%, transparent);
    background: var(--topshop-gallery-bg);
}

body.topshop-gallery-view .site-footer {
    background: var(--topshop-gallery-bg);
}

.topshop-gallery {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    padding: clamp(2.25rem, 5vw, 5rem) 0 clamp(4rem, 8vw, 8rem);
    padding-inline: max(1rem, calc((100vw - 1240px) / 2)) !important;
}

.topshop-gallery-intro {
    width: 100%;
    min-height: clamp(22rem, 42vh, 32rem);
    grid-template-columns: minmax(0, 1.05fr) minmax(18rem, 0.95fr);
    gap: clamp(2rem, 7vw, 8rem);
    align-items: end;
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
    padding: clamp(1.5rem, 3vw, 3rem) 0 clamp(2rem, 4vw, 3.5rem);
    border-top: 2px solid var(--topshop-color-accent);
    border-bottom: 1px solid var(--topshop-gallery-line);
}

.topshop-gallery-context {
    margin-bottom: 1.1rem;
    color: var(--topshop-color-accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.topshop-gallery-intro h1 {
    max-width: 10ch;
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 0.9;
    letter-spacing: 0;
    text-wrap: balance;
}

.topshop-gallery-lead {
    max-width: 35ch;
    margin: 0 0 0 auto;
    padding-top: 1.25rem;
    border-top: 1px solid var(--topshop-gallery-line);
    color: var(--topshop-gallery-muted);
    font-size: clamp(1rem, 1.4vw, 1.16rem);
    line-height: 1.7;
    text-wrap: pretty;
}

.topshop-gallery-grid {
    gap: clamp(0.75rem, 1.6vw, 1.5rem);
}

.topshop-gallery-item {
    border: 1px solid var(--topshop-gallery-line);
    background: var(--topshop-gallery-panel);
    transition: border-color 180ms ease;
}

.topshop-gallery-item:hover,
.topshop-gallery-item:focus-within {
    border-color: color-mix(in oklch, var(--topshop-color-accent) 68%, var(--topshop-gallery-line));
}

.topshop-gallery-trigger {
    isolation: isolate;
    overflow: hidden;
    border: 0;
    background: var(--topshop-gallery-panel);
}

.topshop-gallery-trigger::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: color-mix(in oklch, var(--topshop-color-accent) 12%, transparent);
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.topshop-gallery-trigger picture,
.topshop-gallery-trigger img {
    position: relative;
    z-index: 0;
}

.topshop-gallery-trigger img {
    filter: saturate(0.78) contrast(1.04);
    transition: transform 420ms ease, filter 420ms ease;
}

.topshop-gallery-trigger:hover::after,
.topshop-gallery-trigger:focus-visible::after {
    opacity: 1;
}

.topshop-gallery-trigger:hover img,
.topshop-gallery-trigger:focus-visible img {
    filter: saturate(0.96) contrast(1.04);
    transform: scale(1.018);
}

.topshop-gallery-trigger:focus-visible {
    outline: 3px solid var(--topshop-color-focus);
    outline-offset: -3px;
}

.topshop-gallery-expand {
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-grid;
    place-items: center;
    border: 1px solid color-mix(in oklch, white 55%, transparent);
    background: color-mix(in oklch, var(--topshop-gallery-bg) 70%, transparent);
    color: var(--topshop-gallery-ink);
    font-size: 1.05rem;
    line-height: 1;
}

.topshop-gallery-cta {
    align-items: center;
    margin-top: clamp(4rem, 8vw, 7rem);
    padding: clamp(1.75rem, 3vw, 2.75rem) 0;
    border-top: 1px solid var(--topshop-gallery-line);
    border-bottom: 1px solid var(--topshop-gallery-line);
}

.topshop-gallery-cta h2 {
    max-width: 17ch;
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 0.98;
    letter-spacing: 0;
    text-wrap: balance;
}

.topshop-gallery-cta > a {
    min-height: 48px;
    padding-inline: 1.2rem;
    border: 1px solid var(--topshop-color-accent);
    background: var(--topshop-color-accent);
    color: white;
    transition: background-color 180ms ease, border-color 180ms ease;
}

.topshop-gallery-cta > a:hover,
.topshop-gallery-cta > a:focus-visible {
    border-color: var(--topshop-color-focus);
    background: var(--topshop-color-focus);
    color: var(--topshop-gallery-bg);
}

@media screen and (max-width: 900px) {
    .topshop-gallery-intro {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .topshop-gallery-lead {
        max-width: 42rem;
        margin-left: 0;
    }
}

@media screen and (max-width: 768px) {
    .topshop-gallery {
        padding-inline: 1rem !important;
        padding-top: 2rem;
    }

    .topshop-gallery-intro {
        padding-block: 1.5rem 2rem;
    }
}

@media screen and (max-width: 560px) {
    .topshop-gallery-intro h1 {
        max-width: 9ch;
        font-size: clamp(2.75rem, 14vw, 4.4rem);
    }

    .topshop-gallery-grid {
        gap: 0.75rem;
    }

    .topshop-gallery-item--wide,
    .topshop-gallery-item--narrow,
    .topshop-gallery-item--third,
    .topshop-gallery-item--half {
        grid-column: 1;
    }

    .topshop-gallery-cta {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.5rem;
    }

    .topshop-gallery-cta > a {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topshop-gallery-item,
    .topshop-gallery-trigger::after,
    .topshop-gallery-trigger img,
    .topshop-gallery-cta > a {
        transition-duration: 1ms !important;
    }

    .topshop-gallery-trigger:hover img,
    .topshop-gallery-trigger:focus-visible img {
        transform: none;
    }
}
