/**
 * WMES Cookie Consent - cookie-consent.css
 *
 * Uses CSS custom properties from WMES theme.json where available.
 * Fallback values are sensible defaults that work on any site.
 *
 * z-index: 99999 keeps the banner above all other content.
 */


/* =============================================================================
   BANNER
   Fixed to the bottom of the viewport, full width.
   ============================================================================= */

.wmes-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #ffffff;
    border-top: 3px solid var(--wp--preset--color--primary, #00A896);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    padding: 1.25rem 1.5rem;
    /* Smooth slide-in - triggered by removing the hidden attribute */
    animation: wmes-cc-slidein 0.25s ease-out;
}

@keyframes wmes-cc-slidein {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Inner layout: text left, buttons right - wraps on mobile */
.wmes-cookie-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Text block */
.wmes-cookie-banner__text {
    flex: 1;
    min-width: 220px;
}

.wmes-cookie-banner__heading {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--wp--preset--color--secondary, #0D4C6E);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.wmes-cookie-banner__body {
    font-size: 0.875rem;
    color: var(--wp--preset--color--dark-grey, #444444);
    margin: 0;
    line-height: 1.55;
}

.wmes-cookie-banner__body a {
    color: var(--wp--preset--color--primary, #00A896);
    text-decoration: underline;
}

.wmes-cookie-banner__body a:hover {
    opacity: 0.8;
}

/* Button group */
.wmes-cookie-banner__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}


/* =============================================================================
   BUTTONS
   Accept is filled (primary), Reject is outlined (secondary).
   Both are equal size and weight so neither is de-emphasised (ICO requirement).
   ============================================================================= */

.wmes-cookie-btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--wmes-corner-radius, 4px);
    border: 2px solid transparent;
    white-space: nowrap;
    transition: opacity 0.15s ease, transform 0.15s ease;
    font-family: inherit;
}

.wmes-cookie-btn:focus-visible {
    outline: 3px solid var(--wp--preset--color--primary, #00A896);
    outline-offset: 2px;
}

.wmes-cookie-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.wmes-cookie-btn:active {
    transform: translateY(0);
}

/* Accept - filled primary */
.wmes-cookie-btn--accept {
    background-color: var(--wp--preset--color--primary, #00A896);
    border-color:     var(--wp--preset--color--primary, #00A896);
    color: #ffffff;
}

/* Reject - outlined secondary */
.wmes-cookie-btn--reject {
    background-color: transparent;
    border-color: var(--wp--preset--color--secondary, #0D4C6E);
    color:         var(--wp--preset--color--secondary, #0D4C6E);
}


/* =============================================================================
   COOKIE PREFERENCES BUTTON
   Small floating pill shown after the visitor has made their choice.
   Bottom-left of the screen, unobtrusive.
   ============================================================================= */

.wmes-cookie-prefs {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 99998;
}

.wmes-cookie-prefs__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #ffffff;
    color: var(--wp--preset--color--secondary, #0D4C6E);
    border: 1px solid var(--wp--preset--color--border-grey, #d5d5d5);
    border-radius: 50px;
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    font-family: inherit;
    line-height: 1.4;
}

.wmes-cookie-prefs__btn:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    transform: translateY(-1px);
}

.wmes-cookie-prefs__btn:focus-visible {
    outline: 3px solid var(--wp--preset--color--primary, #00A896);
    outline-offset: 2px;
}

/* Small coloured dot icon */
.wmes-cookie-prefs__icon {
    font-size: 0.6rem;
    color: var(--wp--preset--color--primary, #00A896);
    line-height: 1;
}


/* =============================================================================
   RESPONSIVE
   On small screens the banner stacks vertically and buttons go full-width.
   ============================================================================= */

@media ( max-width: 600px ) {

    .wmes-cookie-banner {
        padding: 1rem;
    }

    .wmes-cookie-banner__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .wmes-cookie-banner__actions {
        flex-direction: column;
        gap: 0.6rem;
    }

    .wmes-cookie-btn {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
    }

    .wmes-cookie-prefs {
        bottom: 0.75rem;
        left: 0.75rem;
    }
}
