﻿/* ============================================================
   HUDCO COOKIE CONSENT
============================================================ */

.cookie-consent,
.cookie-modal {
    box-sizing: border-box;
}

    .cookie-consent *,
    .cookie-modal * {
        box-sizing: border-box;
    }


/* ============================================================
   COOKIE BANNER
============================================================ */

.cookie-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: var(--surface-primary);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -5px 22px rgba(21, 2, 2, .08);
}

.cookie-consent__container {
    width: min(1190px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.cookie-consent__content {
    flex: 1;
    min-width: 0;
}

.cookie-consent__title {
    margin: 0 0 5px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.cookie-consent__text,
.cookie-consent__policy-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.cookie-consent__policy-text {
    margin-top: 2px;
}


/* ============================================================
   COOKIE LINK
============================================================ */

.cookie-link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand-900);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

    .cookie-link-button:hover,
    .cookie-link-button:focus-visible {
        color: var(--brand-700);
    }


/* ============================================================
   BUTTONS
============================================================ */

.cookie-consent__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-btn {
    min-height: 38px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.cookie-btn--primary {
    border-color: var(--button-primary-bg);
    background: var(--button-primary-bg);
    color: var(--surface-primary);
}

    .cookie-btn--primary:hover {
        border-color: var(--button-primary-hover);
        background: var(--button-primary-hover);
        color: var(--surface-primary);
    }

.cookie-btn--secondary {
    border-color: var(--border-light);
    background: var(--surface-secondary);
    color: var(--text-primary);
}

    .cookie-btn--secondary:hover {
        border-color: var(--brand-300);
        background: var(--brand-100);
        color: var(--brand-900);
    }


/* ============================================================
   FOCUS STATES
============================================================ */

.cookie-btn:focus-visible,
.cookie-link-button:focus-visible,
.cookie-modal__close:focus-visible,
.cookie-switch input:focus-visible + .cookie-switch__slider {
    outline: 3px solid rgba(119, 29, 29, .28);
    outline-offset: 3px;
}


/* ============================================================
   MODAL
============================================================ */

.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

    .cookie-modal.is-open {
        display: flex;
    }

.cookie-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(21, 2, 2, .50);
}

.cookie-modal__dialog {
    position: relative;
    width: min(685px, 100%);
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 9px;
    background: var(--surface-primary);
    box-shadow: 0 22px 55px rgba(0, 0, 0, .18);
}


/* ============================================================
   MODAL HEADER
============================================================ */

.cookie-modal__header {
    padding: 22px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border-light);
}

.cookie-modal__eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--brand-900);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.cookie-modal__header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 25px;
    font-weight: 700;
}

.cookie-modal__close {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--surface-secondary);
    color: var(--text-secondary);
    font-size: 27px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

    .cookie-modal__close:hover {
        background: var(--brand-100);
        color: var(--brand-900);
    }


/* ============================================================
   MODAL BODY
============================================================ */

.cookie-modal__body {
    padding: 22px 24px;
    overflow-y: auto;
}

.cookie-settings-intro {
    margin: 0 0 22px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.65;
}


/* ============================================================
   COOKIE CATEGORY
============================================================ */

.cookie-category {
    padding: 19px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--surface-primary);
}

    .cookie-category + .cookie-category {
        margin-top: 10px;
    }

.cookie-category__content {
    flex: 1;
}

.cookie-category__type {
    display: block;
    margin-bottom: 4px;
    color: var(--brand-900);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cookie-category h3 {
    margin: 0 0 4px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
}

.cookie-category p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.cookie-category__control {
    flex-shrink: 0;
}


/* ============================================================
   ALWAYS ACTIVE STATUS
============================================================ */

.cookie-always-active {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 4px;
    background: color-mix( in srgb, var(--status-success) 10%, var(--surface-primary) );
    color: var(--status-success);
    font-size: 12px;
    font-weight: 700;
}


/* ============================================================
   SWITCH
============================================================ */

.cookie-switch {
    position: relative;
    display: inline-flex;
    width: 46px;
    height: 26px;
    cursor: pointer;
}

    .cookie-switch input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }

.cookie-switch__slider {
    position: absolute;
    inset: 0;
    border-radius: 99px;
    background: var(--border-medium);
    transition: background-color .2s ease;
}

    .cookie-switch__slider::before {
        content: "";
        position: absolute;
        top: 3px;
        left: 3px;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: var(--surface-primary);
        box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
        transition: transform .2s ease;
    }

.cookie-switch input:checked + .cookie-switch__slider {
    background: var(--brand-900);
}

    .cookie-switch input:checked + .cookie-switch__slider::before {
        transform: translateX(20px);
    }


/* ============================================================
   MODAL FOOTER
============================================================ */

.cookie-modal__footer {
    padding: 18px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border-light);
    background: var(--surface-secondary);
}


/* ============================================================
   ACCESSIBILITY HELPER
============================================================ */

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}


/* ============================================================
   MODAL BODY LOCK
============================================================ */

body.cookie-modal-open {
    overflow: hidden;
}


/* ============================================================
   TABLET
============================================================ */

@media (max-width: 1050px) {

    .cookie-consent__container {
        align-items: flex-start;
        flex-direction: column;
        gap: 17px;
    }

    .cookie-consent__actions {
        width: 100%;
        justify-content: flex-start;
    }
}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 600px) {

    .cookie-consent__container {
        width: calc(100% - 24px);
        padding: 15px 0;
    }

    .cookie-consent__title {
        font-size: 15px;
    }

    .cookie-consent__text,
    .cookie-consent__policy-text {
        font-size: 12px;
    }

    .cookie-consent__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cookie-btn {
        width: 100%;
    }

    .cookie-consent__actions .cookie-btn--primary {
        order: -1;
    }

    .cookie-modal {
        padding: 10px;
    }

    .cookie-modal__dialog {
        max-height: calc(100vh - 20px);
    }

    .cookie-modal__header,
    .cookie-modal__body,
    .cookie-modal__footer {
        padding-right: 17px;
        padding-left: 17px;
    }

    .cookie-category {
        align-items: flex-start;
        gap: 14px;
        padding: 15px;
    }

    .cookie-category__control {
        padding-top: 6px;
    }

    .cookie-modal__footer {
        flex-direction: column;
    }
}


/* ============================================================
   LINK BUTTON
============================================================ */

.cookie-btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

    .cookie-btn-link:hover,
    .cookie-btn-link:focus {
        text-decoration: none;
    }
