/* ══════════════════════════════════════════════
   GC CHILE MAP — Mapa interactivo por regiones
   ══════════════════════════════════════════════ */

/* ── Map area layout ── */
.gc-chile-map__map-area {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    position: relative;
}

.gc-chile-map__map-wrapper {
    position: relative;
    width: 100%;
    max-width: 380px;
    flex-shrink: 0;
}

.gc-chile-map__map-wrapper svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Regiones SVG ── */
.gc-region {
    fill: #C5C5C5;
    stroke: #fff;
    stroke-width: 1;
    cursor: default;
    transition: fill .2s, filter .2s;
}

.gc-region--has {
    fill: #43AB3B;
    cursor: pointer;
}

.gc-region--has:hover {
    fill: #358C2F;
    filter: drop-shadow(0 2px 6px rgba(67, 171, 59, .3));
}

.gc-region--active {
    fill: #358C2F !important;
    filter: drop-shadow(0 3px 8px rgba(67, 171, 59, .4)) !important;
}

/* ── Panel lateral (desktop) ── */
.gc-panel {
    display: none;
    width: 340px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .14);
    overflow: hidden;
    z-index: 5;
    flex-shrink: 0;
    margin-right: -16px;
    animation: gcPanIn .3s ease;
}

.gc-panel--open { display: block; }

@keyframes gcPanIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.gc-panel__hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 10px;
    border-bottom: 1px solid #eee;
}

.gc-panel__title { font-size: 16px; font-weight: 700; color: #1B3C73; }
.gc-panel__cnt   { font-size: 13px; color: #6C757D; }
.gc-panel__x     { background: none; border: none; font-size: 24px; color: #999; cursor: pointer; line-height: 1; transition: color .2s; }
.gc-panel__x:hover { color: #1A1A1A; }

.gc-panel__body {
    padding: 12px 16px 16px;
    max-height: 400px;
    overflow-y: auto;
}

.gc-panel__body::-webkit-scrollbar       { width: 4px; }
.gc-panel__body::-webkit-scrollbar-thumb { background: #CED4DA; border-radius: 2px; }

.gc-panel__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Tarjeta de cliente ── */
.gc-panel__card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #F5F5F5;
    border-radius: 8px;
    transition: background .2s;
}

.gc-panel__card:hover { background: #E9ECEF; }

.gc-panel__card-logo {
    width: 32px; height: 32px; border-radius: 4px;
    object-fit: contain; background: #fff;
    border: 1px solid #DEE2E6; flex-shrink: 0;
}

.gc-panel__card-icon {
    width: 32px; height: 32px; border-radius: 4px;
    background: #1B3C73; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex-shrink: 0;
}

.gc-panel__card-name {
    font-size: 13px; font-weight: 600; line-height: 1.25; color: #1A1A1A;
}

/* ── Línea conectora SVG ── */
.gc-connector {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none; z-index: 4;
}

.gc-connector line   { stroke: #43AB3B; stroke-width: 2.5; }
.gc-connector circle { fill: #43AB3B; }

/* ── Tooltip hover ── */
.gc-chile-map__tooltip {
    position: absolute; z-index: 10; pointer-events: none;
    transform: translate(-50%, -100%); margin-top: -10px;
    opacity: 0; transition: opacity .15s;
}

.gc-chile-map__tooltip--show { opacity: 1; }

.gc-chile-map__tooltip-inner {
    background: #0D1F3C; color: #fff;
    padding: 6px 12px; border-radius: 6px;
    font-size: 13px; font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.gc-chile-map__tooltip-inner::after {
    content: ''; position: absolute;
    bottom: -5px; left: 50%; transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #0D1F3C;
}

/* ── Modal mobile ── */
.gc-mobile-modal {
    display: none; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, .3);
    z-index: 999; align-items: center; justify-content: center;
}

.gc-mobile-modal--open { display: flex; }

.gc-mobile-modal__box {
    background: #fff; border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
    width: 92%; max-width: 500px; max-height: 80vh;
    overflow: hidden; animation: gcMobIn .25s ease;
}

@keyframes gcMobIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gc-mobile-modal__hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 10px; border-bottom: 1px solid #eee;
}

.gc-mobile-modal__title { font-size: 17px; font-weight: 700; color: #1B3C73; }
.gc-mobile-modal__x     { background: none; border: none; font-size: 26px; color: #999; cursor: pointer; line-height: 1; }
.gc-mobile-modal__body   { padding: 14px 18px 18px; overflow-y: auto; max-height: calc(80vh - 60px); }

/* ══════════════════════════════════════════════
   FIX: WordPress Columns + Bootstrap grid
   ══════════════════════════════════════════════ */
.wp-block-columns.row > .wp-block-column[class*="col-"] {
    flex-basis: auto !important;
    flex-grow: 0 !important;
}

/* ══════════════════════════════════════════════
   DESKTOP
   ══════════════════════════════════════════════ */
@media (min-width: 992px) {
    .gc-chile-map {
        margin-top: -140px;
    }

    .gc-chile-map .gc-chile-map__map-area {
        position: sticky;
        top: 100px;
    }
}

/* ══════════════════════════════════════════════
   TABLET / MOBILE
   ══════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .gc-chile-map__map-area {
        justify-content: center;
    }

    .gc-chile-map__map-wrapper {
        max-width: 100% !important;
        width: 100% !important;
    }

    .gc-panel     { display: none !important; }
    .gc-connector { display: none !important; }
}
