.sd-legal-consent {
    margin: 14px 0 16px;
    padding: 12px;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    background: #fafafa;
    font-size: 13px;
    line-height: 1.5;
}

.sd-legal-consent__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.sd-legal-policy-link {
    color: var(--e-global-color-primary, #ef4e3a);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

a.sd-legal-policy-link,
a.sd-legal-policy-link:hover,
a.sd-legal-policy-link:focus {
    color: var(--e-global-color-primary, #ef4e3a);
}

.sd-legal-consent__divider {
    color: #8b8b8b;
}

.sd-legal-consent__check {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    cursor: pointer;
}

.sd-legal-consent label.sd-legal-consent__check {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    column-gap: 6px !important;
    row-gap: 0 !important;
}

.sd-legal-consent__input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.sd-legal-consent__box {
    width: 18px;
    height: 18px;
    border: 1px solid #bfc5cc;
    border-radius: 4px;
    background: #fff;
    flex: 0 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    align-self: center;
}

.sd-legal-consent__box::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -3px;
    margin-left: -4px;
}

.sd-legal-consent__input:checked + .sd-legal-consent__box {
    background: #ef4e3a;
    border-color: #ef4e3a;
}

.sd-legal-consent__input:checked + .sd-legal-consent__box::after {
    opacity: 1;
}

.sd-legal-consent__input:focus-visible + .sd-legal-consent__box {
    outline: 2px solid rgba(239, 78, 58, 0.35);
    outline-offset: 1px;
}

.sd-legal-consent__text {
    color: #4f5965;
    line-height: 19px;
    flex: 1;
    margin: 0;
    display: inline-flex;
    align-items: center;
    min-height: 18px;
}

.sd-legal-consent__error {
    margin-top: 8px;
    color: #b42318;
    font-size: 12px;
}

form.checkout .sd-legal-consent {
    margin-bottom: 14px;
}

.sd-legal-dialog {
    width: min(700px, calc(100vw - 24px));
    max-height: min(80vh, 720px);
    border: none;
    border-radius: 14px;
    margin: auto;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
    color: #1a1a1a;
    box-shadow: 0 24px 48px rgba(15, 20, 30, 0.2);
    z-index: 9999;
}

.sd-legal-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.sd-legal-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #ebebeb;
}

.sd-legal-dialog__head h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.sd-legal-dialog__close {
    appearance: none;
    -webkit-appearance: none;
    border: none !important;
    border-radius: 8px !important;
    background: var(--e-global-color-primary, #ef4e3a) !important;
    color: #fff !important;
    width: 32px;
    height: 32px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.18s ease;
    box-shadow: none !important;
    text-transform: none !important;
    padding: 0 !important;
    font-family: inherit;
    position: relative;
}

.sd-legal-dialog__close::before {
    content: "✕";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    line-height: 1;
}

.sd-legal-dialog__close:hover,
.sd-legal-dialog__close:focus {
    background: var(--e-global-color-primary, #ef4e3a) !important;
    color: #fff !important;
    filter: brightness(0.92);
    box-shadow: 0 0 0 3px rgba(239, 78, 58, 0.28) !important;
}

.sd-legal-dialog__body {
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(80vh - 70px);
    font-size: 14px;
    line-height: 1.65;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

body.sd-legal-dialog-fallback-open {
    overflow: hidden;
}

body.sd-legal-dialog-fallback-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9998;
}

.sd-legal-dialog.is-fallback-open {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

@media (max-width: 768px) {
    .sd-legal-consent {
        padding: 10px;
    }

    .sd-legal-dialog {
        width: calc(100vw - 16px);
        max-height: 86vh;
    }

    .sd-legal-dialog__head {
        padding: 12px;
    }

    .sd-legal-dialog__head h3 {
        font-size: 16px;
    }

    .sd-legal-dialog__body {
        padding: 12px;
        max-height: calc(86vh - 58px);
    }
}
