/* ═══════════════════════════════════════════════════════════════
   Map.css — JustNow Map Component
   Dark glassmorphism, cohérent avec Detail.css
   ═══════════════════════════════════════════════════════════════ */

:root {
    --map-accent: #ff6b35;
    --map-accent-hover: #ff8555;
    --map-surface: rgba(26, 27, 30, 0.94);
    --map-surface-light: rgba(255, 255, 255, 0.06);
    --map-text: #f0f0f0;
    --map-text-muted: #8a8a8a;
    --map-radius: 12px;
    --map-radius-sm: 8px;
    --map-border: rgba(255, 255, 255, 0.08);
}
/* ─── Info window surcharge ─── */
.gm-style-iw-chr {
    margin-bottom: 20px !important;
}

.gm-ui-hover-effect>span {
    background-color: light-dark(#ffffff, #fff);
}

.gm-style .gm-style-iw-c {
    background: rgba(0, 0, 0, 0.46) !important;
}

/* ─── Loading & Error ─── */

.map-loading,
.map-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #0a0a0a;
    color: var(--map-text-muted);
    gap: 1rem;
    font-size: 0.95rem;
}

.map-loading__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--map-surface-light);
    border-top-color: var(--map-accent);
    border-radius: 50%;
    animation: map-spin 0.8s linear infinite;
}

@keyframes map-spin {
    to { transform: rotate(360deg); }
}

/* ─── Map wrapper ─── */

.map-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ─── Google Maps InfoWindow override ─── */

.gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: var(--map-radius) !important;
    background: transparent !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5) !important;
    overflow: visible !important;
    max-width: 420px !important;
}

.gm-style .gm-style-iw-d {
    overflow: visible !important;
    max-height: none !important;
}

.gm-style .gm-style-iw-tc {
    display: none !important;
}

.gm-style-iw button[aria-label="Close"] {
    top: 8px !important;
    right: 8px !important;
    width: 28px !important;
    height: 28px !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border-radius: 50% !important;
    opacity: 1 !important;
    display: grid !important;
    place-items: center !important;
    transition: background 0.2s !important;
}

.gm-style-iw button[aria-label="Close"]:hover {
    background: rgba(0, 0, 0, 0.85) !important;
}

.gm-style-iw button[aria-label="Close"] span {
    margin: 0 !important;
    filter: brightness(10) !important;
}

/* ═══════════════════════════════════════════════════════════════
   InfoWindow Card (MapInfoCard)
   ═══════════════════════════════════════════════════════════════ */

