﻿/* ==========================================================================
   TMH PRIVACY FRAMEWORK - COMPLETE STYLESHEET
   ========================================================================== */

/* --- 1. Base Banner Containers --- */
#tmhPrivacyBanner.tmh-privacy-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    color: #111827;
    transform: translateY(110%);
    opacity: 0;
    transition:
        transform .45s cubic-bezier(.22,.61,.36,1),
        opacity .35s ease;
}

#tmhPrivacyBanner.tmh-privacy-banner.tmh-visible {
    transform: translateY(0);
    opacity: 1;
}

.tmh-privacy-banner__card {
    width: min(1200px, calc(100vw - 40px));
    margin: 0 auto 20px;
    padding: 24px 28px;
    background: #f8f9fb;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgb(0 0 0 / 22%);
}

/* --- 2. Banner Typography --- */
.tmh-privacy-banner__text strong {
    display: block;
    margin-bottom: .65rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.tmh-privacy-banner__text p {
    margin: 0 0 .75rem;
    line-height: 1.55;
    font-size: 1rem;
    opacity: .8;
}

.tmh-privacy-banner__link {
    display: inline-block;
    font-weight: 700;
    color: #111827;
    text-decoration: underline;
}

/* --- 3. Banner Buttons & Layout Actions --- */
.tmh-privacy-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.25rem;
    align-items: center;
    justify-content: flex-end;
}

.tmh-privacy-banner button {
    cursor: pointer;
    border: 0;
    border-radius: 999px;
    padding: .78rem 1.2rem;
    font-weight: 600;
    font-size: .92rem;
    transition: background 0.2s ease-in-out, color 0.2s ease-in-out;
}

.tmh-privacy-banner__btn {
    font-family: inherit;
    line-height: 1.2;
}

#tmhPrivacyAccept {
    background: #111827;
    color: #ffea00;
}

#tmhPrivacyReject,
#tmhPrivacyCustomize {
    background: #e5e7eb;
    color: #111827;
}

#tmhPrivacyCustomize:hover,
#tmhPrivacyCustomize:focus,
#tmhPrivacyReject:hover {
    background-color: #d1d5db;
    color: #111827;
}

#tmhPrivacyAccept:hover {
    background-color: #1f2937;
}


/* --- 4. Preferences Modal Structure Overlay --- */
#tmhPrivacyModal {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.tmh-privacy-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.tmh-privacy-modal__container {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 550px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.tmh-privacy-modal__header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tmh-privacy-modal__header h2 { 
    margin: 0; 
    font-size: 1.25rem; 
    color: #333; 
}

.tmh-privacy-modal__close {
    background: none; 
    border: none; 
    font-size: 1.75rem; 
    cursor: pointer; 
    color: #888;
}

.tmh-privacy-modal__body {
    padding: 20px;
    overflow-y: auto;
}

.tmh-privacy-modal__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.tmh-privacy-modal__row:last-child { 
    border-bottom: none; 
}

.tmh-privacy-modal__info { 
    padding-right: 20px; 
}

.tmh-privacy-modal__info strong { 
    display: block; 
    color: #222; 
    font-size: 0.95rem; 
}

.tmh-privacy-modal__info p { 
    margin: 4px 0 0 0; 
    font-size: 0.85rem; 
    color: #666; 
    line-height: 1.3; 
}


/* --- 5. Custom Checkbox Form Toggles --- */
.tmh-privacy-modal__toggle-wrapper { 
    position: relative; 
}

.tmh-privacy-modal__checkbox { 
    display: none; 
}

.tmh-privacy-modal__toggle-label {
    display: block; 
    width: 44px; 
    height: 24px; 
    background: #ccc; 
    border-radius: 12px; 
    position: relative; 
    cursor: pointer; 
    transition: background 0.25s;
}

.tmh-privacy-modal__toggle-label::after {
    content: ''; 
    position: absolute; 
    top: 2px; 
    left: 2px; 
    width: 20px; 
    height: 20px;
    background: #fff; 
    border-radius: 50%; 
    transition: left 0.25s;
}

.tmh-privacy-modal__checkbox:checked + .tmh-privacy-modal__toggle-label { 
    background: #1c75bc; 
}

.tmh-privacy-modal__checkbox:checked + .tmh-privacy-modal__toggle-label::after { 
    left: 22px; 
}

