/**
 * Bilbordia OOH — shared locator / campaign wishlist map styles.
 * Tokens: boohc-design-tokens.css
 */

/* Fixed map infobox (Treweler top-right) — above markers (hover/activated up to 100) */
.boohc-map-fixed-popup {
    position: absolute;
    top: 20px;
    right: 56px;
    z-index: var(--boohc-z-map-infobox);
    width: 340px;
    max-width: min(340px, calc(100% - 72px));
    pointer-events: auto;
}

#map-box:fullscreen,
#map-box:-webkit-full-screen,
#map-box-mobile:fullscreen,
#map-box-mobile:-webkit-full-screen {
    position: relative;
}

#map-box:fullscreen .boohc-map-fixed-popup,
#map-box:-webkit-full-screen .boohc-map-fixed-popup,
#map-box-mobile:fullscreen .boohc-map-fixed-popup,
#map-box-mobile:-webkit-full-screen .boohc-map-fixed-popup {
    right: 56px;
    z-index: var(--boohc-z-map-infobox);
}

/* Fullscreen: popup is reparented inside the map container beside markers */
#map-box:fullscreen .mapboxgl-marker,
#map-box:-webkit-full-screen .mapboxgl-marker,
#map-box-mobile:fullscreen .mapboxgl-marker,
#map-box-mobile:-webkit-full-screen .mapboxgl-marker {
    z-index: 1 !important;
}

.boohc-map-fixed-popup a,
.boohc-map-fixed-popup button {
    pointer-events: auto;
}

.boohc-map-fixed-popup[hidden] {
    display: none !important;
}

/* Shared map shell (locator /lokasyonlar + campaign planner side map) */
.bilbordia-map-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.bilbordia-map-container #map-box,
.bilbordia-map-container #map-box-mobile {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.mapboxgl-popup.bilbordia-popup.boohc-map-popup {
    max-width: 340px;
    z-index: 6;
}

.mapboxgl-popup.bilbordia-popup .mapboxgl-popup-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    width: 340px;
    max-width: 340px;
    overflow: visible;
}

.mapboxgl-popup.bilbordia-popup .mapboxgl-popup-tip {
    border-top-color: var(--boohc-surface);
}

.boohc-map-popup__wrap {
    position: relative;
    width: 340px;
    background: var(--boohc-surface);
    border-radius: 4px;
    box-shadow: var(--boohc-shadow-popup);
    overflow: hidden;
}

.boohc-map-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: var(--boohc-overlay-dark);
    color: var(--boohc-text-inverse);
    font-size: 18px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
}

.boohc-map-popup__close:hover {
    background: var(--boohc-overlay-dark-hover);
}

.boohc-map-popup__media {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    background: var(--boohc-surface-elevated);
    overflow: hidden;
}

.boohc-map-popup__image {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    cursor: zoom-in;
    border: none;
    background: transparent;
    padding: 0;
}

.boohc-map-popup__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.boohc-map-popup__indicate {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 5px 8px;
    background: var(--boohc-overlay-muted);
    color: var(--boohc-text-inverse);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.boohc-map-popup__mockup-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--boohc-text-inverse);
    background: var(--boohc-overlay-badge);
    pointer-events: none;
}

.boohc-map-popup__content {
    padding: 29px 25px 26px;
}

.boohc-map-popup__badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.boohc-map-popup__badge.available {
    color: var(--boohc-status-available-text);
    background-color: var(--boohc-status-available-bg);
}

.boohc-map-popup__badge.unavailable {
    color: var(--boohc-status-unavailable-text);
    background-color: var(--boohc-status-unavailable-bg);
}

.boohc-map-popup__resources {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.boohc-map-popup__resource {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--boohc-border-map);
    font-size: 12px;
    line-height: 1.35;
}

.boohc-map-popup__resource:last-child {
    border-bottom: 0;
}

.boohc-map-popup__resource-name {
    color: var(--boohc-text-map);
    font-weight: 500;
}

.boohc-map-popup__resource-status {
    font-weight: 600;
    white-space: nowrap;
}

.boohc-map-popup__resource--available .boohc-map-popup__resource-status {
    color: var(--boohc-status-available);
}

.boohc-map-popup__resource--unavailable .boohc-map-popup__resource-status {
    color: var(--boohc-status-unavailable);
}

.boohc-map-popup__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.boohc-map-popup__pill {
    padding: 5px 8px;
    margin: 2px;
    border-radius: 4px;
    background: var(--boohc-surface-elevated);
    color: var(--boohc-text-map-muted);
    font-size: 13px;
    line-height: 1.2;
}

.boohc-map-popup__price {
    margin: 0 0 5px;
    font-size: 19px;
    font-weight: 500;
    color: var(--boohc-text-map);
    line-height: 1.3;
}

