/* =========================================================
   APC – WPLP COOKIE CONSENT
   Stable baseline styling
   ========================================================= */


/* ---------------------------------------------------------
   Main cookie banner
   --------------------------------------------------------- */

#gdpr-cookie-consent-bar {
    gap: 8px !important;
    padding-top: 16px !important;
    padding-bottom: 12px !important;
}

#gdpr-cookie-consent-bar .gdpr-notice-content-body,
#gdpr-cookie-consent-bar .gdpr-notice-content-body p {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

#gdpr-cookie-consent-bar .cookie_notice_buttons {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
}

#gdpr-cookie-consent-bar .left_buttons,
#gdpr-cookie-consent-bar .right_buttons {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex: 0 0 auto !important;
    width: auto !important;
    gap: 10px !important;
    margin: 0 !important;
}

#gdpr-cookie-consent-bar #cookie_action_reject,
#gdpr-cookie-consent-bar #cookie_action_settings,
#gdpr-cookie-consent-bar #cookie_action_accept_all {
    margin: 0 !important;
    white-space: nowrap !important;
}

#gdpr-cookie-consent-bar #cookie_action_accept_all:hover,
#gdpr-cookie-consent-bar #cookie_action_accept_all:focus {
    background-color: #A06CAD !important;
    border-color: #A06CAD !important;
    color: #ffffff !important;
}

/* Remove the ambiguous close control from the first banner */
#cookie-banner-cancle-img {
    display: none !important;
}


/* ---------------------------------------------------------
   Preferences panel
   --------------------------------------------------------- */

#gdpr-gdprmodal .gdprmodal-dialog {
    width: calc(100% - 32px) !important;
    max-width: 780px !important;
    margin: 16px auto !important;
}

#gdpr-gdprmodal .gdprmodal-content {
    border: 1px solid #cecece !important;
    border-radius: 5px !important;
    box-shadow: 0 12px 36px rgba(1, 63, 82, 0.18) !important;
    overflow: hidden !important;
}

#gdpr-gdprmodal .gdprmodal-body {
    max-height: 68vh !important;
    padding: 26px 28px 12px !important;
}

#gdpr-gdprmodal .gdpr-about-cookies {
    margin: 0 0 18px !important;
    padding-right: 34px !important;
    font-size: 15px !important;
    line-height: 1.55 !important;
}

#gdpr-gdprmodal ul.category-group {
    margin: 0 !important;
    padding: 0 !important;
}

#gdpr-gdprmodal .category-item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

#gdpr-gdprmodal .gdpr-category-toggle {
    padding: 13px 0 !important;
}

#gdpr-gdprmodal .category-header {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #013f52 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
}

#gdpr-gdprmodal .category-item hr {
    border: 0 !important;
    border-top: 1px solid #cecece !important;
    opacity: 1 !important;
}

/* Hide the unused category */
#gdpr-gdprmodal .category-item:has(
    #gdpr_messagebar_body_button_unclassified
) {
    display: none !important;
}

/* Make the free-plan credit consistently black */
#gdpr-gdprmodal .powered-by-credits,
#gdpr-gdprmodal .powered-by-credits a,
#gdpr-gdprmodal .powered-by-credits a:visited,
#gdpr-gdprmodal .powered-by-credits a:hover,
#gdpr-gdprmodal .powered-by-credits a:focus {
    color: #000000 !important;
}


/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 767px) {

    #gdpr-cookie-consent-bar {
        padding: 16px 18px 12px !important;
    }

    #gdpr-gdprmodal .gdprmodal-dialog {
        width: calc(100% - 20px) !important;
        margin: 10px auto !important;
    }

    #gdpr-gdprmodal .gdprmodal-body {
        max-height: 67vh !important;
        padding: 22px 18px 10px !important;
    }

    #gdpr-gdprmodal .gdpr-about-cookies {
        padding-right: 26px !important;
        font-size: 14px !important;
    }
}
/* =========================================================
   APC – WPLP PREFERENCES PANEL SCROLLBAR
   The outer modal is the active scrolling element.
   ========================================================= */

/* Firefox */
#gdpr-gdprmodal {
    scrollbar-width: thin !important;
    scrollbar-color: #9b9b9b #eeeeee !important;
}

/* Chrome, Edge and Safari */
#gdpr-gdprmodal::-webkit-scrollbar {
    width: 12px !important;
}

#gdpr-gdprmodal::-webkit-scrollbar-track {
    background: #eeeeee !important;
}

