/* ==========================================================
   MASTERGLASS — SUCURSALES Y CONTACTO
   01. Panel principal y listado de locales
   ========================================================== */
#mg-locations {
    --mg-blue: #004497;
    --mg-navy: #00316c;
    --mg-red: #de0209;
    --mg-ink: #173655;
    --mg-muted: #64788f;
    --mg-line: #dce6f2;
    --mg-paper: #f3f7fc;
    color-scheme: light;
}
#mg-locations .mg-section {
    padding: 32px;
    border: 1px solid var(--mg-line);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 18px 60px #00316c06;
}
#mg-locations .mg-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
    gap: 32px;
    align-items: stretch;
}
#mg-locations .mg-locations-list {
    min-width: 0;
}
#mg-locations .mg-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
#mg-locations .mg-list-heading h3 {
    font-size: 25px;
    letter-spacing: -0.03em;
}
#mg-locations .mg-count {
    color: var(--mg-muted);
    font-size: 13px;
    white-space: nowrap;
}
#mg-locations .mg-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
#mg-locations .mg-branch-row {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--mg-line);
    border-radius: 13px;
    background: #fff;
    transition: background 0.18s, border-color 0.18s;
}
#mg-locations .mg-branch {
    display: flex;
    align-items: center;
    gap: 13px;
    flex: 1;
    min-width: 0;
    min-height: 76px;
    padding: 13px;
    border-radius: 12px 0 0 12px;
    text-align: left;
    color: var(--mg-ink);
}
#mg-locations .mg-num {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 35px;
    height: 37px;
    border-radius: 10px;
    background: #edf3fc;
    color: var(--mg-blue);
    font-size: 13px;
    font-weight: 700;
}
#mg-locations .mg-branch strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
}
#mg-locations .mg-branch small {
    display: block;
    margin-top: 4px;
    color: var(--mg-muted);
    font-size: 13px;
}
#mg-locations .mg-branch-map {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    border-radius: 0 12px 12px 0;
    color: var(--mg-blue);
}
#mg-locations .mg-branch-map svg {
    width: 20px;
    height: 20px;
}
#mg-locations .mg-branch-row:hover {
    border-color: #87addc;
    background: #f7faff;
}
#mg-locations .mg-branch-map:hover {
    background: #0044970d;
}
#mg-locations .mg-branch-row[data-selected="true"] {
    border-color: var(--mg-blue);
    background: var(--mg-blue);
    box-shadow: 0 5px 15px #00449716;
}
#mg-locations .mg-branch[aria-pressed="true"],
#mg-locations .mg-branch-row[data-selected="true"] .mg-branch-map {
    color: #fff;
}
#mg-locations .mg-branch[aria-pressed="true"] .mg-num {
    background: #ffffff24;
    color: #fff;
}
#mg-locations .mg-branch[aria-pressed="true"] small {
    color: #ccdef6;
}
#mg-locations .mg-branch-row[data-selected="true"] .mg-branch-map:hover {
    background: #ffffff20;
}

/* 02. Ficha del local seleccionado */
#mg-locations .mg-detail {
    margin-top: 22px;
    padding-top: 21px;
    border-top: 1px solid var(--mg-line);
}
#mg-locations .mg-detail-label {
    color: var(--mg-blue);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
}
#mg-locations .mg-detail h3 {
    margin-top: 10px;
    color: var(--mg-navy);
    font-size: 27px;
    line-height: 1.2;
}
#mg-locations .mg-detail p {
    min-height: 48px;
    margin: 10px 0 17px;
    color: var(--mg-muted);
    font-size: 15px;
    line-height: 1.65;
}
#mg-locations .mg-map-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 14px 17px;
    border-radius: 11px;
    background: var(--mg-red);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    transition: background 0.18s;
}
#mg-locations .mg-map-link:hover {
    background: #bd0006;
}
#mg-locations .mg-map-link svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}
#mg-locations .mg-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-top: 6px;
    color: var(--mg-blue);
    font-size: 15px;
}
#mg-locations .mg-whatsapp svg {
    width: 19px;
    height: 19px;
}
#mg-locations .mg-whatsapp:hover {
    text-decoration: underline;
}

