/* SUCURSALES — full-width geographic explorer and accessible directory. */
.branches-hero {
    padding: 28px 0 48px;
    background: #073f22;
    color: white;
}
.branches-hero h1 {
    max-width: 880px;
    font-size: clamp(2.3rem, 4.6vw, 4rem);
    line-height: 1.12;
    margin: 14px 0 22px;
}
.branches-hero .eyebrow {
    color: #ffb677;
}
.branches-hero .lead {
    max-width: 790px;
    color: #e1eee5;
}
.breadcrumb {
    display: flex;
    gap: 12px;
    font-size: .9rem;
    margin-bottom: 30px;
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.branch-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 45px;
    margin-top: 25px;
}
.branch-stats span {
    display: flex;
    align-items: center;
    gap: 12px;
}
.branch-stats strong {
    font-size: 2.2rem;
    line-height: 1;
    color: #ffb677;
}
.branch-finder {
    padding: 26px 0;
    background: #fff;
    border-bottom: 1px solid #dbe8de;
}
.branch-filters {
    display: grid;
    grid-template-columns: 1fr 1.6fr auto;
    align-items: end;
    gap: 18px;
}
.branch-filters label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}
.branch-filters select, .branch-filters input {
    display: block;
    width: 100%;
    min-height: 49px;
    padding: 11px 14px;
    border: 1px solid #b6cebd;
    border-radius: 10px;
    color: #173321;
    background: #f4f8f5;
    font-size: 1rem;
}
.branch-filters button {
    min-height: 49px;
    padding: 10px 18px;
    background: #0b5d32;
    color: white;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}
