/* ==========================================================================
   easyLOOP Datenschutz & Impressum Popup Styles
   ========================================================================== */

/* Заборона скролу сторінки під відкритим попапом */
body.ds-modal-open {
    overflow: hidden !important;
}

/* Оверлей (напівпрозоре затемнення фону) */
#ds_overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 999998 !important;
    cursor: pointer;
    animation: dsFadeIn 0.2s ease-out forwards;
}

/* Контейнер попапу, зафіксований по центру екрану */
#data2show {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 820px !important;
    max-height: 85vh !important;
    background-color: #ffffff !important;
    color: #333333 !important;
    z-index: 999999 !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 1px rgba(0, 0, 0, 0.15) !important;
    padding: 35px 25px 25px 30px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.65 !important;
    text-align: left !important;
    display: flex !important;
    flex-direction: column !important;
    animation: dsScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Внутрішній блок з контентом та скролом */
.ds-scroll-content {
    overflow-y: auto !important;
    max-height: calc(85vh - 65px) !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
}

/* Якщо .ds-scroll-content не використовується або контент вставлений безпосередньо */
#data2show:not(:has(.ds-scroll-content)) {
    overflow-y: auto !important;
}

/* Анімації */
@keyframes dsFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes dsScaleIn {
    from {
        opacity: 0;
        transform: translate(-50%, -46%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Кнопка закриття (хрестик) */
#closeDS {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    z-index: 1000000 !important;
    opacity: 0.7 !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
}

#closeDS:hover {
    opacity: 1 !important;
    transform: scale(1.1) !important;
}

#closeDS img {
    width: 26px !important;
    height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    display: block !important;
    border: 0 !important;
}

/* Кастомний скролбар для контенту */
.ds-scroll-content::-webkit-scrollbar,
#data2show::-webkit-scrollbar {
    width: 7px;
}

.ds-scroll-content::-webkit-scrollbar-track,
#data2show::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.ds-scroll-content::-webkit-scrollbar-thumb,
#data2show::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.ds-scroll-content::-webkit-scrollbar-thumb:hover,
#data2show::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Стилізація типографіки всередині попапу */
#data2show h2 {
    color: #1a3c6e !important;
    font-size: 19px !important;
    font-weight: 600 !important;
    margin: 20px 0 10px 0 !important;
    padding-bottom: 5px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    line-height: 1.3 !important;
    text-align: left !important;
}

#data2show h2:first-child,
.ds-scroll-content > h2:first-child,
.ds-scroll-content > *:first-child > h2:first-child {
    margin-top: 0 !important;
}

#data2show p {
    margin: 0 0 10px 0 !important;
    color: #475569 !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
}

#data2show strong {
    color: #1e293b !important;
}

#data2show a {
    color: #1a3c6e !important;
    text-decoration: underline !important;
    transition: color 0.2s ease !important;
}

#data2show a:hover {
    color: #0f2240 !important;
    text-decoration: none !important;
}

/* Оформлення кнопок у футері */
#imp-daten {
    display: inline-block !important;
    margin: 5px 0 8px 0 !important;
    text-align: center !important;
    line-height: normal !important;
}

#imp-daten a {
    display: inline-block !important;
    color: #ffffff !important;
    font-size: 13px !important;
    text-decoration: none !important;
    padding: 2px 4px !important;
    margin: 0 6px !important;
    opacity: 0.9 !important;
    transition: opacity 0.2s ease, text-decoration 0.2s ease !important;
    cursor: pointer !important;
}

#imp-daten a:hover {
    opacity: 1 !important;
    text-decoration: underline !important;
}

#imp-daten a#impr_button::after {
    content: "|" !important;
    margin-left: 14px !important;
    opacity: 0.6 !important;
    color: #ffffff !important;
    display: inline-block !important;
    pointer-events: none !important;
}

/* Мобільна адаптивність */
@media (max-width: 768px) {
    #data2show {
        width: 94% !important;
        max-height: 90vh !important;
        padding: 30px 16px 16px 18px !important;
        font-size: 13px !important;
    }

    .ds-scroll-content {
        max-height: calc(90vh - 50px) !important;
        padding-right: 6px !important;
    }

    #closeDS {
        top: 8px !important;
        right: 8px !important;
    }

    #closeDS img {
        width: 24px !important;
        height: 24px !important;
    }

    #data2show h2 {
        font-size: 17px !important;
        margin: 16px 0 8px 0 !important;
    }
}
