/* ============================================================================
   Fixit Cookie Notice v1.4.0 - Modern Design with GDPR Compliance
   ============================================================================ */

/* Reset & Base */
#m-cookienotice {
    all: initial;
    display: none;
    position: fixed;
    /* Consent comes before anything else on the page: chat widgets sit at 999999 (Talos) and up,
       and on phones they covered «Accept all» (fixit.gr, 2026-10-07). */
    z-index: 2147483000;
    /* The site's own typeface; `all: initial` above would otherwise drop it for the browser
       default, and a system font made the notice read as a foreign box on the page. */
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

#m-cookienotice * {
    box-sizing: border-box;
}

/* Center Popup (Default) */
/* Centred with inset + margin:auto instead of a transform: a transformed parent becomes the
   containing block of position:fixed children, and the backdrop below would only cover the card. */
#m-cookienotice.v-popup.v-center {
    inset: 0;
    margin: auto;
    height: fit-content;
    width: min(640px, calc(100% - 48px));
    max-width: none;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border: none;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
    padding: 0;
    animation: cn-fade-in 0.3s ease-out;
}

#m-cookienotice.v-popup.v-center::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: -1;
    animation: cn-backdrop-in 0.3s ease-out;
}

@keyframes cn-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes cn-backdrop-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    #m-cookienotice.v-popup.v-center {
        animation: none;
    }
    #m-cookienotice.v-popup.v-center::before {
        animation: none;
    }
}

/* Other Popup Positions */
#m-cookienotice.v-popup.v-top-left {
    top: 16px;
    left: 16px;
    max-width: 420px;
}

#m-cookienotice.v-popup.v-top-right {
    top: 16px;
    right: 16px;
    max-width: 420px;
}

#m-cookienotice.v-popup.v-bottom-left {
    bottom: 16px;
    left: 16px;
    max-width: 420px;
}

#m-cookienotice.v-popup.v-bottom-right {
    bottom: 16px;
    right: 16px;
    max-width: 420px;
}

/* Bar Positions */
#m-cookienotice.v-bar {
    left: 0;
    right: 0;
    width: 100%;
    padding: 16px;
    background: white;
    border: none;
}

#m-cookienotice.v-bar.v-top {
    top: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#m-cookienotice.v-bar.v-bottom {
    bottom: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

/* Inner Container */
#m-cookienotice .inner {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 36px 40px 32px;
    width: 100%;
}

/* Title */
.m-message.title {
    width: 100%;
    margin: 0;
    padding: 0;
}

.titlecookie {
    display: block;
    font-size: 20px;
    font-weight: 700;
    line-height: 28px;
    color: #1f2937;
    margin: 0;
}

/* Message Text */
#message-custom-css {
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.65;
    color: #6b7280;
}

/* Settings Header */
.cookie-settings-header {
    display: none;
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

#m-cookienotice.settings-open .cookie-settings-header {
    display: block;
}

/* Settings Container */
#settings-inner-container {
    display: none;
    width: 100%;
    margin: 0;
    padding: 0;
    flex-direction: column;
    gap: 8px;
}

#m-cookienotice.settings-open #settings-inner-container {
    display: flex;
}

/* Cookie Settings Board */
.cookie-settings-board {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.cookie-settings-board::-webkit-scrollbar {
    width: 6px;
}

.cookie-settings-board::-webkit-scrollbar-track {
    background: transparent;
}

.cookie-settings-board::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.cookie-settings-board::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Cookie Menu Item */
.cookie-menu-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    gap: 8px;
}

.cookie-menu-item .toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: background-color 0.2s, border-color 0.2s;
    width: 100%;
    margin: 0;
}

.cookie-menu-item.active .toggle {
    background: #eff6ff;
    border-color: #3b82f6;
}

.cookie-menu-item:hover:not(.active) .toggle {
    background: #f9fafb;
}

