:root {
    --dg-gallery-red: #e60012;
    --dg-gallery-black: #1e1e1e;
    --dg-gallery-border: #e0e0e0;
}

.dg-gallery-carousel,
.dg-gallery-carousel * {
    box-sizing: border-box;
}

.dg-gallery-carousel {
    width: 100%;
    padding: 20px 0;
    color: var(--dg-gallery-black);
}

.dg-gallery-carousel__heading {
    margin: 0 54px 24px;
    color: var(--dg-gallery-black);
    font-size: clamp(25px, 3vw, 38px);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.dg-gallery-carousel__heading::after {
    display: block;
    width: 52px;
    height: 4px;
    margin-top: 10px;
    border-radius: 3px;
    background: var(--dg-gallery-red);
    content: "";
}

.dg-gallery-carousel__shell {
    position: relative;
    width: 100%;
    padding: 0;
}

.dg-gallery-carousel__viewport {
    width: 100%;
    overflow: hidden;
}

.dg-gallery-carousel__track {
    display: flex;
    gap: 20px;
    will-change: transform;
}

.dg-gallery-carousel__slide {
    flex: 0 0 calc((100% - 40px) / 3);
    min-width: 0;
}

.dg-gallery-card {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--dg-gallery-red);
    border-radius: 16px;
    color: var(--dg-gallery-black);
    background-color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    text-align: left;
    cursor: pointer;
    transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.dg-gallery-card:hover,
.dg-gallery-card:focus-visible {
    border-color: var(--dg-gallery-red);
    color: var(--dg-gallery-black);
    background-color: #fff;
    box-shadow: 0 12px 28px rgba(230, 0, 18, 0.14);
    outline: none;
    transform: none;
}

/* Keep Elementor's global button colors from bleeding into the card. */
.elementor .dg-gallery-card,
.elementor .dg-gallery-card:hover,
.elementor .dg-gallery-card:focus,
.elementor .dg-gallery-card:focus-visible {
    border-color: var(--dg-gallery-red) !important;
    color: var(--dg-gallery-black) !important;
    background-color: #fff !important;
    background-image: none !important;
}

.dg-gallery-card__image-wrap {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #111;
}

.dg-gallery-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 250ms ease, transform 350ms ease;
}

.dg-gallery-card:hover .dg-gallery-card__image {
    opacity: 0.7;
    transform: scale(1.04);
}

.dg-gallery-card__view {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #fff;
    background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.78));
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 200ms ease, transform 200ms ease;
}

.dg-gallery-card:hover .dg-gallery-card__view,
.dg-gallery-card:focus-visible .dg-gallery-card__view {
    opacity: 1;
    transform: translateY(0);
}

.dg-gallery-card__title {
    position: relative;
    display: block;
    min-height: 68px;
    padding: 20px 22px 19px 27px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.45;
}

.dg-gallery-card__title::before {
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 0;
    width: 5px;
    border-radius: 0 4px 4px 0;
    background: var(--dg-gallery-red);
    content: "";
}

.dg-gallery-carousel__nav {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    place-items: center;
    color: #fff;
    background: var(--dg-gallery-black);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 180ms ease, transform 180ms ease;
}

.dg-gallery-carousel__nav:hover,
.dg-gallery-carousel__nav:focus-visible {
    background: var(--dg-gallery-red);
    outline: 3px solid rgba(230, 0, 18, 0.2);
    transform: translateY(-50%) scale(1.06);
}

.dg-gallery-carousel__nav span {
    margin-top: -4px;
    font-family: Arial, sans-serif;
    font-size: 38px;
    font-weight: 300;
    line-height: 1;
}

.dg-gallery-carousel__nav--prev {
    left: -60px;
}

.dg-gallery-carousel__nav--next {
    right: -60px;
}

.dg-gallery-carousel__status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.dg-gallery-modal {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.dg-gallery-modal.is-open {
    display: flex;
}

.dg-gallery-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(4px);
}

.dg-gallery-modal__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    width: min(1040px, 100%);
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: 820px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    color: #fff;
    background: #171717;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.dg-gallery-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 20px 15px 24px;
    border-bottom: 3px solid var(--dg-gallery-red);
}

.dg-gallery-modal__title {
    margin: 0;
    color: #fff;
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 800;
}

.dg-gallery-modal__close {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--dg-gallery-red);
    font-size: 29px;
    line-height: 35px;
    cursor: pointer;
}

.elementor .dg-gallery-modal .dg-gallery-modal__close,
.elementor .dg-gallery-modal .dg-gallery-modal__close:hover,
.elementor .dg-gallery-modal .dg-gallery-modal__close:focus,
.elementor .dg-gallery-modal .dg-gallery-modal__close:focus-visible,
.elementor .dg-gallery-modal .dg-gallery-modal__close:active {
    border-color: var(--dg-gallery-red) !important;
    color: #fff !important;
    background-color: var(--dg-gallery-red) !important;
    background-image: none !important;
    outline-color: var(--dg-gallery-red) !important;
    box-shadow: none !important;
}

