/* Cookie consent banner + preferences modal (template-parts/cookie-consent.php) */

.cookie-consent [hidden] {
    display: none !important;
}
.cookie-consent .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.cookie-consent a {
    color: #008777;
    text-decoration: underline;
}
.cookie-consent a:hover {
    color: #005F54;
}
.cookie-consent .primary-button,
.cookie-consent .secondary-button {
    font-size: 12px;
    line-height: 20px;
    padding: 8px 24px;
    white-space: nowrap;
}
.cookie-consent .primary-button:focus,
.cookie-consent .secondary-button:focus {
    border-width: 1px !important;
}
.cookie-consent .primary-button:focus-visible,
.cookie-consent .secondary-button:focus-visible {
    outline: 3px solid #85D0C7 !important;
    outline-offset: 2px;
}

.cookie-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #121212;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.cookie-close:hover {
    background-color: #F0F0F0;
}
.cookie-close:focus-visible {
    outline: 3px solid #85D0C7;
}

/* ---------- Banner ---------- */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    padding: 24px 80px 28px;
    background: #fff;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
    font-family: "Work Sans", Sans-serif;
}
.cookie-banner__text {
    max-width: 560px;
}
.cookie-banner__title,
.cookie-modal__title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: #121212;
}
.cookie-banner__title {
    text-transform: uppercase;
}
.cookie-banner p,
.cookie-modal__intro {
    margin: 0;
    font-size: 13px;
    line-height: 20px;
    color: #6B6B6B;
}
.cookie-banner__actions {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

/* ---------- Floating "Cookie settings" button ---------- */
.cookie-fab {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #008777;
    color: #fff;
    cursor: pointer;
    box-shadow: 0px 12px 7px 0px rgba(0, 135, 119, 0.05), 0px 6px 6px 0px rgba(0, 135, 119, 0.09), 0px 1px 3px 0px rgba(0, 135, 119, 0.15);
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.cookie-fab:hover {
    background: #005F54;
    transform: scale(1.05);
}
.cookie-fab:focus-visible {
    outline: 3px solid #85D0C7;
    outline-offset: 2px;
}
.cookie-fab svg {
    width: 26px;
    height: 26px;
}

/* ---------- Modal ---------- */
html.cookie-modal-open {
    overflow: hidden;
}
.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: "Work Sans", Sans-serif;
}
.cookie-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(18, 18, 18, 0.45);
}
.cookie-modal__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 540px;
    max-height: min(640px, 100%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    outline: none;
}
.cookie-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 28px 24px 8px;
    overscroll-behavior: contain;
}
.cookie-modal__intro {
    margin-bottom: 12px;
}
.cookie-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 24px 24px;
}
.cookie-modal__actions > * {
    flex: 1 1 0;
}

/* Categories */
.cookie-categories {
    margin: 0;
    padding: 0;
    list-style: none;
}
.cookie-category {
    border-bottom: 1px solid #EDEDED;
}
.cookie-category:last-child {
    border-bottom: none;
}
.cookie-category__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 52px;
}
.cookie-category__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    padding: 14px 0;
    border: none;
    background: none;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #121212;
    text-align: left;
    cursor: pointer;
}
.cookie-category__toggle:focus-visible {
    outline: 3px solid #85D0C7;
    outline-offset: 2px;
}
.cookie-category__chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.cookie-category__toggle[aria-expanded="true"] .cookie-category__chevron {
    transform: rotate(90deg);
}
.cookie-category__always {
    font-size: 12px;
    color: #008777;
}
.cookie-category__desc p {
    margin: 0 0 16px 22px;
    font-size: 12px;
    line-height: 18px;
    color: #4A4A4A;
}

/* Switch */
.cookie-switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
}
.cookie-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.cookie-switch__track {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: #E6E6E6;
    border: 1px solid #D6D6D6;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.cookie-switch__track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}
.cookie-switch input:checked + .cookie-switch__track {
    background: #008777;
    border-color: #008777;
}
.cookie-switch input:checked + .cookie-switch__track::after {
    transform: translateX(18px);
}
.cookie-switch input:focus-visible + .cookie-switch__track {
    outline: 3px solid #85D0C7;
    outline-offset: 2px;
}

/* Footer "Cookie settings" link */
footer .cookie-settings-link {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    cursor: pointer;
    transition: opacity 0.2s ease-in-out;
}
footer .cookie-settings-link:hover {
    opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent *,
    .cookie-consent *::after {
        transition: none !important;
    }
}

@media only screen and (max-width: 1024px) {
    .cookie-banner {
        padding: 24px 32px;
        gap: 24px;
    }
}

@media only screen and (max-width: 767px) {
    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        padding: 32px 16px 16px;
        text-align: center;
    }
    .cookie-banner__text {
        max-width: none;
    }
    .cookie-banner__title {
        font-size: 14px;
        margin-bottom: 12px;
    }
    .cookie-banner__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .cookie-banner__actions .js-cookie-manage {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .cookie-consent .primary-button,
    .cookie-consent .secondary-button {
        width: 100%;
        padding: 8px 12px;
    }

    .cookie-fab {
        left: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }
    .cookie-fab svg {
        width: 24px;
        height: 24px;
    }

    .cookie-modal {
        padding: 0;
    }
    .cookie-modal__dialog {
        max-width: none;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }
    .cookie-modal__body {
        padding: 20px 16px 8px;
    }
    .cookie-modal__title {
        font-size: 14px;
        padding-right: 32px;
    }
    .cookie-modal__actions {
        flex-direction: column;
        padding: 16px;
    }
    .cookie-modal__actions > * {
        flex: none;
    }
}