.cookie-menu-item .toggle > span:first-of-type {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.cookie-menu-item .toggle > img {
    display: none;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.cookie-menu-item .toggle > img.close {
    display: none;
}

.cookie-menu-item.active .toggle > img.close {
    display: block;
}

.cookie-menu-item .toggle > img.open {
    display: block;
}

.cookie-menu-item.active .toggle > img.open {
    display: none;
}

/* Always On Badge */
.cookie-settings-option-always-on {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #d1fae5;
    color: #059669;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    margin: 0;
    margin-left: auto;
}

/* Toggle Switch */
.cookie-settings-option-select {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.cookie-settings-option-checkbox {
    display: none;
}

.cookie-settings-option-checkbox-box {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 28px;
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
}

.cookie-settings-option-checkbox-box::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 12px;
    left: 2px;
    transition: left 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cookie-settings-option-checkbox:checked + .cookie-settings-option-checkbox-box {
    background: #10b981;
    border-color: #059669;
}

.cookie-settings-option-checkbox:checked + .cookie-settings-option-checkbox-box::after {
    left: 22px;
}

.cookie-settings-option-checkbox:focus + .cookie-settings-option-checkbox-box {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.cookie-settings-option-checkbox-box .text {
    display: none;
}

/* Content (Description) */
.cookie-menu-item .content {
    display: none;
    padding: 0 16px 12px;
    font-size: 13px;
    line-height: 20px;
    color: #6b7280;
    margin: 0;
}

.cookie-menu-item.active .content {
    display: block;
}

/* Buttons */
#action-custom-css,
#action-settings-css {
    display: flex;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0;
    justify-content: center;
    flex-wrap: wrap;
}

.m-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 24px;
    border: none;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
    text-align: center;
    margin: 0;
}

.m-button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Accept Button (Primary) */
.m-button.m-accept,
.m-button.m-save-choices {
    background: #1f2937;
    color: white;
    border: 1px solid #1f2937;
    min-width: 120px;
}

.m-button.m-accept:hover,
.m-button.m-save-choices:hover {
    background: #374151;
    border-color: #374151;
    box-shadow: 0 4px 8px rgba(31, 41, 55, 0.15);
}

.m-button.m-accept:active,
.m-button.m-save-choices:active {
    background: #111827;
    border-color: #111827;
}

/* Decline Button (Outlined) */
.m-button.m-decline {
    background: white;
    color: #1f2937;
    border: 1px solid #d1d5db;
    min-width: 120px;
}

.m-button.m-decline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.m-button.m-decline:active {
    background: #f3f4f6;
}

/* Settings/Back Button (Text) */
.m-button.m-settings {
    background: transparent;
    color: #3b82f6;
    border: 1px solid transparent;
    padding: 0 16px;
    min-width: auto;
}

.m-button.m-settings:hover {
    background: #eff6ff;
}

.m-button.m-settings:active {
    background: #dbeafe;
}

/* Terms Link */
.m-button.m-terms {
    background: transparent;
    color: #3b82f6;
    border: none;
    padding: 0 8px;
    height: auto;
    font-size: 13px;
}

.m-button.m-terms:hover {
    text-decoration: underline;
}

/* Floating Reopen Button */
/* Reopen button: a light chip with a shield-and-check mark in the accept colour (set by JS from
   the settings), not a dark disc with a cookie — that read as another vendor's widget. */
#cookienotice-reopen-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #ffffff;
    color: #4257e0;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(20, 24, 38, 0.08), 0 10px 26px -10px rgba(20, 24, 38, 0.35), 0 6px 22px -8px rgba(91, 108, 255, 0.35);
    z-index: 9998;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
    margin: 0;
    line-height: 1;
}

#cookienotice-reopen-button svg {
    width: 22px;
    height: 22px;
}

#cookienotice-reopen-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(20, 24, 38, 0.10), 0 14px 30px -10px rgba(20, 24, 38, 0.40), 0 8px 26px -8px rgba(91, 108, 255, 0.45);
}

#cookienotice-reopen-button:active {
    transform: none;
}

#cookienotice-reopen-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

@media (max-width: 768px) {
    #m-cookienotice .inner {
        padding: 32px 24px;
        gap: 18px;
    }

    .titlecookie {
        font-size: 18px;
        line-height: 24px;
    }

    #message-custom-css {
        font-size: 13px;
    }

    #action-custom-css,
    #action-settings-css {
        gap: 10px;
    }

    .m-button {
        flex: 1;
        min-width: 100px;
    }

    .cookie-settings-board {
        max-height: 250px;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    /* A real bottom sheet: edge to edge and on the bottom. The centred card's `inset: 0`,
       `margin: auto` and width kept it floating with side margins. */
    #m-cookienotice.v-popup.v-center {
        inset: auto 0 0 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        height: auto;
        transform: none;
        border-radius: 20px 20px 0 0;
        animation: cn-slide-up 0.3s ease-out;
    }

    #m-cookienotice.v-popup.v-center::before {
        animation: cn-backdrop-in 0.3s ease-out;
    }

    @keyframes cn-slide-up {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    #m-cookienotice .inner {
        padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
        gap: 16px;
    }

    .titlecookie {
        font-size: 18px;
        line-height: 26px;
    }

    #message-custom-css {
        font-size: 14px;
        line-height: 1.6;
    }

    #action-custom-css,
    #action-settings-css {
        flex-direction: column;
        gap: 8px;
    }

    /* `flex: 1` from the 768 px block turns into flex-basis 0 once the actions stack in a column,
       which ignored the height and squeezed the buttons to 22 px on phones. 44 px = touch target. */
    .m-button {
        flex: 0 0 auto;
        width: 100%;
        height: 44px;
    }

    #cookienotice-reopen-button {
        bottom: 16px;
        left: 16px;
        width: 44px;
        height: 44px;
    }

    .cookie-settings-board {
        max-height: calc(100vh - 400px);
    }

    .cookie-menu-item .toggle {
        padding: 10px 12px;
    }

    .cookie-menu-item .content {
        padding: 0 12px 10px;
    }

    .m-button.m-settings {
        padding: 0 12px;
    }
}

/* Safe Area Support (iPhone X) */
@supports (padding: max(0px)) {
    #m-cookienotice.v-popup.v-center {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }

    #cookienotice-reopen-button {
        bottom: max(24px, calc(24px + env(safe-area-inset-bottom)));
        left: max(24px, calc(24px + env(safe-area-inset-left)));
    }

    @media (max-width: 480px) {
        #cookienotice-reopen-button {
            bottom: max(16px, calc(16px + env(safe-area-inset-bottom)));
            left: max(16px, calc(16px + env(safe-area-inset-left)));
        }
    }
}