.dg-gallery-modal__stage {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    background: #080808;
}

.dg-gallery-modal .dg-gallery-modal__image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100% !important;
    max-height: 100%;
    object-fit: contain;
}

.dg-gallery-modal__arrow {
    position: absolute;
    z-index: 1;
    top: 50%;
    width: 44px;
    height: 52px;
    padding: 0 0 5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    background: rgba(0, 0, 0, 0.64);
    font-family: Arial, sans-serif;
    font-size: 38px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.dg-gallery-modal__arrow:hover,
.dg-gallery-modal__arrow:focus-visible {
    border-color: var(--dg-gallery-red);
    background: var(--dg-gallery-red);
    outline: none;
}

.elementor .dg-gallery-modal .dg-gallery-modal__arrow:hover,
.elementor .dg-gallery-modal .dg-gallery-modal__arrow:focus,
.elementor .dg-gallery-modal .dg-gallery-modal__arrow:focus-visible,
.elementor .dg-gallery-modal .dg-gallery-modal__arrow:active {
    border-color: var(--dg-gallery-red) !important;
    color: #fff !important;
    background-color: var(--dg-gallery-red) !important;
    background-image: none !important;
    outline-color: var(--dg-gallery-red) !important;
    box-shadow: none !important;
}

.dg-gallery-modal__arrow--prev {
    left: 16px;
}

.dg-gallery-modal__arrow--next {
    right: 16px;
}

.dg-gallery-modal__counter {
    margin: 10px 0 8px;
    color: #bbb;
    font-size: 13px;
    text-align: center;
}

.dg-gallery-modal__thumbs {
    display: flex;
    gap: 9px;
    padding: 0 20px 18px;
    overflow-x: auto;
    overflow-y: hidden;
}

.dg-gallery-modal__thumb {
    flex: 0 0 76px;
    width: 76px;
    height: 58px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 7px;
    background: #333;
    cursor: pointer;
    opacity: 0.62;
}

.dg-gallery-modal__thumb.is-active {
    border-color: var(--dg-gallery-red);
    opacity: 1;
}

.elementor .dg-gallery-modal .dg-gallery-modal__thumb,
.elementor .dg-gallery-modal .dg-gallery-modal__thumb:hover,
.elementor .dg-gallery-modal .dg-gallery-modal__thumb:focus,
.elementor .dg-gallery-modal .dg-gallery-modal__thumb:focus-visible,
.elementor .dg-gallery-modal .dg-gallery-modal__thumb:active {
    color: inherit !important;
    background-color: #333 !important;
    background-image: none !important;
    box-shadow: none !important;
}

.elementor .dg-gallery-modal .dg-gallery-modal__thumb:hover,
.elementor .dg-gallery-modal .dg-gallery-modal__thumb:focus,
.elementor .dg-gallery-modal .dg-gallery-modal__thumb:focus-visible,
.elementor .dg-gallery-modal .dg-gallery-modal__thumb:active,
.elementor .dg-gallery-modal .dg-gallery-modal__thumb.is-active {
    border-color: var(--dg-gallery-red) !important;
    outline-color: var(--dg-gallery-red) !important;
}

.dg-gallery-modal__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.dg-gallery-modal-open {
    position: fixed;
    right: 0;
    left: 0;
    overflow: hidden;
}

.dg-gallery-carousel-empty {
    padding: 14px 18px;
    border-left: 4px solid var(--dg-gallery-red);
    background: #f5f5f5;
}

@media (max-width: 1023px) {
    .dg-gallery-carousel__slide {
        flex-basis: calc((100% - 20px) / 2);
    }

    .dg-gallery-carousel__nav--prev {
        left: -22px;
    }

    .dg-gallery-carousel__nav--next {
        right: -22px;
    }
}

@media (max-width: 679px) {
    .dg-gallery-carousel__heading {
        margin-right: 0;
        margin-left: 0;
    }

    .dg-gallery-carousel__slide {
        flex-basis: 100%;
    }

    .dg-gallery-carousel__nav {
        width: 36px;
        height: 36px;
    }

    .dg-gallery-carousel__nav--prev {
        left: -12px;
    }

    .dg-gallery-carousel__nav--next {
        right: -12px;
    }

    .dg-gallery-modal {
        padding: 8px;
    }

    .dg-gallery-modal__dialog {
        width: 100%;
        height: calc(100vh - 16px);
        height: calc(100dvh - 16px);
        max-height: none;
    }

    .dg-gallery-modal__header {
        padding: 12px 12px 10px 16px;
    }

    .dg-gallery-modal__close {
        width: 34px;
        height: 34px;
        line-height: 31px;
    }

    .dg-gallery-modal__arrow {
        width: 36px;
        height: 45px;
    }

    .dg-gallery-modal__arrow--prev {
        left: 8px;
    }

    .dg-gallery-modal__arrow--next {
        right: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dg-gallery-carousel *,
    .dg-gallery-carousel *::before,
    .dg-gallery-carousel *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