.boohc-map-popup__title {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: var(--boohc-text-map);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.boohc-map-popup__sep {
    border: none;
    border-top: 1px solid var(--boohc-border-map-soft);
    margin: 10px 0;
}

.boohc-map-popup__specs {
    margin: 0;
    padding: 0;
    list-style: none;
}

.boohc-map-popup__spec {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    color: var(--boohc-text-map);
    border-bottom: 1px solid var(--boohc-border-map-faint);
}

.boohc-map-popup__spec:last-child {
    border-bottom: none;
}

.boohc-map-popup__spec-name {
    flex: 1 1 50%;
    color: var(--boohc-text-map-muted);
}

.boohc-map-popup__spec-value {
    flex: 0 0 auto;
    font-weight: 500;
    text-align: right;
}

.boohc-map-popup__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 42px;
    margin-top: 10px;
    padding: 0 16px;
    background-color: var(--boohc-map-cta);
    color: var(--boohc-text-inverse) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 3px;
    box-sizing: border-box;
}

.boohc-map-popup__cta:hover {
    background-color: var(--boohc-map-cta-hover);
    color: var(--boohc-text-inverse) !important;
}

/* Price pill markers */
.price-marker {
    background-color: var(--boohc-surface);
    border-radius: 16px;
    padding: 4px 10px;
    font-weight: bold;
    font-size: 13px;
    color: var(--boohc-text-inverse);
    box-shadow: var(--boohc-shadow-marker);
    border: 2px solid var(--boohc-surface);
    cursor: pointer;
    white-space: nowrap;
    transition: z-index 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.price-marker:hover {
    transform: scale(1.1);
    z-index: var(--boohc-z-map-marker-hover) !important;
}

.price-marker img.vendor-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 4px;
    object-fit: cover;
    background: var(--boohc-surface);
}

/* Campaign / shortlist marker states */
.price-marker--shortlisted {
    background-color: var(--boohc-surface-overlay) !important;
    color: var(--boohc-text) !important;
    border-color: var(--boohc-text-muted) !important;
}

.price-marker--shortlisted span {
    color: var(--boohc-text) !important;
}

.price-marker--activated {
    background-color: var(--boohc-focus) !important;
    border-color: var(--boohc-focus-dark) !important;
    transform: scale(1.08);
    z-index: calc(var(--boohc-z-map-marker-hover) - 10) !important;
    box-shadow: var(--boohc-marker-activated-ring);
}

.price-marker--activated span {
    color: var(--boohc-text-inverse) !important;
}

/* Map legend (campaign mode) */
.boohc-map-legend {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 5;
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    background: var(--boohc-surface-glass);
    border-radius: 6px;
    font-size: 12px;
    color: var(--boohc-text);
    box-shadow: var(--boohc-shadow-map);
    pointer-events: none;
}

.boohc-map-legend__item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.boohc-map-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.boohc-map-legend__dot--shortlisted {
    background: var(--boohc-surface-overlay);
    border: 2px solid var(--boohc-text-muted);
}

.boohc-map-legend__dot--activated {
    background: var(--boohc-focus);
    border: 2px solid var(--boohc-focus-dark);
}

/* Treweler-style clusters */
.marker-wrap {
    width: 68px;
    height: 68px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: z-index 0.2s;
}

.marker__shadow {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.1s ease-out;
}

.marker__border {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--boohc-shadow-marker);
    transition: all 0.6s linear;
}

.marker__center {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 700;
    font-size: 10px;
    box-shadow: var(--boohc-shadow-marker);
}

.marker-wrap:hover .marker__shadow,
.marker-wrap:hover .marker__border {
    transform: scale(1.05);
}

/* Gallery lightbox */
.boohc-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boohc-gallery-lightbox[hidden] {
    display: none !important;
}

.boohc-gallery-lightbox--in-map,
#map-box:fullscreen .boohc-gallery-lightbox,
#map-box:-webkit-full-screen .boohc-gallery-lightbox,
#map-box-mobile:fullscreen .boohc-gallery-lightbox,
#map-box-mobile:-webkit-full-screen .boohc-gallery-lightbox {
    position: absolute;
    inset: 0;
    z-index: var(--boohc-z-map-gallery-fs);
    width: 100%;
    height: 100%;
}

.boohc-gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: var(--boohc-overlay-lightbox);
}

.boohc-gallery-lightbox__stage {
    position: relative;
    z-index: 1;
    width: min(92vw, 1200px);
    max-width: min(92vw, 1200px);
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boohc-gallery-lightbox__img {
    max-width: 100%;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: var(--boohc-shadow-gallery);
    user-select: none;
    transition: opacity 0.2s ease;
}

.boohc-gallery-lightbox__stage.is-mockup-loading .boohc-gallery-lightbox__img {
    opacity: 0.4;
}

.boohc-gallery-lightbox__loading {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: var(--boohc-overlay-loading);
}

.boohc-gallery-lightbox__loading[hidden] {
    display: none !important;
}

.boohc-gallery-lightbox__loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 22px 28px;
    border-radius: 10px;
    background: var(--boohc-overlay-panel);
    box-shadow: var(--boohc-shadow-loading);
}

