/**
 * Cookie Consent Banner Styles
 *
 * Position: Unten links als schwebende Karte
 * Design: Passend zum meinholz24 Theme
 *
 * @package Meinholz24
 */

/* ==========================================================================
   BANNER CONTAINER
   ========================================================================== */

.mh24-cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 100%;
    max-width: 380px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #E7E5E4;
    padding: 24px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
}

.mh24-cookie-banner:not(.hidden) {
    animation: mh24SlideUp 0.4s ease-out forwards;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes mh24SlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mh24SlideDown {
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes mh24Pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.cookie-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.cookie-header-settings {
    align-items: center;
    margin-bottom: 24px;
}

.cookie-header-settings h3 {
    margin: 0;
    flex: 1;
}

.cookie-icon {
    flex-shrink: 0;
    animation: mh24Pulse 2s ease-in-out;
}

.cookie-title-wrap h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1C1917;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.cookie-title-wrap p {
    font-size: 14px;
    color: #57534E;
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.cookie-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-primary {
    flex: 1;
    padding: 12px 20px;
    background: #A02B2B;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background: #8A2424;
}

.btn-primary:focus {
    outline: 2px solid #A02B2B;
    outline-offset: 2px;
}

.btn-secondary {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    color: #1C1917;
    border: 1px solid #D6D3D1;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.btn-secondary:hover {
    border-color: #A8A29E;
    background: #FAFAF9;
}

.btn-secondary:focus {
    outline: 2px solid #A02B2B;
    outline-offset: 2px;
}

.btn-link {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 12px 8px;
    background: none;
    border: none;
    color: #57534E;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.btn-link:hover {
    color: #1C1917;
}

.btn-link:focus {
    outline: 2px solid #A02B2B;
    outline-offset: 2px;
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid #E7E5E4;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.btn-back:hover {
    background: #FAFAF9;
    border-color: #D6D3D1;
}

.btn-back:focus {
    outline: 2px solid #A02B2B;
    outline-offset: 2px;
}

/* ==========================================================================
   COOKIE OPTIONS
   ========================================================================== */

.cookie-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.cookie-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #E7E5E4;
}

.cookie-option:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 16px;
}

.option-title {
    font-size: 14px;
    font-weight: 500;
    color: #1C1917;
}

.option-desc {
    font-size: 12px;
    color: #78716C;
    line-height: 1.4;
}

/* ==========================================================================
   TOGGLE SWITCH
   ========================================================================== */

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #D6D3D1;
    border-radius: 24px;
    transition: background-color 0.3s ease;
}

.toggle-switch label::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #FFFFFF;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + label {
    background-color: #A02B2B;
}

.toggle-switch input:checked + label::before {
    transform: translateX(20px);
}

.toggle-switch input:focus + label {
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #A02B2B;
}

.toggle-switch.disabled {
    opacity: 0.7;
}

.toggle-switch.disabled label {
    cursor: not-allowed;
}

/* ==========================================================================
   HIDDEN STATE
   ========================================================================== */

.mh24-cookie-banner.hidden {
    display: none !important;
}

/* ==========================================================================
   COOKIE TRIGGER BUTTON
   ========================================================================== */

.cookie-trigger {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    background: #FFFFFF;
    border: 1px solid #E7E5E4;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cookie-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.cookie-trigger:focus {
    outline: 2px solid #A02B2B;
    outline-offset: 2px;
}

/* ==========================================================================
   MOBILE RESPONSIVE
   ========================================================================== */

@media (max-width: 640px) {
    .mh24-cookie-banner {
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        max-height: 45vh;
        overflow-y: auto;
        border-radius: 12px 12px 0 0;
        padding: 16px;
    }

    .cookie-icon {
        display: none;
    }

    .cookie-header {
        gap: 0;
        margin-bottom: 12px;
    }

    .cookie-title-wrap h3 {
        font-size: 16px;
        margin-bottom: 2px;
    }

    .cookie-title-wrap p {
        font-size: 13px;
        line-height: 1.4;
    }

    .cookie-actions {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 8px;
    }

    .cookie-actions .btn-primary,
    .cookie-actions .btn-secondary {
        padding: 10px 12px;
        font-size: 13px;
    }

    .btn-link {
        min-height: 36px;
        padding: 8px;
        font-size: 12px;
    }

    .cookie-header-settings {
        margin-bottom: 16px;
    }

    .cookie-options {
        gap: 12px;
        margin-bottom: 16px;
    }

    .cookie-option {
        padding-bottom: 12px;
    }

    .cookie-trigger {
        bottom: 16px;
        left: 16px;
        width: 44px;
        height: 44px;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .mh24-cookie-banner,
    .cookie-icon {
        animation: none !important;
        opacity: 1;
        transform: none;
    }

    .toggle-switch label,
    .toggle-switch label::before,
    .btn-primary,
    .btn-secondary,
    .btn-link,
    .btn-back,
    .cookie-trigger {
        transition: none !important;
    }
}
