/* Cello Map – brand UI */

.cello-map {
    --cm-teal: #1eb8b4;
    --cm-teal-dark: #169a97;
    --cm-yellow: #f5c518;
    --cm-text: #1a1a1a;
    --cm-muted: #6b7280;
    --cm-border: #e5e7eb;
    --cm-bg: #ffffff;
    --cm-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
    --cm-radius: 16px;
    --cm-sidebar-width: 340px;

    position: relative;
    color: var(--cm-text);
    direction: rtl;
    max-width: 100%;
}

.cello-map *,
.cello-map *::before,
.cello-map *::after {
    box-sizing: border-box;
}

.cello-map__search-card {
    position: relative;
    z-index: 4;
    background: var(--cm-bg);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow);
    padding: 16px 18px 14px;
    margin: 0 auto 14px;
    max-width: 520px;
}

.cello-map__toggle {
    display: flex;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 12px;
    gap: 2px;
}

.cello-map__toggle-btn {
    flex: 1;
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: 8px 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--cm-muted);
    cursor: pointer;
    transition: background .2s, color .2s, box-shadow .2s;
}

.cello-map__toggle-btn.is-active {
    background: var(--cm-teal);
    color: #fff;
    box-shadow: 0 2px 8px rgba(30, 184, 180, 0.35);
}

.cello-map__search-row {
    position: relative;
    display: flex;
    align-items: center;
}

.cello-map__search-input {
    width: 100%;
    border: 1px solid var(--cm-border);
    border-radius: 999px;
    padding: 12px 16px 12px 52px;
    font: inherit;
    font-size: 15px;
    outline: none;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.cello-map__search-input:focus {
    border-color: var(--cm-teal);
    box-shadow: 0 0 0 3px rgba(30, 184, 180, 0.15);
}

.cello-map__search-icon {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cm-teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.cello-map__search-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.cello-map__near-me,
.cello-map__reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.cello-map__near-me {
    color: var(--cm-teal);
}

.cello-map__near-me:hover {
    color: var(--cm-teal-dark);
}

.cello-map__reset {
    color: var(--cm-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cello-map__reset:hover {
    color: var(--cm-text);
}

.cello-map__reset[hidden] {
    display: none !important;
}

.cello-map__stage {
    position: relative;
    display: flex;
    flex-direction: row;
    height: min(70vh, 640px);
    min-height: 420px;
    border-radius: var(--cm-radius);
    overflow: hidden;
    box-shadow: var(--cm-shadow);
    background: #eef1f4;
}

.cello-map__map-pane {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
}

.cello-map__canvas {
    width: 100%;
    height: 100%;
}

.cello-map__canvas.loading {
    opacity: 0.55;
}

.cello-map__list-toggle {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 4;
    display: none;
    align-items: center;
    gap: 8px;
    border: 0;
    background: #fff;
    border-radius: 999px;
    padding: 10px 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    color: var(--cm-text);
}

.cello-map__list-toggle[hidden] {
    display: none !important;
}

.cello-map__sidebar {
    flex: 0 0 0;
    width: 0;
    max-width: 0;
    height: 100%;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transition: flex-basis 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                max-width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.25s ease;
    pointer-events: none;
}

.cello-map__sidebar.is-open {
    flex-basis: var(--cm-sidebar-width);
    width: var(--cm-sidebar-width);
    max-width: var(--cm-sidebar-width);
    opacity: 1;
    pointer-events: auto;
    box-shadow: -4px 0 24px rgba(15, 23, 42, 0.12);
    border-right: 1px solid var(--cm-border);
}

.cello-map__sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--cm-border);
    flex-shrink: 0;
}

.cello-map__sidebar-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.cello-map__sidebar-count {
    color: var(--cm-muted);
    font-weight: 600;
}

.cello-map__sidebar-close {
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--cm-muted);
}

.cello-map__sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.cello-map__sidebar-item {
    display: block;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f1f3f5;
}

.cello-map__sidebar-item-main {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    cursor: pointer;
    transition: background .15s;
}

.cello-map__sidebar-item:hover > .cello-map__sidebar-item-main {
    background: #f8fafb;
}

.cello-map__sidebar-item.is-selected > .cello-map__sidebar-item-main {
    background: #fff8dc;
}

.cello-map__sidebar-pin {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    color: var(--cm-teal);
}

.cello-map__sidebar-item-body {
    min-width: 0;
    flex: 1;
}

.cello-map__sidebar-item-name {
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 2px;
}

.cello-map__sidebar-item-address {
    margin: 0;
    font-size: 12px;
    color: var(--cm-muted);
    line-height: 1.4;
}

.cello-map__sidebar-item-distance {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--cm-teal);
}