#gdpr-gdprmodal::-webkit-scrollbar-thumb {
    background: #9b9b9b !important;
    border: 2px solid #eeeeee !important;
    border-radius: 8px !important;
}

#gdpr-gdprmodal::-webkit-scrollbar-thumb:hover {
    background: #707070 !important;
}

/* Remove WPLP/theme-coloured scrollbar arrow buttons */
#gdpr-gdprmodal::-webkit-scrollbar-button {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

/*
 * Fallback in case a future plugin update moves scrolling
 * back onto the modal body.
 */
#gdpr-gdprmodal .gdprmodal-body {
    scrollbar-width: thin !important;
    scrollbar-color: #9b9b9b #eeeeee !important;
}

#gdpr-gdprmodal .gdprmodal-body::-webkit-scrollbar {
    width: 12px !important;
}

#gdpr-gdprmodal .gdprmodal-body::-webkit-scrollbar-track {
    background: #eeeeee !important;
}

#gdpr-gdprmodal .gdprmodal-body::-webkit-scrollbar-thumb {
    background: #9b9b9b !important;
    border: 2px solid #eeeeee !important;
    border-radius: 8px !important;
}

#gdpr-gdprmodal .gdprmodal-body::-webkit-scrollbar-thumb:hover {
    background: #707070 !important;
}

#gdpr-gdprmodal .gdprmodal-body::-webkit-scrollbar-button {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}
/* =========================================================
   APC – WPLP PREFERENCES MODAL CLOSE BUTTON
   Keep the native X above the scrollable modal content.
   ========================================================= */

#gdpr-gdprmodal .gdprmodal-header {
    position: relative !important;
    z-index: 100 !important;
    pointer-events: none !important;
}

#gdpr-gdprmodal .gdprmodal-header .gdpr_action_button.close {
    position: absolute !important;
    top: 20px !important;
    right: 22px !important;
    z-index: 101 !important;
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

#gdpr-gdprmodal .gdprmodal-header .gdpr_action_button.close svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    pointer-events: none !important;
}

/* Keep the scrollable body below the close control */
#gdpr-gdprmodal .gdprmodal-body {
    position: relative !important;
    z-index: 1 !important;
}
/* =========================================================
   APC – MAIN BANNER SECONDARY BUTTON STATES
   Prevent retained focus from appearing as a green button
   ========================================================= */

/* Default, visited, active and retained-focus appearance */
#gdpr-cookie-consent-bar #cookie_action_reject,
#gdpr-cookie-consent-bar #cookie_action_reject:link,
#gdpr-cookie-consent-bar #cookie_action_reject:visited,
#gdpr-cookie-consent-bar #cookie_action_reject:active,
#gdpr-cookie-consent-bar #cookie_action_reject:focus,
#gdpr-cookie-consent-bar #cookie_action_settings,
#gdpr-cookie-consent-bar #cookie_action_settings:link,
#gdpr-cookie-consent-bar #cookie_action_settings:visited,
#gdpr-cookie-consent-bar #cookie_action_settings:active,
#gdpr-cookie-consent-bar #cookie_action_settings:focus {
    background-color: #ffffff !important;
    border: 1px solid #013f52 !important;
    color: #013f52 !important;
    text-decoration: none !important;
}

/* Green only while genuinely hovering */
#gdpr-cookie-consent-bar #cookie_action_reject:hover,
#gdpr-cookie-consent-bar #cookie_action_settings:hover {
    background-color: #62bb47 !important;
    border-color: #62bb47 !important;
    color: #ffffff !important;
}

/* Accessible keyboard-focus indicator without filling the button green */
#gdpr-cookie-consent-bar #cookie_action_reject:focus-visible,
#gdpr-cookie-consent-bar #cookie_action_settings:focus-visible {
    background-color: #ffffff !important;
    border-color: #013f52 !important;
    color: #013f52 !important;
    outline: 3px solid rgba(98, 187, 71, 0.4) !important;
    outline-offset: 2px !important;
}
/* =========================================================
   APC – WPLP PREFERENCES BUTTON ORDER AND COLOURS
   Exact selectors based on the live plugin markup
   ========================================================= */

/* Create a three-column footer layout */
#gdpr-gdprmodal .gdprmodal-footer {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 16px 28px !important;
    border-top: 1px solid #cecece !important;
}

/*
 * Remove the layout effect of WPLP's left and right wrappers.
 * Their buttons then become direct items in the footer grid.
 */
