/* ============================================================
   WP GeoMap Pro – Frontend Styles
   ============================================================ */

/* Wrapper */
.wggp-wrap {
    position: relative;
    font-family: var(--wggp-font, inherit);
    line-height: 1.5;
}

.wggp-map-canvas {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
}

/* ── Legend ────────────────────────────────────────────────── */
.wggp-legend {
    position: absolute;
    z-index: 10;
    pointer-events: none;
}

.wggp-legend--bottom-left  { bottom: 28px; left: 16px; }
.wggp-legend--bottom-right { bottom: 28px; right: 16px; }
.wggp-legend--top-left     { top: 16px;    left: 16px; }
.wggp-legend--top-right    { top: 16px;    right: 16px; }

.wggp-legend__inner {
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,.14);
    pointer-events: all;
    min-width: 140px;
    border: 1px solid rgba(0,0,0,.06);
}

.wggp-legend__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
    margin-bottom: 10px;
}

.wggp-legend__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    cursor: pointer;
    transition: opacity .2s;
}

.wggp-legend__item:hover { opacity: .75; }

.wggp-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.wggp-legend__label {
    font-size: 13px;
    color: #1f2937;
    font-weight: 500;
}

/* ── Info Card Overlay ─────────────────────────────────────── */
.wggp-card-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.wggp-card-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.wggp-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0,0,0,.22), 0 4px 16px rgba(0,0,0,.1);
    max-width: 440px;
    width: 100%;
    overflow: hidden;
    position: relative;
    transform: translateY(20px) scale(.97);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.wggp-card-overlay.is-open .wggp-card {
    transform: translateY(0) scale(1);
}

/* Close Button */
.wggp-card__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    transition: background .15s, transform .2s;
    overflow: hidden;
}

.wggp-card__close:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

/* Pure-CSS ✕ – kein SVG, kein Font-Rendering-Problem */
.wggp-card__close::before,
.wggp-card__close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    background: #374151;
    border-radius: 2px;
}

.wggp-card__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.wggp-card__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Card Image */
.wggp-card__image-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.wggp-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Card Body */
.wggp-card__body {
    padding: 24px 26px 26px;
    overflow-y: auto;
}

.wggp-card__category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--wggp-accent, #2563eb);
    background: color-mix(in srgb, var(--wggp-accent, #2563eb) 10%, transparent);
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.wggp-card__title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.wggp-card__address {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 14px;
    font-weight: 500;
}

.wggp-card__address::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z'/%3E%3Ccircle cx='12' cy='9' r='2.5'/%3E%3C/svg%3E") center/contain no-repeat;
    flex-shrink: 0;
}

.wggp-card__desc {
    font-size: 15px;
    color: #374151;
    line-height: 1.65;
    margin: 0 0 20px;
}

.wggp-card__footer {
    padding-top: 4px;
}

.wggp-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wggp-accent, #2563eb);
    color: #fff !important;
    text-decoration: none !important;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .01em;
    transition: opacity .2s, transform .15s;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--wggp-accent, #2563eb) 40%, transparent);
}

.wggp-card__btn:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.wggp-card__btn::after {
    content: '→';
    font-size: 16px;
}

/* ── Custom Marker Styles ──────────────────────────────────── */
.wggp-marker-wrap {
    position: relative;
    cursor: pointer;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,.25));
    transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}

.wggp-marker-wrap:hover {
    transform: scale(1.15) translateY(-3px);
    filter: drop-shadow(0 6px 14px rgba(0,0,0,.3));
}

.wggp-marker-wrap.active {
    transform: scale(1.2) translateY(-4px);
    z-index: 9999 !important;
}

/* ── Error ─────────────────────────────────────────────────── */
.wggp-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
    .wggp-card {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(100%);
    }

    .wggp-card-overlay.is-open .wggp-card {
        transform: translateY(0);
    }

    .wggp-card__image-wrap {
        height: 160px;
    }
}