.iw-card {
    width: 380px;
    max-width: 90vw;
    background: var(--map-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--map-radius);
    border: 1px solid var(--map-border);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ─── Hero / Image ─── */

.iw-card__hero {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.iw-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.iw-card:hover .iw-card__img {
    transform: scale(1.04);
}

.iw-card__hero-gradient {
    position: absolute;
    inset: 0;
    /*background: linear-gradient(*/
    /*        to bottom,*/
    /*        transparent 30%,*/
    /*        rgba(26, 27, 30, 0.5) 70%,*/
    /*        rgba(26, 27, 30, 0.95) 100%*/
    /*);*/
    pointer-events: none;
}

/* ─── Badges ─── */

.iw-card__badge {
    position: absolute;
    z-index: 2;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.iw-card__badge--distance {
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.iw-card__badge--price {
    bottom: 12px;
    left: 12px;
    background: var(--map-accent);
    color: white;
    box-shadow: 0 3px 12px rgba(255, 107, 53, 0.4);
}

/* ─── Body ─── */

.iw-card__body {
    padding: 14px 16px 8px;
}

.iw-card__date {
    display: block;
    color: var(--map-accent);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.iw-card__title {
    color: var(--map-text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 6px;
}

.iw-card__desc {
    color: var(--map-text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    max-height: 4.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.iw-card__desc p {
    margin: 0;
}

/* ─── Actions ─── */

.iw-card__actions {
    display: flex;
    gap: 8px;
    padding: 10px 16px 14px;
}

.iw-card__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: var(--map-radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}

.iw-card__btn--primary {
    background: var(--map-accent);
    color: white;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

.iw-card__btn--primary:hover {
    background: var(--map-accent-hover);
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

.iw-card__btn--secondary {
    background: var(--map-surface-light);
    color: var(--map-text);
    border: 1px solid var(--map-border);
}

.iw-card__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--map-accent);
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════
   Settings Panel
   ═══════════════════════════════════════════════════════════════ */

.map-panel .slide-pane__content {
    background: #14151a;
    color: var(--map-text);
}

.map-panel .slide-pane__header {
    background: #14151a;
    border-bottom: 1px solid var(--map-border);
}

.map-panel .slide-pane__title-wrapper .slide-pane__title {
    color: var(--map-text);
    font-size: 1.1rem;
    font-weight: 700;
}

.panel-close {
    color: var(--map-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.panel-close:hover {
    color: var(--map-accent);
}

.map-panel__content {
    padding: 4px 0;
}

.map-panel__section {
    padding: 4px 0;
}

.map-panel__label {
    color: var(--map-text);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.map-panel__divider {
    border: none;
    border-top: 1px solid var(--map-border);
    margin: 16px 0;
}

/* ─── Toggle switch ─── */

.map-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.map-toggle input {
    display: none;
}

.map-toggle__slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.map-toggle__slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.map-toggle input:checked + .map-toggle__slider {
    background: var(--map-accent);
}

.map-toggle input:checked + .map-toggle__slider::after {
    transform: translateX(20px);
}

.map-toggle__text {
    color: var(--map-text-muted);
    font-size: 0.82rem;
}

/* ─── Search row ─── */

.map-panel__search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.map-panel__autocomplete {
    flex: 1;
}

.map-panel__input {
    width: 100%;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--map-border);
    border-radius: var(--map-radius-sm);
    color: var(--map-text);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}

.map-panel__input::placeholder {
    color: var(--map-text-muted);
}

.map-panel__input:focus {
    border-color: var(--map-accent);
}

.map-panel__btn-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--map-accent);
    color: white;
    border: none;
    border-radius: var(--map-radius-sm);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.map-panel__btn-icon:hover {
    background: var(--map-accent-hover);
    transform: scale(1.05);
}

/* ─── Select ─── */

.map-panel__select {
    width: 100%;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--map-border);
    border-radius: var(--map-radius-sm);
    color: var(--map-text);
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a8a8a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.map-panel__select option {
    background: #1a1b1e;
    color: var(--map-text);
}

/* ─── Text button ─── */

.map-panel__btn-text {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    background: none;
    border: 1px solid var(--map-border);
    border-radius: var(--map-radius-sm);
    color: var(--map-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.map-panel__btn-text:hover {
    border-color: var(--map-accent);
    color: var(--map-accent);
}

/* ─── Filter buttons ─── */

.map-panel__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.map-panel__filter-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--map-border);
    border-radius: var(--map-radius-sm);
    color: var(--map-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.map-panel__filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--map-text);
}

.map-panel__filter-btn--active {
    background: rgba(255, 107, 53, 0.15);
    border-color: var(--map-accent);
    color: var(--map-accent);
}

.map-panel__filter-btn--active:hover {
    background: rgba(255, 107, 53, 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   Scrollbar
   ═══════════════════════════════════════════════════════════════ */

.map-panel ::-webkit-scrollbar {
    width: 6px;
}

.map-panel ::-webkit-scrollbar-track {
    background: transparent;
}

.map-panel ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.map-panel ::-webkit-scrollbar-thumb:hover {
    background: var(--map-accent);
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .iw-card {
        width: 280px;
    }

    .iw-card__hero {
        height: 140px;
    }

    .iw-card__title {
        font-size: 0.95rem;
    }

    .iw-card__actions {
        flex-direction: column;
    }

    .iw-card__btn {
        width: 100%;
    }

    .map-panel__filters {
        gap: 6px;
    }

    .map-panel__filter-btn {
        width: 38px;
        height: 38px;
    }
}
