/********** Pizzomunno – Overlays: Formular-Meldungen, Cookie-/Maps-Einwilligung, News-Popup **********/
/* Die Klassen werden teils von js/main.js erzeugt (nw-*, google-maps-*) – Namen nicht ändern. */

/* =========================================================
   Info Messages
   ========================================================= */

.info-message {
    margin-bottom: 0.75em;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
}

.info-message-success {
    color: #146c43;
    background-color: rgba(20, 108, 67, 0.12);
    border: 1px solid rgba(20, 108, 67, 0.35);
}

.info-message-error {
    color: #991b1b;
    background-color: rgba(185, 28, 28, 0.12);
    border: 1px solid rgba(185, 28, 28, 0.35);
}

.info-message-warning {
    color: #92400e;
    background-color: rgba(244, 165, 28, 0.16);
    border: 1px solid rgba(244, 165, 28, 0.38);
}

.info-message-hidden {
    display: none;
}

/* =========================================================
   Google Maps Cookie Consent - JS only
   ========================================================= */

body.nw-consent-open {
    overflow: hidden;
}

body.nw-consent-open > *:not(.nw-cookie-overlay):not(.nw-cookie-floating) {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

/* Floating Cookie Button */

.nw-cookie-floating {
    position: fixed;
    left: var(--floating-side) !important;
    bottom: calc(var(--floating-bottom) + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 999998;
    width: var(--floating-size);
    height: var(--floating-size);
    min-width: var(--floating-size);
    min-height: var(--floating-size);
    padding: 0;
    color: var(--white);
    background: var(--forest) !important;
    border: 1px solid var(--border-gold);
    border-radius: 50%;
    box-shadow: 0 16px 38px rgba(16, 24, 40, 0.22);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

.nw-cookie-floating:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 20px 46px rgba(244, 165, 28, 0.28);
}

.nw-cookie-floating svg {
    width: 29px;
    height: 29px;
    fill: currentColor;
}

.nw-cookie-floating::after {
    content: "";
    position: absolute;
    top: 7px;
    right: 7px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--accent);
}

.nw-cookie-floating.is-accepted::after {
    background: #2ecc71;
}

.nw-cookie-floating.is-declined::after {
    background: #e74c3c;
}

/* Consent Overlay */

.nw-cookie-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px 24px max(24px, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nw-cookie-overlay.show {
    display: flex;
}

.nw-cookie-box {
    width: min(720px, 100%);
    max-height: calc(100vh - 48px); /* Fallback für ältere Browser */
    max-height: calc(100dvh - 48px); /* dvh = tatsächlich sichtbare Höhe (iOS Safari: Adress- und Symbolleiste) */
    overflow: auto;
    color: var(--nw-consent-text);
    background: var(--nw-consent-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-md);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.34);
    animation: nwCookieFadeIn 0.25s ease;
}

@keyframes nwCookieFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.nw-cookie-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    color: var(--white);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 42%),
        linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.nw-cookie-header-icon {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
}

.nw-cookie-header-icon svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.nw-cookie-header h3 {
    margin: 0;
    color: var(--white);
    font-size: 24px;
    font-weight: 800;
}

.nw-cookie-body {
    padding: 26px 28px 28px;
}

.nw-cookie-body p {
    margin: 0;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.7;
}

.nw-cookie-small {
    display: block;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.nw-cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.nw-cookie-btn {
    padding: 13px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.25s ease;
}

.nw-cookie-btn-accept {
    color: var(--white);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.nw-cookie-btn-accept:hover {
    filter: brightness(0.94);
    transform: translateY(-2px);
}

.nw-cookie-btn-decline {
    color: var(--text-main);
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.22);
}

.nw-cookie-btn-decline:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

/* News-Popup (fliegt von oben ein) */

body.nw-news-open {
    overflow: hidden;
}

body.nw-news-open > *:not(.nw-news-overlay) {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

.nw-news-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 24px max(24px, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nw-news-box {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 48px); /* Fallback für ältere Browser */
    max-height: calc(100dvh - 48px); /* dvh = tatsächlich sichtbare Höhe (iOS Safari: Adress- und Symbolleiste) */
    overflow: auto;
    color: var(--nw-consent-text);
    background: var(--nw-consent-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-md);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.34);
    opacity: 0;
    transform: translateY(-140%);
    transition:
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.35s ease;
}

.nw-news-close-x {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #555;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 999px;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: 0.2s ease;
}

.nw-news-close-x:hover {
    color: #222;
    background: var(--white);
    transform: scale(1.06);
}

.nw-news-overlay.show .nw-news-box {
    opacity: 1;
    transform: translateY(0);
}

.nw-news-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 52px 24px 28px;
    color: var(--forest);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.32), transparent 42%),
        linear-gradient(135deg, #f2bd4f, #e0932a);
}

.nw-news-header-icon {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 58, 44, 0.12);
    border-radius: var(--radius-md);
    font-size: 24px;
}

.nw-news-header h3 {
    margin: 0;
    color: var(--forest);
    font-size: 24px;
    font-weight: 800;
}

.nw-news-body {
    padding: 26px 28px 28px;
}

.nw-news-body p {
    margin: 0;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.7;
}

.nw-news-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.nw-news-btn {
    padding: 13px 30px;
    color: var(--forest);
    background: linear-gradient(135deg, #f2bd4f, #e0932a);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.25s ease;
}

.nw-news-btn:hover {
    filter: brightness(0.94);
    transform: translateY(-2px);
}

.nw-news-box {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

.nw-news-box::-webkit-scrollbar {
    width: 6px;
}

.nw-news-box::-webkit-scrollbar-track {
    background: transparent;
}

.nw-news-box::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.22);
    border: none;
    border-radius: 999px;
}

.nw-news-box::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.34);
}

/* Google Maps Block */

.google-maps-consent-wrapper {
    position: relative;
    width: 100%;
    min-height: 350px;
    overflow: hidden;
    background: rgba(20, 108, 67, 0.05);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.google-maps-consent-wrapper iframe {
    width: 100%;
    min-height: 350px;
    border: 0;
    display: none;
}

.google-maps-consent-wrapper.maps-accepted iframe {
    display: block;
}

.google-maps-placeholder {
    min-height: 350px;
    padding: 42px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text-main);
    text-align: center;
    background:
        radial-gradient(circle at top left, rgba(20, 108, 67, 0.12), transparent 42%),
        radial-gradient(circle at bottom right, rgba(244, 165, 28, 0.12), transparent 35%),
        var(--cream);
}

.google-maps-consent-wrapper.maps-accepted .google-maps-placeholder {
    display: none;
}

.google-maps-placeholder h3 {
    margin: 0;
    color: var(--dark);
    font-size: 24px;
    font-weight: 800;
}

.google-maps-placeholder p {
    max-width: 620px;
    margin: 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}

.google-maps-placeholder button {
    margin-top: 8px;
    padding: 12px 24px;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.25s ease;
}

.google-maps-placeholder button:hover {
    filter: brightness(0.94);
    transform: translateY(-2px);
}