.tmh-privacy-modal__checkbox:disabled + .tmh-privacy-modal__toggle-label { 
    background: #b0ccdb; 
    cursor: not-allowed; 
}

.tmh-privacy-modal__required {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1c75bc;
    background: #eaf2f8;
    padding: 4px 10px;
    border-radius: 4px;
}


/* --- 6. Preferences Modal Footer & Button Styling Fixes --- */
.tmh-privacy-modal__footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Framework layout for both buttons inside the modal footer structure */
.tmh-privacy-modal__footer button {
    cursor: pointer;
    border: 0;
    border-radius: 999px;
    padding: .78rem 1.6rem;
    font-weight: 600;
    font-size: .92rem;
    font-family: inherit;
    transition: background 0.2s ease, transform 0.1s ease;
}

/* Save Choices Button Variant (Secondary look) */
#tmhPrivacySaveCustom {
    background: #e5e7eb;
    color: #111827;
}

#tmhPrivacySaveCustom:hover {
    background: #d1d5db;
}

/* Accept All Button Variant inside the Modal Popup box (Primary look) */
#tmhPrivacyAcceptModal {
    background: #111827;
    color: #ffea00;
}

#tmhPrivacyAcceptModal:hover {
    background: #1f2937;
}

.tmh-privacy-modal__footer button:active {
    transform: scale(0.98);
}


/* --- 7. Responsive Media Breakpoints --- */

/* Desktop/Tablet Responsive Grid Layout Grid Split */
@media (min-width: 900px) {
    .tmh-privacy-banner__card {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 2rem;
        align-items: center;
    }

    .tmh-privacy-banner__actions {
        justify-content: flex-end;
        margin-top: 0;
        white-space: nowrap;
    }
}

/* Phone/Mobile Layout Modifiers for Actions Row Banner */
@media (max-width: 640px) {
    .tmh-privacy-banner__card {
        width: calc(100vw - 24px);
        margin-bottom: 12px;
        padding: 20px;
    }

    .tmh-privacy-banner__actions {
        display: grid;
    }

    .tmh-privacy-banner button {
        width: 100%;
    }
}

/* Tiny Mobile Breakdown for Preferences Popups Modal Controls */
@media (max-width: 480px) {
    .tmh-privacy-modal__footer {
        display: grid;
        grid-template-columns: 1fr;
    }
    .tmh-privacy-modal__footer button {
        width: 100%;
    }
}


/* Append AFTER the existing privacy CSS. Required with privacy.js 2.1.1. */
.tmh-privacy-banner[hidden] { display: none !important; }

.tmh-privacy-sr-only,
.tmh-privacy-modal .tmh-privacy-modal__checkbox {
    display: block !important;
    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;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    visibility: visible !important;
}

.tmh-privacy-modal__toggle-wrapper { position: relative; }
.tmh-privacy-modal__toggle-label { min-width: 44px; min-height: 24px; background: #767676; }
.tmh-privacy-modal__checkbox:focus-visible + .tmh-privacy-modal__toggle-label,
.tmh-privacy-modal button:focus-visible,
.tmh-privacy-banner a:focus-visible,
.tmh-privacy-banner button:focus-visible {
    outline: 3px solid #000 !important;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #fff !important;
}

.tmh-privacy-modal__container {
    box-sizing: border-box;
    max-width: min(550px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    min-width: 0;
    overflow: auto;
}
.tmh-privacy-modal__info { min-width: 0; overflow-wrap: anywhere; }
.tmh-privacy-modal__footer { flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
    .tmh-privacy-banner, .tmh-privacy-modal,
    .tmh-privacy-modal *, .tmh-privacy-modal *::before,
    .tmh-privacy-modal *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (forced-colors: active) {
    .tmh-privacy-modal .tmh-privacy-modal__checkbox {
        position: static !important;
        width: 24px !important;
        height: 24px !important;
        margin: 0 !important;
        clip: auto !important;
        clip-path: none !important;
        appearance: auto !important;
        opacity: 1 !important;
    }
    .tmh-privacy-modal__toggle-label { display: none !important; }
    .tmh-privacy-modal__checkbox:focus-visible {
        outline: 2px solid Highlight !important;
        outline-offset: 3px;
    }
}
