/**
 * Areti Portal — Map Styles
 *
 * @package AretiPortal
 */

/* ─── Map Container ────────────────────────────────────── */

.artip-map-column {
    flex: 0 0 40%;
    position: sticky;
    top: 20px;
    height: calc(100vh - 100px);
    max-height: 800px;
    border-radius: var(--artip-radius);
    overflow: hidden;
    box-shadow: var(--artip-shadow);
}

.artip-map {
    width: 100%;
    height: 100%;
    background: #e8e8e8;
}

.artip-standalone-map {
    width: 100%;
    border-radius: var(--artip-radius);
    overflow: hidden;
    box-shadow: var(--artip-shadow);
}

/* ─── Custom Map Markers ───────────────────────────────── */

.artip-marker {
    background: var(--artip-white);
    border: 2px solid var(--artip-primary);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--artip-text);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all var(--artip-transition);
    position: relative;
    z-index: 1;
}

.artip-marker::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--artip-primary);
}

.artip-marker:hover,
.artip-marker--active {
    background: var(--artip-primary);
    color: var(--artip-white);
    transform: scale(1.1);
    z-index: 10;
}

.artip-marker--active::after {
    border-top-color: var(--artip-primary);
}

/* ─── Cluster Markers ──────────────────────────────────── */

.artip-cluster {
    background: var(--artip-white);
    border: 2px solid var(--artip-primary);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--artip-text);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.artip-cluster::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--artip-primary);
}

.artip-cluster__count {
    background: var(--artip-primary);
    color: var(--artip-white);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
}

.artip-cluster:hover {
    transform: scale(1.05);
}

/* ─── Map Popup ────────────────────────────────────────── */

.artip-popup {
    width: 240px;
    font-family: var(--artip-font);
}

.artip-popup__image {
    width: 100%;
    height: 140px;
    overflow: hidden;
    border-radius: var(--artip-radius-sm) var(--artip-radius-sm) 0 0;
}

.artip-popup__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artip-popup__body {
    padding: 10px 12px;
}

.artip-popup__name {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--artip-text);
}

.artip-popup__city {
    display: block;
    font-size: 12px;
    color: var(--artip-text-light);
    margin-bottom: 4px;
}

.artip-popup__stars {
    display: inline-flex;
    gap: 1px;
    font-size: 12px;
    color: #f5a623;
    margin-bottom: 8px;
}

.artip-popup__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--artip-border);
}

.artip-popup__price {
    font-size: 15px;
    font-weight: 700;
    color: var(--artip-text);
}

.artip-popup__link {
    font-size: 13px;
    color: var(--artip-primary);
    text-decoration: none;
    font-weight: 600;
}

.artip-popup__link:hover {
    text-decoration: underline;
}

/* ─── Cluster Popup ────────────────────────────────────── */

.artip-cluster-popup {
    width: 260px;
    max-height: 320px;
    font-family: var(--artip-font);
}

.artip-cluster-popup__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--artip-text-light);
    margin: 0 0 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--artip-border);
}

.artip-cluster-popup__list {
    max-height: 260px;
    overflow-y: auto;
}

.artip-cluster-popup__item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--artip-border);
    cursor: pointer;
    transition: background var(--artip-transition);
}

.artip-cluster-popup__item:last-child {
    border-bottom: none;
}

.artip-cluster-popup__item:hover {
    background: var(--artip-bg);
}

.artip-cluster-popup__img {
    width: 56px;
    height: 42px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.artip-cluster-popup__info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.artip-cluster-popup__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--artip-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artip-cluster-popup__price {
    font-size: 12px;
    font-weight: 700;
    color: var(--artip-primary);
}

/* ─── Leaflet overrides ────────────────────────────────── */

.leaflet-popup-content-wrapper {
    border-radius: var(--artip-radius-sm) !important;
    padding: 0 !important;
    box-shadow: var(--artip-shadow-hover) !important;
}

.leaflet-popup-content {
    margin: 0 !important;
}

.leaflet-popup-close-button {
    color: var(--artip-text) !important;
    font-size: 18px !important;
    width: 24px !important;
    height: 24px !important;
    z-index: 10;
}
