/* DXTECH – Galerija mašina (scoped, no global Elementor overrides) */
.dxmg-gallery {
    --dxmg-accent: #3B3B3B;
    --dxmg-columns: 4;
    --dxmg-thumb-height: 80px;
    --dxmg-gap: 10px;
    --dxmg-radius: 6px;
    width: 100%;
    min-width: 0;
    font-family: 'Urbanist', sans-serif;
}
.dxmg-gallery *, .dxmg-gallery *::before, .dxmg-gallery *::after { box-sizing: border-box; }
.dxmg-empty { padding: 26px; text-align: center; border: 1px dashed #aaa; color: #666; border-radius: 6px; }
.dxmg-main {
    width: 100%;
    height: 420px;
    background: #fff;
    position: relative;
    overflow: hidden;
    border-radius: var(--dxmg-radius);
}
.dxmg-slides { position: relative; width: 100%; height: 100%; }
.dxmg-slide { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; }
.dxmg-slide[hidden] { display: none !important; }
.dxmg-image-open, .dxmg-image-static {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    margin: 0;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}
.dxmg-image-open { cursor: zoom-in; }
.dxmg-image-open:hover, .dxmg-image-open:focus, .dxmg-image-open:active { background: transparent; }
.dxmg-image, .dxmg-thumb-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    max-width: 100%;
    max-height: 100%;
}
.dxmg-main-nav, .dxmg-expand, .dxmg-thumb-nav {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.96);
    color: var(--dxmg-accent);
    border: 1px solid #d7d7d7;
    padding: 0;
    cursor: pointer;
    transition: color .15s, background-color .15s, border-color .15s;
}
.dxmg-main-nav:hover, .dxmg-expand:hover, .dxmg-thumb-nav:hover,
.dxmg-main-nav:focus-visible, .dxmg-expand:focus-visible, .dxmg-thumb-nav:focus-visible {
    color: #fff;
    background: var(--dxmg-accent);
    border-color: var(--dxmg-accent);
}
.dxmg-main-nav {
    position: absolute;
    z-index: 3;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    opacity: .88;
}
.dxmg-main-prev { left: 12px; }
.dxmg-main-next { right: 12px; }
.dxmg-expand {
    position: absolute;
    z-index: 3;
    bottom: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}
.dxmg-thumbs-wrap { display: flex; align-items: center; gap: 8px; margin-top: 12px; min-width: 0; }
.dxmg-thumbs {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    gap: var(--dxmg-gap);
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px;
    scroll-behavior: smooth;
}
.dxmg-thumbs::-webkit-scrollbar { display: none; }
.dxmg-thumb {
    appearance: none;
    flex: 0 0 calc((100% - (var(--dxmg-columns) - 1) * var(--dxmg-gap)) / var(--dxmg-columns));
    width: auto;
    min-width: 0;
    height: var(--dxmg-thumb-height);
    padding: 5px;
    margin: 0;
    border: 1px solid #d7d7d7;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    scroll-snap-align: start;
    transition: border-color .18s, box-shadow .18s;
}
.dxmg-thumb:hover, .dxmg-thumb:focus-visible { background: #fff; border-color: var(--dxmg-accent); }
.dxmg-thumb.is-active { border: 2px solid var(--dxmg-accent); }
.dxmg-thumb-nav { flex: 0 0 28px; width: 28px; height: 38px; border-radius: 6px; }
.dxmg-thumb-nav[disabled] { opacity: .35; cursor: not-allowed; pointer-events: none; }
.dxmg-thumb:focus-visible, .dxmg-main-nav:focus-visible, .dxmg-expand:focus-visible,
.dxmg-thumb-nav:focus-visible { outline: 2px solid var(--dxmg-accent); outline-offset: 2px; }
/* Lightbox uses the browser's native modal dialog top layer. */
.dxmg-lightbox {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: auto;
    padding: 64px 56px;
    border: none;
    background: rgba(12, 16, 20, .96);
    color: #fff;
    overflow: hidden;
    align-items: center;
    justify-content: center;
}
.dxmg-lightbox[open] { display: flex; }
.dxmg-lightbox::backdrop { background: rgba(0, 0, 0, .82); }
.dxmg-lightbox-image { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.dxmg-lightbox-close, .dxmg-lightbox-prev, .dxmg-lightbox-next {
    appearance: none;
    border: 1px solid rgba(255,255,255,.3);
    color: white;
    background: rgba(255,255,255,.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}
.dxmg-lightbox-close:hover, .dxmg-lightbox-prev:hover, .dxmg-lightbox-next:hover { background: rgba(255,255,255,.3); color: white; }
.dxmg-lightbox-close { position: absolute; top: 16px; right: 20px; width: 40px; height: 40px; font-size: 27px; line-height: 1; }
.dxmg-lightbox-prev, .dxmg-lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; }
.dxmg-lightbox-prev { left: 12px; }
.dxmg-lightbox-next { right: 12px; }
@media (max-width: 767px) {
    .dxmg-main { height: 270px; }
    .dxmg-gallery { --dxmg-columns: 3; }
    .dxmg-main-nav { width: 30px; height: 30px; }
    .dxmg-image-open, .dxmg-image-static { padding: 5px; }
    .dxmg-lightbox { padding: 64px 38px; }
    .dxmg-lightbox-prev { left: 4px; }
    .dxmg-lightbox-next { right: 4px; }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .dxmg-main { height: 340px; }
    .dxmg-gallery { --dxmg-columns: 3; }
}
@media (prefers-reduced-motion: reduce) {
    .dxmg-thumbs { scroll-behavior: auto; }
    .dxmg-thumb, .dxmg-main-nav, .dxmg-expand, .dxmg-thumb-nav { transition: none; }
}
