/* B2B Products - Gallery Styles */
.dmzp-gallery {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    gap: var(--dmzp-main-gap, 10px);
}

.dmzp-gallery.pos-top { flex-direction: column-reverse; }
.dmzp-gallery.pos-bottom { flex-direction: column; }
.dmzp-gallery.pos-left { flex-direction: row-reverse; align-items: stretch; }
.dmzp-gallery.pos-right { flex-direction: row; align-items: stretch; }

.dmzp-gallery .dmzp-main-slider {
    flex: none;
    min-width: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: transparent;
}

.dmzp-gallery.pos-left .dmzp-main-slider,
.dmzp-gallery.pos-right .dmzp-main-slider {
    flex: 0 0 var(--dmzp-side-main-size, 80%);
    width: var(--dmzp-side-main-size, 80%);
    height: var(--dmzp-side-main-size, auto);
}

.dmzp-gallery .dmzp-main-slider .swiper-wrapper {
    height: 100%;
    display: flex;
    box-sizing: content-box;
}

.dmzp-gallery .dmzp-main-slider .swiper-slide {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: transparent;
}

.dmzp-gallery .dmzp-main-slider img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    box-sizing: border-box;
    display: block;
    background: transparent;
}

button.dmzp-video-play,
button.dmzp-video-play:hover,
button.dmzp-video-play:focus,
button.dmzp-video-play:active {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 18;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 50%;
    color: #fff !important;
    background: #f00 !important;
    background-image: none !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32) !important;
    opacity: 0.94;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

button.dmzp-video-play::before,
button.dmzp-video-play::after {
    content: none !important;
    display: none !important;
}

button.dmzp-video-play:hover {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

button.dmzp-video-play:focus {
    outline: none;
}

button.dmzp-video-play:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

button.dmzp-video-play svg {
    display: block;
    width: 34px;
    height: 34px;
    margin-left: 4px;
    fill: currentColor;
}

.dmzp-video-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 64px 4vw 32px;
    background: rgba(0, 0, 0, 0.92);
}

.dmzp-video-lightbox__frame {
    position: relative;
    width: min(1200px, 92vw);
    max-width: calc((100vh - 96px) * 1.7778);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

.dmzp-video-lightbox__frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

button.dmzp-video-lightbox__close,
button.dmzp-video-lightbox__close:hover,
button.dmzp-video-lightbox__close:focus,
button.dmzp-video-lightbox__close:active {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: 16px;
    right: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 50%;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12) !important;
    background-image: none !important;
    box-shadow: none !important;
    font: 300 36px/1 Arial, sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

button.dmzp-video-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.24) !important;
    transform: rotate(90deg);
}

button.dmzp-video-lightbox__close:focus {
    outline: none;
}

button.dmzp-video-lightbox__close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.dmzp-gallery .dmzp-zoom-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 20;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
    text-decoration: none;
    filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.3));
}

.dmzp-gallery .dmzp-zoom-icon svg,
.dmzp-gallery .dmzp-zoom-icon i {
    display: block;
    line-height: 1;
    transition: 0.3s ease;
}

.dmzp-gallery .dmzp-thumb-slider {
    overflow: hidden;
    background: transparent;
}

.dmzp-gallery.pos-top .dmzp-thumb-slider,
.dmzp-gallery.pos-bottom .dmzp-thumb-slider {
    width: 100%;
}

.dmzp-gallery.pos-left .dmzp-thumb-slider,
.dmzp-gallery.pos-right .dmzp-thumb-slider {
    width: var(--dmzp-side-thumb-size, 150px) !important;
    height: var(--dmzp-side-main-size, auto) !important;
    flex-shrink: 0;
    transition: width 0.1s ease-out, height 0.1s ease-out;
}

.dmzp-gallery .dmzp-thumb-slider .swiper-wrapper {
    height: 100%;
    display: flex;
    box-sizing: content-box;
}

.dmzp-gallery .dmzp-thumb-slider .swiper-slide {
    box-sizing: border-box;
    transition: 0.3s;
    cursor: pointer;
    display: flex;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    height: auto;
    background: transparent;
}

