.dwcw {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: inherit;
}

.dwcw__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 8px 16px 8px 13px;
    border: 0;
    border-radius: 999px;
    background: #17171a;
    color: #fff;
    box-shadow: 0 12px 35px rgba(0,0,0,.20);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    transition: transform .2s ease, box-shadow .2s ease;
}

.dwcw__toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0,0,0,.25);
}

.dwcw__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ed1745;
    font-size: 16px;
}

.dwcw__label {
    white-space: nowrap;
}

.dwcw__button {
    color: #ff496d;
    white-space: nowrap;
}

.dwcw__panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: 360px;
    padding: 24px;
    border-radius: 20px;
    background: #fff;
    color: #17171a;
    box-shadow: 0 20px 60px rgba(0,0,0,.20);
    border: 1px solid rgba(0,0,0,.07);
    max-height: min(820px, calc(100vh - 40px));
    overflow-y: auto;
    scrollbar-width: thin;
    animation: dwcwIn .22s ease both;
}

.dwcw__panel[hidden] {
    display: none;
}

.dwcw__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #777;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.dwcw__close:hover {
    color: #17171a;
}

.dwcw__eyebrow {
    margin-bottom: 9px;
    color: #ed1745;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
}

.dwcw__panel h3 {
    margin: 0 24px 10px 0;
    font-size: 22px;
    line-height: 1.15;
}

.dwcw__panel p {
    margin: 0 0 20px;
    color: #68686e;
    font-size: 14px;
    line-height: 1.55;
}

.dwcw__cta {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 10px;
    background: #ed1745;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 700;
    transition: transform .2s ease, background .2s ease;
}

.dwcw__cta:hover {
    background: #d90f3a;
    transform: translateY(-1px);
}

.dwcw__email {
    display: block;
    margin-top: 13px;
    color: #17171a !important;
    text-align: center;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
}

.dwcw__note {
    margin-top: 16px;
    color: #8a8a90;
    text-align: center;
    font-size: 11px;
}

@keyframes dwcwIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 767px) {
    .dwcw {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .dwcw__toggle {
        width: 54px;
        height: 54px;
        min-height: 54px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .dwcw__icon {
        width: 38px;
        height: 38px;
        background: transparent;
        font-size: 19px;
    }

    .dwcw__label,
    .dwcw__button {
        display: none;
    }

    .dwcw__panel {
        right: 0;
        bottom: 66px;
        width: min(380px, calc(100vw - 24px));
        padding: 20px;
        max-height: calc(100vh - 28px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dwcw__toggle,
    .dwcw__panel,
    .dwcw__cta {
        animation: none;
        transition: none;
    }
}

/* Formularz CF7 w panelu widgetu */
.dwcw__form {
    margin-top: 4px;
}

.dwcw__form form {
    margin: 0;
}

.dwcw__form p {
    margin: 0 0 10px;
}

.dwcw__form label {
    display: block;
    margin: 0 0 5px;
    color: #17171a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.dwcw__form input[type="text"],
.dwcw__form input[type="email"],
.dwcw__form select,
.dwcw__form textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 8px;
    padding: 9px 11px;
    border: 1px solid #dedee2;
    border-radius: 9px;
    background-color: #fff;
    background-image: none !important;
    color: #17171a;
    font: inherit;
    font-size: 13px;
    line-height: 1.3;
    min-height: 42px;
    outline: none;
}

/* Select CF7: resetuje strzałki/obrazy nakładane przez motyw lub Elementora */
.dwcw__form select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    padding-right: 38px;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2317171a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 13px center !important;
    background-size: 12px 8px !important;
}

.dwcw__form select::-ms-expand {
    display: none;
}

.dwcw__form textarea {
    min-height: 72px;
    resize: vertical;
}

.dwcw__form input:focus,
.dwcw__form select:focus,
.dwcw__form textarea:focus {
    border-color: #ed1745;
    box-shadow: 0 0 0 2px rgba(237,23,69,.10);
}

.dwcw__form .wpcf7-list-item {
    margin: 0;
}

.dwcw__form .wpcf7-acceptance {
    display: block;
    margin: 0 0 10px;
}

.dwcw__form .wpcf7-acceptance label {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    color: #77777d;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.4;
}

.dwcw__form .wpcf7-acceptance input {
    flex: 0 0 auto;
    margin-top: 2px;
}

.dwcw__form .wpcf7-acceptance a {
    color: #17171a !important;
    text-decoration: underline !important;
}

.dwcw__form input[type="submit"] {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 0 !important;
    border-radius: 9px;
    background: #ed1745 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
    opacity: 1 !important;
}

.dwcw__form input[type="submit"]:hover,
.dwcw__form input[type="submit"]:focus {
    background: #d90f3a !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    opacity: 1 !important;
}

/* Ochrona przed globalnymi stylami motywu/Elementora */
.dwcw__form .wpcf7-submit,
.dwcw__form .wpcf7-submit:hover,
.dwcw__form .wpcf7-submit:focus,
.dwcw__form button,
.dwcw__form button:hover,
.dwcw__form button:focus {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
}



/* Czytelny status wysyłki formularza CF7 */
.dwcw__status {
    margin: 0 0 10px;
    padding: 9px 11px;
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 600;
}

.dwcw__status[hidden] {
    display: none !important;
}

.dwcw__status.is-success {
    background: #eef9f1;
    border: 1px solid #bfe7c8;
    color: #176b2d;
}

.dwcw__status.is-error {
    background: #fff1f3;
    border: 1px solid #f3c2cc;
    color: #a31332;
}

.dwcw__form .wpcf7-not-valid-tip {
    margin: -7px 0 8px;
    font-size: 10px;
}

.dwcw__form .wpcf7-response-output {
    margin: 10px 0 0 !important;
    padding: 8px 10px !important;
    border-radius: 8px;
    font-size: 10px;
    line-height: 1.4;
}

.dwcw__form .form-note {
    margin: 9px 0 0;
    color: #8a8a90;
    text-align: center;
    font-size: 10px;
    font-weight: 400;
}


/* Kompaktowy układ mobilny — cały formularz pozostaje możliwie wysoko w panelu. */
@media (max-width: 767px) {
    .dwcw__panel h3 {
        margin-bottom: 8px;
        font-size: 21px;
        line-height: 1.12;
    }

    .dwcw__panel > p {
        margin-bottom: 14px;
        font-size: 13px;
        line-height: 1.45;
    }

    .dwcw__form label {
        margin-bottom: 4px;
        font-size: 11px;
    }

    .dwcw__form p {
        margin-bottom: 7px;
    }

    .dwcw__form input[type="text"],
    .dwcw__form input[type="email"],
    .dwcw__form select {
        min-height: 42px;
        margin-bottom: 7px;
        padding: 8px 11px;
    }

    .dwcw__form textarea {
        min-height: 68px;
        max-height: 100px;
        margin-bottom: 7px;
    }

    .dwcw__form .wpcf7-acceptance {
        margin-bottom: 9px;
    }

    .dwcw__form input[type="submit"] {
        min-height: 44px;
    }

    .dwcw__form .form-note {
        margin-top: 7px;
    }

    .dwcw__email {
        margin-top: 9px;
    }
}