/* 03. Mapa, puntos por ciudad y botones sobre el mapa */
#mg-locations .mg-map-panel {
    position: relative;
    min-width: 0;
    min-height: 625px;
    overflow: hidden;
    border: 1px solid var(--mg-line);
    border-radius: 20px;
    background: var(--mg-paper);
}
#mg-locations .mg-map-top {
    position: absolute;
    z-index: 2;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--mg-blue);
    font-size: 14px;
    font-weight: 700;
}
#mg-locations .mg-map-top svg {
    width: 19px;
    height: 19px;
}
#mg-locations .mg-map-area {
    position: absolute;
    inset: 48px 0 48px;
}
#mg-locations .mg-geography {
    display: block;
    width: 100%;
    height: 100%;
}
#mg-locations .mg-geography path {
    fill: #e2ebf8;
    stroke: #b4c9e4;
    stroke-width: 0.8;
    stroke-linejoin: round;
    transition: fill 0.25s;
}
#mg-locations .mg-geography path[data-highlight="true"] {
    fill: #8eafd8;
}
#mg-locations .mg-ecuador-label {
    position: absolute;
    top: 49%;
    left: 49%;
    color: #587796;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    pointer-events: none;
}
#mg-locations .mg-ocean {
    position: absolute;
    top: 77%;
    left: 20px;
    color: #7d96b1;
    font-size: 12px;
    font-style: italic;
    line-height: 1.6;
    letter-spacing: 1.3px;
    text-align: center;
    pointer-events: none;
}
#mg-locations .mg-city {
    position: absolute;
    z-index: 3;
    width: 0;
    height: 0;
}
#mg-locations .mg-city-dot {
    position: absolute;
    display: block;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--mg-blue);
    box-shadow: 0 0 0 5px #00449710;
}
#mg-locations .mg-city[data-active="true"] {
    z-index: 4;
}
#mg-locations .mg-city[data-active="true"] .mg-city-dot {
    background: var(--mg-red);
    box-shadow: 0 0 0 5px #de020912;
}
#mg-locations .mg-map-bubble {
    position: absolute;
    width: max-content;
    padding: 7px;
    border: 1px solid #cad9ec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px #17365509;
}
#mg-locations .mg-map-bubble > strong {
    display: block;
    padding: 2px 6px 5px;
    color: var(--mg-ink);
    font-size: 13px;
    font-weight: 700;
}
#mg-locations .mg-map-bubble button {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-height: 44px;
    padding: 9px 8px;
    border-radius: 7px;
    color: var(--mg-blue);
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
}
#mg-locations .mg-map-bubble button span {
    color: #8499b1;
    font-size: 12px;
}
#mg-locations .mg-map-bubble button:hover {
    background: #eaf2fc;
}
#mg-locations .mg-map-bubble button[aria-pressed="true"] {
    background: var(--mg-red);
    color: #fff;
}
#mg-locations .mg-map-bubble button[aria-pressed="true"] span {
    color: #ffe2e4;
}
#mg-locations .mg-map-note {
    position: absolute;
    bottom: 20px;
    left: 18px;
    max-width: 140px;
    color: #748ba5;
    font-size: 12px;
    line-height: 1.4;
}
#mg-locations .mg-map-tag {
    position: absolute;
    right: 18px;
    bottom: 18px;
    padding: 7px 10px;
    border: 1px solid var(--mg-line);
    border-radius: 8px;
    background: #fff;
    color: var(--mg-muted);
    font-size: 12px;
}
#mg-locations .mg-footnote {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--mg-line);
    color: var(--mg-muted);
    font-size: 13px;
}
#mg-locations .mg-footnote strong {
    color: var(--mg-blue);
}