#gdpr-gdprmodal .gdprmodal-footer .gdpr-footer-left,
#gdpr-gdprmodal .gdprmodal-footer .gdpr-footer-right {
    display: contents !important;
}

/* ---------------------------------------------------------
   Button order
   --------------------------------------------------------- */

/* 1. Reject non-essential */
#gdpr-gdprmodal #cookie_action_reject {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

/* 2. Save And Accept */
#gdpr-gdprmodal #cookie_action_save {
    grid-column: 2 !important;
    grid-row: 1 !important;
}

/* 3. Accept all */
#gdpr-gdprmodal #cookie_action_accept_all {
    grid-column: 3 !important;
    grid-row: 1 !important;
}

/* ---------------------------------------------------------
   Shared button sizing
   --------------------------------------------------------- */

#gdpr-gdprmodal #cookie_action_reject,
#gdpr-gdprmodal #cookie_action_save,
#gdpr-gdprmodal #cookie_action_accept_all {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 12px 22px !important;
    border-radius: 30px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    text-transform: none !important;
    white-space: nowrap !important;
}

/* ---------------------------------------------------------
   Reject and Save: white with APC teal outline
   --------------------------------------------------------- */

#gdpr-gdprmodal #cookie_action_reject,
#gdpr-gdprmodal #cookie_action_save {
    background-color: #ffffff !important;
    border: 1px solid #013f52 !important;
    color: #013f52 !important;
}

/* Reject and Save: green hover/focus */
#gdpr-gdprmodal #cookie_action_reject:hover,
#gdpr-gdprmodal #cookie_action_reject:focus,
#gdpr-gdprmodal #cookie_action_save:hover,
#gdpr-gdprmodal #cookie_action_save:focus {
    background-color: #62bb47 !important;
    border-color: #62bb47 !important;
    color: #ffffff !important;
}

/* ---------------------------------------------------------
   Accept all: green with lilac hover
   --------------------------------------------------------- */

#gdpr-gdprmodal #cookie_action_accept_all {
    background-color: #62bb47 !important;
    border: 1px solid #62bb47 !important;
    color: #ffffff !important;
}

#gdpr-gdprmodal #cookie_action_accept_all:hover,
#gdpr-gdprmodal #cookie_action_accept_all:focus {
    background-color: #A06CAD !important;
    border-color: #A06CAD !important;
    color: #ffffff !important;
}

/* ---------------------------------------------------------
   WPLP credit on its own row
   --------------------------------------------------------- */

#gdpr-gdprmodal .gdprmodal-footer > div:last-child {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    margin: 4px 0 0 !important;
    text-align: center !important;
}

#gdpr-gdprmodal .powered-by-credits {
    margin: 0 !important;
    color: #000000 !important;
    text-align: center !important;
}

#gdpr-gdprmodal .powered-by-credits a,
#gdpr-gdprmodal .powered-by-credits a:visited,
#gdpr-gdprmodal .powered-by-credits a:hover,
#gdpr-gdprmodal .powered-by-credits a:focus {
    color: #000000 !important;
}

/* ---------------------------------------------------------
   Mobile layout
   --------------------------------------------------------- */

@media (max-width: 767px) {

    #gdpr-gdprmodal .gdprmodal-footer {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 14px 18px !important;
    }

    #gdpr-gdprmodal #cookie_action_reject {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    #gdpr-gdprmodal #cookie_action_save {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    #gdpr-gdprmodal #cookie_action_accept_all {
        grid-column: 1 !important;
        grid-row: 3 !important;
    }

    #gdpr-gdprmodal .gdprmodal-footer > div:last-child {
        grid-column: 1 !important;
        grid-row: 4 !important;
    }
}
/* =========================================================
   APC – MOBILE BANNER CREDIT SPACING
   ========================================================= */

/* Make the main-banner credit black on all devices */
#gdpr-cookie-consent-bar .powered-by-credits,
#gdpr-cookie-consent-bar .powered-by-credits a,
#gdpr-cookie-consent-bar .powered-by-credits a:visited,
#gdpr-cookie-consent-bar .powered-by-credits a:hover,
#gdpr-cookie-consent-bar .powered-by-credits a:focus {
    color: #000000 !important;
}

/* Add breathing room beneath the mobile buttons */
@media (max-width: 767px) {

    #gdpr-cookie-consent-bar .powered-by-credits {
        width: 100% !important;
        margin: 10px 0 0 !important;
        text-align: center !important;
        line-height: 1.4 !important;
    }
}