.cello-map__sidebar-item-detail {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease-in-out;
    background: #fafbfc;
}

.cello-map__sidebar-item-detail.is-open {
    grid-template-rows: 1fr;
}

.cello-map__sidebar-item-detail-inner {
    overflow: hidden;
    min-height: 0;
    padding: 0 14px;
    border-top: 1px solid transparent;
    transition: padding 0.3s ease-in-out, border-top-color 0.3s ease-in-out;
}

.cello-map__sidebar-item-detail.is-open .cello-map__sidebar-item-detail-inner {
    padding: 12px 14px 14px;
    border-top-color: var(--cm-border);
}

.cello-map__show-more {
    border: 0;
    border-top: 1px solid var(--cm-border);
    background: #fff;
    padding: 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--cm-teal);
    cursor: pointer;
    flex-shrink: 0;
}

.cello-map__show-more[hidden] {
    display: none !important;
}

.cello-map__info-row {
    display: flex;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.cello-map__info-label {
    font-weight: 700;
    white-space: nowrap;
}

.cello-map__info-value {
    color: #333;
}

.cello-map__detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.cello-map__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    padding: 10px 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}

.cello-map__btn--primary {
    background: var(--cm-teal);
    color: #fff;
    border-color: var(--cm-teal);
}

.cello-map__btn--primary:hover {
    background: var(--cm-teal-dark);
    color: #fff;
}

.cello-map__btn--outline {
    background: #fff;
    color: var(--cm-text);
    border-color: var(--cm-border);
}

.cello-map__btn--outline:hover {
    border-color: var(--cm-teal);
    color: var(--cm-teal);
}

.cello-map__mobile-card {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 6;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--cm-shadow);
    padding: 16px;
}

.cello-map__mobile-card[hidden] {
    display: none !important;
}

.cello-map__mobile-card-close {
    position: absolute;
    top: 6px;
    left: 8px;
    border: 0;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cm-muted);
    cursor: pointer;
}

.cello-map__mobile-card-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    padding-left: 36px;
}

.cello-map__mobile-card-meta {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--cm-muted);
}

.cello-map__mobile-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.cello-map__mobile-card-actions .cello-map__btn {
    flex: 1;
}

.cello-map__mobile-card-extra {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--cm-border);
}

.cello-map__mobile-card-extra[hidden] {
    display: none !important;
}

/* Autocomplete dropdown */
.autocomplete-suggestions {
    border: 1px solid var(--cm-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--cm-shadow) !important;
    background: #fff !important;
    overflow: hidden;
    z-index: 9999 !important;
}

.autocomplete-suggestion {
    padding: 10px 14px !important;
    font-size: 14px !important;
    cursor: pointer;
}

.autocomplete-suggestion.autocomplete-selected {
    background: #e8f9f8 !important;
}

/* Desktop */
@media (min-width: 901px) {
    .cello-map__list-toggle {
        display: inline-flex;
    }

    .cello-map__stage.is-sidebar-open .cello-map__list-toggle {
        display: none !important;
    }

    .cello-map__mobile-card {
        display: none !important;
    }

    .cello-map__stage {
        height: min(75vh, 720px);
    }
}

/* Mobile */
@media (max-width: 900px) {
    .cello-map__search-card {
        margin-bottom: 10px;
        max-width: none;
    }

    .cello-map__sidebar,
    .cello-map__list-toggle {
        display: none !important;
    }

    .cello-map__stage {
        min-height: 360px;
        height: 55vh;
    }
}