/* 04. Teléfono, correo y WhatsApp */
#mg-locations .mg-contact-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-top: 24px;
    padding: 29px 32px;
    border-radius: 22px;
    background: linear-gradient(120deg, #0957b0, var(--mg-blue), #003572);
    color: #fff;
}
#mg-locations .mg-contact-copy {
    display: flex;
    align-items: center;
    gap: 16px;
}
#mg-locations .mg-contact-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: #ffffff18;
}
#mg-locations .mg-contact-icon svg {
    width: 28px;
    height: 28px;
}
#mg-locations .mg-contact-copy h3 {
    font-size: 27px;
}
#mg-locations .mg-contact-copy p {
    margin-top: 7px;
    color: #d4e6fb;
    font-size: 15px;
}
#mg-locations .mg-contact-channels {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
#mg-locations .mg-contact-channels a:first-child {
    font-size: 23px;
    font-weight: 700;
}
#mg-locations .mg-contact-channels a:last-child {
    color: #d4e6fb;
    font-size: 14px;
}
#mg-locations .mg-contact-bar .button {
    padding: 14px 20px;
    font-size: 16px;
}

/* 05. Adaptación a tabletas y celulares */
@media (max-width: 1050px) {
    #mg-locations .mg-section {
        padding: 25px;
    }
    #mg-locations .mg-layout {
        gap: 22px;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    }
    #mg-locations .mg-list-heading h3 {
        font-size: 22px;
    }
    #mg-locations .mg-branch {
        gap: 10px;
        padding: 12px 10px;
    }
    #mg-locations .mg-branch strong {
        font-size: 16px;
    }
    #mg-locations .mg-contact-bar {
        gap: 22px;
    }
}
@media (max-width: 760px) {
    #mg-locations .mg-section {
        padding: 20px;
        border-radius: 20px;
    }
    #mg-locations .mg-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
    #mg-locations .mg-map-panel {
        grid-row: 1;
        min-height: 470px;
    }
    #mg-locations .mg-map-top {
        top: 17px;
        left: 15px;
        font-size: 13px;
    }
    #mg-locations .mg-map-area {
        inset: 38px 0 48px;
    }
    #mg-locations .mg-branch {
        min-height: 72px;
        padding: 12px;
    }
    #mg-locations .mg-branch strong {
        font-size: 17px;
    }
    #mg-locations .mg-branch-map {
        width: 48px;
    }
    #mg-locations .mg-detail {
        padding: 20px;
        border: 1px solid var(--mg-line);
        border-radius: 14px;
        background: var(--mg-paper);
    }
    #mg-locations .mg-detail p {
        min-height: 0;
    }
    #mg-locations .mg-map-bubble {
        padding: 4px;
    }
    #mg-locations .mg-map-bubble button {
        padding: 9px 6px;
        font-size: 12px;
    }
    #mg-locations .mg-map-bubble > strong {
        font-size: 12px;
    }
    #mg-locations .mg-ocean {
        top: 82%;
        left: 12px;
        font-size: 10px;
    }
    #mg-locations .mg-ecuador-label {
        font-size: 12px;
    }
    #mg-locations .mg-map-tag {
        right: 12px;
        bottom: 15px;
        padding: 6px;
        font-size: 10px;
    }
    #mg-locations .mg-map-note {
        bottom: 15px;
        left: 12px;
        max-width: 110px;
        font-size: 10px;
    }
    #mg-locations .mg-footnote {
        font-size: 12px;
    }
    #mg-locations .mg-contact-bar {
        align-items: flex-start;
        padding: 25px;
    }
    #mg-locations .mg-contact-bar .button {
        justify-content: space-between;
        width: 100%;
    }
    #mg-locations .mg-contact-copy h3 {
        font-size: 25px;
    }
}
@media (max-width: 380px) {
    #mg-locations .mg-section {
        padding: 14px;
    }
    #mg-locations .mg-detail {
        padding: 16px;
    }
    #mg-locations .mg-map-link {
        padding: 13px;
        font-size: 14px;
    }
    #mg-locations .mg-map-bubble button {
        gap: 5px;
        padding-inline: 5px;
    }
    #mg-locations .mg-contact-bar {
        padding: 21px;
    }
    #mg-locations .mg-contact-icon {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    #mg-locations * {
        transition: none !important;
    }
}