.branch-filters button:hover {
    background: #f57f20;
    color: #173321;
}
.map-section {
    padding: 25px 20px 38px;
    background: #f1f7f2;
}
.map-wide {
    max-width: 1500px;
    margin: 0 auto;
}
.map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}
.map-toolbar h2 {
    font-size: 1.45rem;
    margin: 0;
}
.map-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.map-controls button {
    padding: 9px 14px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 9px;
    border: 1px solid #b5cdbd;
    background: white;
    color: #073f22;
    font-weight: 700;
    cursor: pointer;
}
.map-controls button:hover {
    background: #f57f20;
    border-color: #f57f20;
}
.map-controls button:disabled {
    opacity: .5;
    cursor: default;
}
.map-stage {
    position: relative;
    margin-top: 18px;
    background: radial-gradient(ellipse at 45% 50%, #fff, #e4eee7);
    border: 1px solid #d1e0d5;
    border-radius: 24px;
    overflow: hidden;
}
#mexico-map {
    display: block;
    width: 100%;
    height: clamp(380px, 53vw, 740px);
    touch-action: pan-y;
}
.map-state {
    fill: #dbe5de;
    stroke: #fff;
    stroke-width: 1.3;
    vector-effect: non-scaling-stroke;
    cursor: pointer;
    transition: fill .18s;
}
.map-state.has-branches {
    fill: #238b40;
}
.map-state:hover, .map-state:focus-visible {
    fill: #87ba57;
    outline: none;
    stroke: #073f22;
    stroke-width: 2;
}
.map-state.is-selected {
    fill: #f57f20;
    stroke: #073f22;
    stroke-width: 2;
}
.store-marker {
    cursor: pointer;
    color: #073f22;
}
.store-marker line {
    stroke: #567a60;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}
.store-marker rect {
    fill: white;
    stroke: #0b5d32;
    stroke-width: 1.8;
}
.store-marker circle {
    fill: #073f22;
    stroke: #fff;
    stroke-width: 1;
}
.store-marker text {
    fill: #fff;
    font: bold 12px Arial, sans-serif;
}
.store-marker:hover rect, .store-marker:focus-visible rect, .store-marker.is-selected rect {
    fill: #ffcf9a;
    stroke: #8c3b00;
}
.store-marker:focus-visible {
    outline: none;
}
.map-greeting {
    position: absolute;
    bottom: 18px;
    left: 3%;
    width: clamp(90px, 13vw, 190px);
    pointer-events: none;
}
.map-greeting img {
    width: 100%;
    height: auto;
    transform-origin: 50% 100%;
    animation: greeting 4s ease-in-out 2;
}
.map-greeting p {
    background: white;
    color: #073f22;
    padding: 12px;
    border-radius: 14px 14px 14px 0;
    font-size: .9rem;
    font-weight: 700;
    box-shadow: 0 8px 20px #073f2215;
    margin-bottom: 5px;
}
@keyframes greeting {
    0%, 100% {
        transform: rotate(0);
    }
    30% {
        transform: rotate(-3deg);
    }
    60% {
        transform: rotate(2deg);
    }
}
.map-stage.is-zoomed .map-greeting {
    display: none;
}
.map-caption {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 18px;
}
#map-selection {
    font-weight: 750;
}
.map-legend, .map-note {
    font-size: .875rem;
    color: #435c4b;
}
.map-note {
    margin: 12px 0 0;
}
.map-note a {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.directory-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}
.directory-heading h2 {
    font-size: clamp(1.9rem, 3.3vw, 2.9rem);
    margin: 8px 0 0;
}
#results-status {
    font-weight: 700;
    color: #0b5d32;
}
.branch-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.branch-card {
    border: 1px solid #dbe8de;
    border-top: 4px solid #238b40;
    padding: 23px;
    border-radius: 0 0 18px 18px;
    background: #fff;
    box-shadow: 0 8px 24px #073f2208;
    transition: border-color .2s, background .2s;
    min-width: 0;
}
.branch-card:hover {
    border-top-color: #f57f20;
    background: #f4f8f5;
}
.branch-card .eyebrow {
    font-size: .8rem;
    letter-spacing: .05em;
}
.branch-card h3 {
    font-size: 1.25rem;
    line-height: 1.3;
    margin: 12px 0 18px;
}
.branch-contacts {
    display: grid;
    gap: 12px;
    font-size: .95rem;
}
.branch-contacts a {
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.branch-contacts a:hover {
    color: #93420b;
}
.branch-whatsapp {
    font-weight: 700;
    color: #0b5d32;
}
[hidden] {
    display: none !important;
}
.load-more {
    text-align: center;
    margin-top: 30px;
}
.no-results {
    text-align: center;
    padding: 45px 20px;
    background: #f1f7f2;
    border-radius: 20px;
}
.no-results h3 {
    font-size: 1.45rem;
}
.corporate-sales {
    padding: 50px 0;
    background: #fff7ed;
}
.corporate-sales > .container {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 45px;
    align-items: center;
}
.corporate-sales h2 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.2;
}
.corporate-contacts {
    display: grid;
    gap: 16px;
}
.corporate-contacts article {
    background: white;
    border-left: 4px solid #f57f20;
    padding: 20px;
    border-radius: 0 12px 12px 0;
}
.corporate-contacts h3 {
    font-size: 1.1rem;
    margin: 0 0 9px;
}
.corporate-contacts a {
    display: block;
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.back-top {
    font-size: .75rem;
}
@media (max-width: 850px) {
    .branch-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .branch-filters {
        grid-template-columns: 1fr 1fr;
    }
    .branch-filters > button {
        grid-column: 1 / -1;
    }
    .corporate-sales > .container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .map-greeting p {
        display: none;
    }
}
@media (max-width: 540px) {
    .branches-hero {
        padding-bottom: 34px;
    }
    .branch-filters {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .map-section {
        padding-inline: 12px;
    }
    .map-toolbar h2 {
        width: 100%;
    }
    .map-controls {
        width: 100%;
        gap: 5px;
    }
    .map-controls button {
        padding-inline: 10px;
        font-size: .9rem;
    }
    #mexico-map {
        height: 355px;
    }
    .map-stage {
        border-radius: 16px;
    }
    .map-greeting {
        width: 70px;
        bottom: 4px;
        left: 5px;
    }
    .directory-heading {
        display: block;
    }
    .branch-grid {
        grid-template-columns: 1fr;
    }
    .branch-results.section {
        padding: 48px 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    .map-greeting img {
        animation: none;
    }
    .map-state, .branch-card {
        transition: none;
    }
}
/* GUIDED MAP JOURNEY — visible feedback, results and a clear way back. */
#mapa, #directorio {
    scroll-margin-top: 115px;
}
.map-instruction {
    margin: 14px 0 0;
    color: #174b2d;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.map-instruction::before, .territory-dot {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border-radius: 50%;
    background: #f57f20;
    box-shadow: 0 0 0 5px #f57f2022;
}
.map-instruction::before {
    animation: map-invite 1.5s ease-out 3;
}
.map-greeting {
    transform: rotate(var(--guide-lean, 0deg));
    transform-origin: 50% 100%;
    transition: transform .3s ease-out;
}
.map-greeting p {
    animation: greeting-copy .6s ease-out both;
}
.is-celebrating .map-greeting img {
    animation: guide-celebrate .75s ease-out;
}
.is-celebrating .map-greeting p {
    background: #073f22;
    color: #fff;
}
.is-celebrating .map-state.is-selected {
    animation: territory-glow .8s ease-out 2;
}
.directory-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
}
.return-map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border: 1px solid #238b40;
    border-radius: 30px;
    background: #238b40;
    color: #fff;
    font-weight: 750;
    text-decoration: none;
    transition: background .2s, transform .2s;
}
.return-map:hover {
    background: #f57f20;
    color: #173321;
    border-color: #f57f20;
    transform: translateY(-2px);
}
.return-map:focus-visible {
    outline: 3px solid #f57f20;
    outline-offset: 4px;
}
.territory-result {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #edf6ee;
    border-left: 4px solid #f57f20;
    border-radius: 0 18px 18px 0;
    padding: 22px 24px;
    margin: -4px 0 28px;
}
.territory-result strong {
    color: #073f22;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
}
.territory-result p {
    margin: 5px 0 0;
    color: #335b42;
}
.territory-toast {
    position: fixed;
    z-index: 90;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 16px 22px;
    border-radius: 18px;
    background: #073f22;
    color: #fff;
    border: 1px solid #8dc63f;
    box-shadow: 0 14px 45px #073f2240;
    pointer-events: none;
    animation: territory-arrive .35s ease-out;
}
.territory-toast strong, .territory-toast span:not(.territory-emblem) {
    display: block;
}
.territory-toast strong {
    font-size: 1.15rem;
}
.territory-toast span:not(.territory-emblem) {
    font-size: .9rem;
    color: #deecd9;
}
.territory-emblem {
    display: grid;
    place-items: center;
    background: #f57f20;
    color: #073f22;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-weight: 900;
    flex-shrink: 0;
}
@keyframes map-invite {
    0% {
        box-shadow: 0 0 0 0 #f57f2066;
    }
    100% {
        box-shadow: 0 0 0 12px #f57f2000;
    }
}
@keyframes greeting-copy {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes guide-celebrate {
    0%,100% {
        transform: rotate(0);
    }
    30% {
        transform: translateY(-12px) rotate(-7deg);
    }
    65% {
        transform: translateY(-4px) rotate(5deg);
    }
}
@keyframes territory-glow {
    50% {
        fill: #ffb35f;
        stroke-width: 3;
    }
}
@keyframes territory-arrive {
    from {
        opacity: 0;
        translate: 0 15px;
    }
    to {
        opacity: 1;
        translate: 0 0;
    }
}
@media (max-width: 540px) {
    .map-instruction {
        font-size: .9rem;
        align-items: flex-start;
    }
    .map-instruction::before {
        margin-top: 5px;
    }
    .directory-actions {
        margin-top: 18px;
        justify-content: space-between;
    }
    .territory-result {
        padding: 18px;
        gap: 14px;
    }
    .territory-toast {
        bottom: 16px;
        padding: 12px 16px;
    }
    #mapa, #directorio {
        scroll-margin-top: 100px;
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }
    .map-instruction::before, .map-greeting p, .is-celebrating .map-greeting img, .is-celebrating .map-state.is-selected, .territory-toast {
        animation: none;
    }
    .map-greeting, .return-map {
        transition: none;
        transform: none;
    }
}

/* Direct branch access, attached to the state marker (not a street address). */
.branch-map-marker { cursor: pointer; }
.branch-map-marker line { stroke: #b6500a; stroke-width: 2; }
.branch-map-marker rect { fill: #fff; stroke: #f57f20; stroke-width: 2; }
.branch-map-marker text { fill: #073f22; font: 700 15px system-ui, sans-serif; }
.branch-map-marker:is(:hover, :focus-visible, .is-selected) rect { fill: #ffcf9a; stroke: #073f22; }
.branch-map-marker:focus-visible { outline: none; }
.branch-card:focus { outline: 3px solid #f57f20; outline-offset: 5px; }
.branch-contact-name { font-weight: 700; }
.branch-card { scroll-margin-top: 115px; }
.corporate-contacts { grid-template-columns: minmax(0, 1fr); }