.boohc-gallery-lightbox__spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--boohc-spinner-track);
    border-top-color: var(--boohc-surface);
    border-radius: 50%;
    animation: boohc-gallery-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes boohc-gallery-spin {
    to {
        transform: rotate(360deg);
    }
}

.boohc-gallery-lightbox__loading-text {
    color: var(--boohc-text-inverse);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
}

.boohc-gallery-lightbox__close,
.boohc-gallery-lightbox__nav {
    position: absolute;
    z-index: 2;
    border: none;
    background: var(--boohc-overlay-controls-soft);
    color: var(--boohc-text-inverse);
    cursor: pointer;
    transition: background 0.2s;
}

.boohc-gallery-lightbox__close {
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    font-size: 24px;
    line-height: 40px;
    text-align: center;
}

.boohc-gallery-lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 56px;
    border-radius: 4px;
    font-size: 32px;
    line-height: 1;
}

.boohc-gallery-lightbox__prev {
    left: 20px;
}

.boohc-gallery-lightbox__next {
    right: 20px;
}

.boohc-gallery-lightbox__close:hover,
.boohc-gallery-lightbox__nav:hover {
    background: var(--boohc-overlay-controls);
}

.boohc-gallery-lightbox__nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.boohc-gallery-lightbox__caption,
.boohc-gallery-lightbox__counter {
    position: absolute;
    z-index: 2;
    left: 50%;
    transform: translateX(-50%);
    color: var(--boohc-text-inverse);
    text-align: center;
    pointer-events: none;
}

.boohc-gallery-lightbox__caption {
    bottom: 56px;
    max-width: min(90vw, 720px);
    font-size: 14px;
    line-height: 1.4;
    text-shadow: var(--boohc-caption-shadow);
}

.boohc-gallery-lightbox__counter {
    bottom: 24px;
    font-size: 13px;
    opacity: 0.85;
}

/* Campaign wishlist map panel */
.boohc-wishlist-map-panel {
    margin-bottom: var(--boohc-space-2);
    border: 1px solid var(--boohc-border);
    border-radius: var(--boohc-radius);
    overflow: hidden;
    background: var(--boohc-surface);
}

.boohc-wishlist-map-panel__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: var(--boohc-surface-muted);
    color: var(--boohc-text);
}

.boohc-wishlist-map-panel__summary::-webkit-details-marker {
    display: none;
}

.boohc-wishlist-map-panel__summary::after {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-left: 0.5rem;
    border-right: 2px solid var(--boohc-text-muted);
    border-bottom: 2px solid var(--boohc-text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.boohc-wishlist-map-panel[open] .boohc-wishlist-map-panel__summary::after {
    transform: rotate(-135deg);
}

.boohc-wishlist-map-panel__title {
    font-size: 0.95rem;
}

.boohc-wishlist-map-panel__meta {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--boohc-text-muted);
}

.boohc-wishlist-map-panel__body {
    border-top: 1px solid var(--boohc-border);
}

.boohc-wishlist-map-panel__map,
.boohc-wishlist-map-panel__map #map-box-mobile {
    width: 100%;
    height: 100%;
    min-height: 200px;
    position: relative;
    touch-action: pan-x pan-y;
}

.boohc-wishlist-map-panel__map {
    height: 50vh;
    min-height: 280px;
    max-height: var(--boohc-map-height);
}

.boohc-planner__map {
    width: 100%;
    height: var(--boohc-map-height);
    min-height: var(--boohc-map-min-height);
    position: relative;
    margin-bottom: var(--boohc-space-2);
}

/* Wishlist table ↔ map selection parity */
.wishlist_table tr.is-shortlisted > td {
    transition: background-color 0.15s ease;
}

.wishlist_table tr.is-activated > td {
    background-color: var(--boohc-row-selected-bg);
}

.wishlist_table tr.is-activated > td.product-identity,
.wishlist_table tr.is-activated > td.product-name {
    box-shadow: inset 3px 0 0 var(--boohc-focus);
}

.wishlist_table tr.is-selected > td {
    background-color: var(--boohc-row-activated-bg);
}

.wishlist_table.mobile tr.is-selected .mobile-product-card-content {
    background-color: var(--boohc-row-shortlist-bg);
    box-shadow: inset 3px 0 0 var(--boohc-focus);
}

.wishlist_table.mobile tr.is-activated .mobile-product-card-content {
    background-color: var(--boohc-row-hover-bg);
}

html.boohc-planner--mobile .boohc-map-fixed-popup {
    display: none !important;
}

html.boohc-planner--mobile .boohc-wishlist-map-panel {
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .boohc-gallery-lightbox {
        z-index: 10000060;
    }

    .boohc-map-fixed-popup {
        display: none !important;
    }
}
