/**
 * asn-sem.css — ASN Shop Entry Message
 *
 * Enthält Styles für:
 *  - Overlay und Popup-Modal
 *  - Wichtig-Box
 *  - Buttons
 *  - UM-Login-Bereich
 *  - Hilfe-Icon (.asn-sem-help) mit Tooltip (.asn-sem-help__tip)
 *
 * CSS-Variablen des Themes (Gutenify Architec Pro):
 *   --wp--preset--color--primary        (Primärfarbe)
 *   --wp--preset--color--primary-dark   (Dunklere Primärfarbe für Hover)
 *
 * @package asn-shop-entry-message
 * @version 1.1.0
 */

/* ════════════════════════════════════════════════════════════════════════════
   OVERLAY
════════════════════════════════════════════════════════════════════════════ */

#asn-sem-overlay {
    display: none;              /* Wird per JS-Klasse .asn-sem-visible auf flex gesetzt */
    position: fixed;
    inset: 0;                   /* top/right/bottom/left: 0 */
    z-index: 99999;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

#asn-sem-overlay.asn-sem-visible {
    display: flex;
}

/* Scroll-Sperre am Body, solange Popup offen */
body.asn-sem-open {
    overflow: hidden;
}

/* ════════════════════════════════════════════════════════════════════════════
   POPUP-FENSTER
════════════════════════════════════════════════════════════════════════════ */

#asn-sem-popup {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 28px 24px;
    box-sizing: border-box;
}

/* Schließen-Button (×) */
#asn-sem-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

#asn-sem-close:hover,
#asn-sem-close:focus-visible {
    color: #222;
    background: #f0f0f0;
    outline: none;
}

/* ── Überschrift ─────────────────────────────────────────────────────────── */

#asn-sem-headline {
    margin: 0 0 12px;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

/* ── Empfehlungs-Liste ───────────────────────────────────────────────────── */

#asn-sem-content ol {
    margin: 8px 0 16px 20px;
    padding: 0;
    line-height: 1.6;
}

#asn-sem-content ol li {
    margin-bottom: 6px;
    /* flex für Icon-Ausrichtung neben dem Text */
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* ── Wichtig-Box ─────────────────────────────────────────────────────────── */

.asn-sem-important {
    background: #fffbe6;
    border-left: 4px solid var(--wp--preset--color--primary, #f0a500);
    border-radius: 0 4px 4px 0;
    padding: 12px 14px;
    margin-top: 16px;
    font-size: 0.95rem;
}

.asn-sem-important strong {
    display: block;
    margin-bottom: 6px;
}

.asn-sem-important ol {
    margin: 0 0 0 18px;
    padding: 0;
}

.asn-sem-important a {
    color: var(--wp--preset--color--primary, #f0a500);
    font-weight: 600;
    text-decoration: underline;
}

/* ════════════════════════════════════════════════════════════════════════════
   HILFE-ICON UND TOOLTIP
════════════════════════════════════════════════════════════════════════════ */

/*
 * Wrapper .asn-sem-help:
 * - position:relative als Ankerpunkt für den absolut positionierten Tooltip
 * - inline-flex damit Icon und Text auf einer Zeile bleiben
 */
.asn-sem-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    /* Verhindert, dass der Tooltip-Wrapper in den Listentext umbricht */
    flex-shrink: 0;
}

/* ── Icon-Button ─────────────────────────────────────────────────────────── */

.asn-sem-help__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 2px;
    margin: 0;
    cursor: pointer;
    color: var(--wp--preset--color--primary, #f0a500);
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
    /* Mindest-Tappfläche für Mobilgeräte (WCAG 2.5.5) */
    min-width: 32px;
    min-height: 32px;
}

.asn-sem-help__btn:hover,
.asn-sem-help__btn:focus-visible {
    color: var(--wp--preset--color--primary-dark, #c47f00);
    background: rgba(0, 0, 0, 0.06);
    outline: none;
}

/* ── Tooltip-Bubble ──────────────────────────────────────────────────────── */

.asn-sem-help__tip {
    /* Standardmäßig unsichtbar */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    /* Positionierung: unterhalb des Icons, linksbündig mit Popup */
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);

    /* Auf kleinen Bildschirmen: Breite begrenzen und Links ausrichten */
    width: max(220px, 70vw);
    max-width: 320px;

    background: #333;
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 10;

    /* Einblend-Animation */
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

/* Kleines Dreieck oben am Tooltip */
.asn-sem-help__tip::before {
    content: '';
    position: absolute;
    bottom: 100%;        /* Über der Bubble */
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #333;
}

/*
 * Tooltip einblenden:
 *  a) Desktop: über CSS :hover auf dem Wrapper (kein JS nötig)
 *  b) Mobile:  über JS-Klasse .is-open auf dem Wrapper
 */
.asn-sem-help:hover .asn-sem-help__tip,
.asn-sem-help.is-open .asn-sem-help__tip {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* ════════════════════════════════════════════════════════════════════════════
   AKTIONS-BUTTONS
════════════════════════════════════════════════════════════════════════════ */

#asn-sem-actions {
    margin-top: 20px;
    text-align: center;
}

.asn-sem-btn {
    display: inline-block;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.asn-sem-btn--primary {
    background: var(--wp--preset--color--primary, #f0a500);
    border-color: var(--wp--preset--color--primary, #f0a500);
    color: #fff;
}

.asn-sem-btn--primary:hover,
.asn-sem-btn--primary:focus-visible {
    background: var(--wp--preset--color--primary-dark, #c47f00);
    border-color: var(--wp--preset--color--primary-dark, #c47f00);
    color: #fff;
    outline: none;
}

/* ════════════════════════════════════════════════════════════════════════════
   LOGIN-BEREICH
════════════════════════════════════════════════════════════════════════════ */

#asn-sem-login-section {
    margin-top: 16px;
    border-top: 1px solid #e5e5e5;
    padding-top: 14px;
    font-size: 0.95rem;
}

.asn-sem-login-hint {
    margin: 0 0 8px;
    color: #555;
}

.asn-sem-login-hint a {
    color: var(--wp--preset--color--primary, #f0a500);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

#asn-sem-login-form {
    padding-top: 8px;
}

/* UM rendert doppeltes „Passwort vergessen?" — wird per JS ausgeblendet */
#asn-sem-login-form p.lost_password {
    display: none !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════════════════════ */

@media ( max-width: 480px ) {

    #asn-sem-popup {
        padding: 24px 16px 20px;
    }

    #asn-sem-headline {
        font-size: 1.1rem;
        padding-right: 28px; /* Platz für ×-Button */
    }

    /* Tooltip auf Mobilgeräten linksbündig an Popup-Kante ausrichten */
    .asn-sem-help__tip {
        left: 0;
        transform: none;
        max-width: calc(100vw - 48px);
    }

    .asn-sem-help__tip::before {
        left: 20px;
        transform: none;
    }
}
