.cw-consent,
.cw-consent * {
    box-sizing: border-box;
}

.cw-consent {
    position: fixed;
    right: 20px;
    bottom: 0;
    left: 20px;
    z-index: 10050;
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 22px;
    border: 1px solid #d5e5eb;
    border-radius: 8px 8px 0 0;
    background: #fff;
    box-shadow: 0 22px 70px rgba(20, 59, 86, 0.24);
    color: #203744;
    font-family: 'Manrope', 'Montserrat', sans-serif;
}

.cw-consent[hidden],
.cw-consent-settings[hidden] {
    display: none !important;
}

.cw-consent__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 26px;
    align-items: center;
}

.cw-consent__copy {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 15px;
    align-items: start;
}

.cw-consent__icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: #e7f5f1;
    color: #126f95;
    font-size: 1rem;
}

.cw-consent h2 {
    margin: 0 0 6px;
    color: #143b56;
    font-size: 1rem;
    line-height: 1.35;
    text-align: left;
    letter-spacing: 0;
}

.cw-consent p {
    max-width: 760px;
    margin: 0;
    color: #607582;
    font-size: 0.84rem;
    line-height: 1.55;
}

.cw-consent a {
    color: #126f95;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cw-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: flex-end;
}

.cw-consent__button {
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid #1d8fbd;
    border-radius: 6px;
    background: #fff;
    color: #126f95;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.cw-consent__button--primary {
    border-color: #ff6b6b;
    background: #ff6b6b;
    color: #fff;
}

.cw-consent__button:hover,
.cw-consent__button:focus-visible {
    box-shadow: 0 0 0 3px rgba(29, 143, 189, 0.16);
}

.cw-consent-settings {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: grid;
    padding: 18px;
    place-items: center;
    background: rgba(10, 33, 47, 0.64);
    font-family: 'Manrope', 'Montserrat', sans-serif;
}

.cw-consent-settings__dialog {
    width: min(620px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 26px 80px rgba(8, 29, 43, 0.3);
}

.cw-consent-settings__header {
    display: flex;
    padding: 22px 24px 18px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #d5e5eb;
}

.cw-consent-settings__header h2 {
    margin: 0 0 5px;
    color: #143b56;
    font-size: 1.35rem;
    line-height: 1.3;
    text-align: left;
    letter-spacing: 0;
}

.cw-consent-settings__header p {
    margin: 0;
    color: #607582;
    font-size: 0.86rem;
    line-height: 1.55;
}

.cw-consent-settings__close {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    border: 1px solid #d5e5eb;
    border-radius: 50%;
    background: #fff;
    color: #143b56;
    font-size: 1.35rem;
    cursor: pointer;
}

.cw-consent-settings__body {
    display: grid;
    gap: 0;
    padding: 0 24px;
}

.cw-consent-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    padding: 20px 0;
    align-items: start;
    border-bottom: 1px solid #d5e5eb;
}

.cw-consent-option:last-child {
    border-bottom: 0;
}

.cw-consent-option strong {
    display: block;
    margin-bottom: 5px;
    color: #203744;
    font-size: 0.95rem;
}

.cw-consent-option span {
    display: block;
    color: #607582;
    font-size: 0.82rem;
    line-height: 1.55;
}

.cw-consent-option__required {
    color: #2c816d !important;
    font-weight: 800;
}

.cw-consent-switch {
    position: relative;
    display: inline-flex;
    width: 48px;
    height: 28px;
    flex: 0 0 auto;
}

.cw-consent-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.cw-consent-switch span {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: #c8d5da;
    cursor: pointer;
}

.cw-consent-switch span::before {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(20, 59, 86, 0.25);
    content: "";
    transition: transform 0.2s ease;
}

.cw-consent-switch input:checked + span {
    background: #1d8fbd;
}

.cw-consent-switch input:checked + span::before {
    transform: translateX(20px);
}

.cw-consent-switch input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(29, 143, 189, 0.2);
}

.cw-consent-settings__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 24px 22px;
    justify-content: flex-end;
    border-top: 1px solid #d5e5eb;
}

.cw-consent-settings-open {
    overflow: hidden;
}

.privacy-form-notice {
    margin: 9px 0 0;
    color: #657984;
    font-size: 0.72rem;
    line-height: 1.5;
}

.privacy-form-notice a {
    color: #126f95;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Shared booking dialog refinements. Other modal families keep their own spacing. */
#bookingModalContent > .modal-sticky-header {
    padding: 15px 54px 15px 20px;
}

#bookingModalContent > .modal-sticky-header h2 {
    line-height: 1.2;
}

#bookingModalContent > .modal-scrollable-body {
    padding: 22px 25px calc(26px + env(safe-area-inset-bottom, 0px));
}

#bookingModalContent .messenger-buttons {
    margin-bottom: 24px;
}

#bookingModalContent .form-divider {
    margin-top: 8px;
    margin-bottom: 24px;
}

#bookingModalContent .form-group {
    margin-bottom: 16px;
}

#bookingModalContent .privacy-form-notice {
    margin-top: 10px;
}

@media (max-width: 860px) {
    .cw-consent__inner {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cw-consent__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    #bookingModalContent > .modal-sticky-header {
        padding: 12px 50px 12px 18px;
    }

    #bookingModalContent > .modal-sticky-header h2 {
        font-size: 1.35rem;
    }

    #bookingModalContent > .modal-scrollable-body {
        padding: 18px 18px calc(20px + env(safe-area-inset-bottom, 0px));
    }

    .cw-consent {
        right: 10px;
        bottom: 0;
        left: 10px;
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .cw-consent__copy {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .cw-consent__icon {
        width: 36px;
        height: 36px;
    }

    .cw-consent__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .cw-consent__button {
        width: 100%;
        padding-right: 10px;
        padding-left: 10px;
    }

    .cw-consent__button--settings {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .cw-consent__actions [data-consent-reject] {
        grid-column: 1;
        grid-row: 1;
    }

    .cw-consent__actions [data-consent-accept] {
        grid-column: 2;
        grid-row: 1;
    }

    .cw-consent-settings {
        padding: 10px;
        place-items: end center;
    }

    .cw-consent-settings__dialog {
        max-height: calc(100vh - 20px);
    }

    .cw-consent-settings__header,
    .cw-consent-settings__body,
    .cw-consent-settings__footer {
        padding-right: 18px;
        padding-left: 18px;
    }

    .cw-consent-settings__footer {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cw-consent-settings__footer .cw-consent__button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cw-consent-switch span::before {
        transition: none;
    }
}