.dmzp-gallery .dmzp-thumb-slider img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    box-sizing: border-box;
    display: block;
    background: transparent;
}

.dmzp-gallery.dmzp-gallery--horizontal-thumbs .dmzp-thumb-slider {
    height: var(--dmzp-horizontal-thumb-size) !important;
}

.dmzp-gallery.dmzp-gallery--horizontal-thumbs .dmzp-thumb-slider .swiper-wrapper {
    height: var(--dmzp-horizontal-thumb-size) !important;
}

.dmzp-gallery.dmzp-gallery--horizontal-thumbs .dmzp-thumb-slider .swiper-slide {
    height: var(--dmzp-horizontal-thumb-size) !important;
    min-height: 0;
    max-height: var(--dmzp-horizontal-thumb-size);
}

.dmzp-gallery .dmzp-arrow-icon::after {
    content: none !important;
    display: none !important;
}

.dmzp-gallery .dmzp-arrow-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.dmzp-gallery .swiper-button-next { right: 12px; }
.dmzp-gallery .swiper-button-prev { left: 12px; }
.dmzp-gallery .dmzp-arrow-icon:focus { outline: none; }

/* B2B Products - Params Table */
.dmzp-product-params { width: 100%; border-collapse: collapse; border: 1px solid #e5e7eb; background: #fff; }
.dmzp-product-params th,.dmzp-product-params td { padding: 13px 16px; border: 1px solid #e5e7eb; text-align: left; vertical-align: top; }
.dmzp-product-params th { width: 34%; background: #f8fafc; color: #111827; font-weight: 600; }
.dmzp-product-params td { color: #374151; }
.dmzp-product-params-list { width: 100%; border: 1px solid #e5e7eb; background: #fff; }
.dmzp-product-params-list__item { display: flex; justify-content: space-between; align-items: flex-start; padding: 13px 16px; border-bottom: 1px solid #e5e7eb; }
.dmzp-product-params-list__item:last-child { border-bottom: none; }
.dmzp-product-params-list__label { font-weight: 600; color: #111827; flex-shrink: 0; margin-right: 16px; }
.dmzp-product-params-list__value { color: #374151; text-align: right; }
.dmzp-product-summary { width: 100%; }
.dmzp-product-summary__title { margin: 0 0 16px; padding: 0; }
.dmzp-product-summary__divider { border: none; border-top: 1px solid #e5e7eb; margin: 20px 0 0; }

/* B2B Products - Product Attributes */
.dmzp-product-attributes {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 20px;
    box-sizing: border-box;
}

.dmzp-product-attribute {
    display: flex;
    min-width: 0;
    gap: 10px;
}

.dmzp-product-attributes--stacked .dmzp-product-attribute {
    flex-direction: column;
}

.dmzp-product-attributes--inline .dmzp-product-attribute {
    flex-direction: row;
    align-items: flex-start;
}

.dmzp-product-attribute__name {
    color: #111827;
    font-weight: 600;
    line-height: 1.4;
}

.dmzp-product-attributes--inline .dmzp-product-attribute__name {
    flex: 0 0 120px;
    width: 120px;
    padding-top: 7px;
}

.dmzp-product-attribute__values {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    gap: 10px;
}

button.dmzp-attribute-value {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 0;
    margin: 0;
    font: inherit;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

button.dmzp-attribute-value::before,
button.dmzp-attribute-value::after {
    content: none !important;
    display: none !important;
}

button.dmzp-attribute-value:focus {
    outline: none;
}

button.dmzp-attribute-value:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 3px;
}

button.dmzp-attribute-value--label {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    border-color: var(--dmzp-label-border-color, #d1d5db) !important;
    color: var(--dmzp-label-text-color, #374151) !important;
    background: var(--dmzp-label-background-color, #fff) !important;
}

button.dmzp-attribute-value--label:hover {
    border-color: var(--dmzp-label-hover-border-color, var(--dmzp-label-border-color, #6b7280)) !important;
    color: var(--dmzp-label-hover-text-color, var(--dmzp-label-text-color, #374151)) !important;
    background: var(--dmzp-label-hover-background-color, var(--dmzp-label-background-color, #fff)) !important;
}

button.dmzp-attribute-value--label.is-selected,
button.dmzp-attribute-value--label.is-selected:hover {
    border-color: var(--dmzp-label-selected-border-color, #111827) !important;
    color: var(--dmzp-label-selected-text-color, #fff) !important;
    background: var(--dmzp-label-selected-background-color, #111827) !important;
}

button.dmzp-attribute-value--color,
button.dmzp-attribute-value--color:hover,
button.dmzp-attribute-value--color:focus,
button.dmzp-attribute-value--color:active,
button.dmzp-attribute-value--color.is-selected,
button.dmzp-attribute-value--color.is-selected:hover {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    color: transparent !important;
    background: var(--dmzp-swatch-color, #000) !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
}

button.dmzp-attribute-value--color {
    border-color: var(--dmzp-color-border-color, #d1d5db) !important;
}

button.dmzp-attribute-value--color:hover {
    border-color: var(--dmzp-color-hover-border-color, var(--dmzp-color-border-color, #6b7280)) !important;
}

button.dmzp-attribute-value--color.is-selected,
button.dmzp-attribute-value--color.is-selected:hover {
    border-color: var(--dmzp-color-selected-border-color, #111827) !important;
}

button.dmzp-attribute-value--image,
button.dmzp-attribute-value--image:hover,
button.dmzp-attribute-value--image:focus,
button.dmzp-attribute-value--image:active,
button.dmzp-attribute-value--image.is-selected,
button.dmzp-attribute-value--image.is-selected:hover {
    position: relative;
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: #374151 !important;
    background: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
}

button.dmzp-attribute-value--image {
    border-color: var(--dmzp-image-border-color, #d1d5db) !important;
}

.dmzp-attribute-value--image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none !important;
    opacity: 1 !important;
}

button.dmzp-attribute-value--image:hover {
    border-color: var(--dmzp-image-hover-border-color, var(--dmzp-image-border-color, #6b7280)) !important;
}

button.dmzp-attribute-value--image.is-selected,
button.dmzp-attribute-value--image.is-selected:hover {
    border-color: var(--dmzp-image-selected-border-color, #111827) !important;
}

.dmzp-attribute-value__image-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 4px;
    overflow: hidden;
    box-sizing: border-box;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
}

.dmzp-screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 640px) {
    .dmzp-product-params th,.dmzp-product-params td { display: block; width: 100%; }
    .dmzp-gallery,
    .dmzp-gallery.pos-top,
    .dmzp-gallery.pos-left,
    .dmzp-gallery.pos-right {
        flex-direction: column;
        align-items: stretch;
    }

    .dmzp-gallery .dmzp-main-slider {
        flex: none;
        width: 100%;
        height: auto;
    }

    .dmzp-gallery .dmzp-thumb-slider,
    .dmzp-gallery.pos-top .dmzp-thumb-slider,
    .dmzp-gallery.pos-left .dmzp-thumb-slider,
    .dmzp-gallery.pos-right .dmzp-thumb-slider {
        flex: none;
        width: 100% !important;
        height: var(--dmzp-horizontal-thumb-size, auto) !important;
    }

    .dmzp-gallery .dmzp-thumb-slider .swiper-wrapper {
        height: var(--dmzp-horizontal-thumb-size, auto);
    }

    .dmzp-gallery .dmzp-thumb-slider .swiper-slide {
        aspect-ratio: 1 / 1;
        height: var(--dmzp-horizontal-thumb-size, auto) !important;
        max-height: var(--dmzp-horizontal-thumb-size, none);
    }

    .dmzp-product-attributes--inline .dmzp-product-attribute {
        flex-wrap: wrap;
    }

    button.dmzp-video-play,
    button.dmzp-video-play:hover,
    button.dmzp-video-play:focus,
    button.dmzp-video-play:active {
        width: 58px;
        height: 58px;
    }

    button.dmzp-video-play svg {
        width: 28px;
        height: 28px;
    }

    .dmzp-video-lightbox {
        padding: 64px 16px 24px;
    }

    .dmzp-video-lightbox__frame {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    button.dmzp-video-play,
    button.dmzp-video-lightbox__close {
        transition: none;
    }
}
