/* ============================================
   GOLDSTEP CAPITAL LTD - Branch Page Styles
   branch.css
   Depends on: base.css, pages.css
   ============================================ */


/* ============================================
   BRANCH STATS BAR
   ============================================ */
.branch-stats {
    background: var(--black);
    padding: 32px 0;
    border-top: 3px solid var(--gold-primary);
}

.branch-stats__grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.branch-stats__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 48px;
    text-align: center;
}

.branch-stats__number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.branch-stats__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-light);
    font-weight: 500;
}

.branch-stats__divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}


/* ============================================
   BRANCH FINDER — TWO-PANEL LAYOUT
   ============================================ */
.branch-finder {
    display: flex;
    height: 680px;
    overflow: hidden;
}


/* ============================================
   SIDEBAR
   ============================================ */
.branch-finder__sidebar {
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-right: 1px solid #e8e8e8;
    overflow: hidden;
    z-index: 10;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
}

/* Search bar */
.branch-sidebar__search {
    padding: 20px 20px 12px;
    border-bottom: 1px solid #f0f0f0;
    background: var(--white);
    flex-shrink: 0;
}

.branch-sidebar__search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.branch-sidebar__search-icon {
    position: absolute;
    left: 14px;
    color: var(--gray-light);
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1;
}

.branch-sidebar__search-input {
    width: 100%;
    padding: 11px 40px 11px 38px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--charcoal);
    background: var(--off-white);
    border: 1.5px solid #e8e8e8;
    border-radius: 6px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.branch-sidebar__search-input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
    background: var(--white);
}

.branch-sidebar__search-input::placeholder {
    color: var(--gray-light);
}

.branch-sidebar__search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--gray-light);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px;
    display: none;
    transition: color var(--transition-fast);
}

.branch-sidebar__search-clear:hover {
    color: var(--charcoal);
}

.branch-sidebar__search-clear.visible {
    display: block;
}

.branch-sidebar__count {
    font-size: 0.75rem;
    color: var(--gray);
    margin: 10px 0 0;
    padding-left: 2px;
}

/* Scrollable branch list */
.branch-sidebar__list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.branch-sidebar__list::-webkit-scrollbar {
    width: 5px;
}

.branch-sidebar__list::-webkit-scrollbar-track {
    background: var(--off-white);
}

.branch-sidebar__list::-webkit-scrollbar-thumb {
    background: var(--gray-lighter);
    border-radius: 3px;
}

.branch-sidebar__list::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* Branch card */
.branch-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background var(--transition-fast);
    position: relative;
}

.branch-card:last-child {
    border-bottom: none;
}

.branch-card:hover {
    background: #fdf9ee;
}

.branch-card.active {
    background: #fdf5d8;
    border-left: 3px solid var(--gold-primary);
}

.branch-card.active .branch-card__pin {
    background: var(--gold-primary);
    color: var(--white);
    transform: scale(1.1);
}

.branch-card.hidden {
    display: none;
}

/* Pin icon */
.branch-card__pin {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--off-white);
    border: 2px solid var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--gold-primary);
    transition: background var(--transition-fast), transform var(--transition-fast);
    margin-top: 2px;
}

/* Card info */
.branch-card__info {
    flex: 1;
    min-width: 0;
}

.branch-card__name {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-card__address {
    font-size: 0.78rem;
    color: var(--gray);
    line-height: 1.5;
}

/* Approximate location badge */
.branch-card__temp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #f5a623;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    cursor: help;
    flex-shrink: 0;
}

/* No results */
.branch-sidebar__empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--gray-light);
}

.branch-sidebar__empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
    color: var(--gray-lighter);
}

.branch-sidebar__empty p {
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
    color: var(--gray);
}


/* ============================================
   MAP PANEL
   ============================================ */
.branch-finder__map {
    flex: 1;
    position: relative;
    background: #e8e0d0;
}

#branch-map {
    width: 100%;
    height: 100%;
}

/* Loading overlay */
.branch-map__loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f0ebe0;
    z-index: 5;
    gap: 16px;
    transition: opacity 0.4s ease;
}

.branch-map__loading p {
    font-size: 0.875rem;
    color: var(--gray);
    margin: 0;
}

.branch-map__loading.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Spinner */
.branch-map__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-lighter);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: branchSpin 0.8s linear infinite;
}

@keyframes branchSpin {
    to { transform: rotate(360deg); }
}


/* ============================================
   LEAFLET OVERRIDES
   ============================================ */

/* Keep Leaflet map below sidebar */
.leaflet-container {
    font-family: var(--font-primary);
    z-index: 1;
}

/* Attribution bar */
.leaflet-control-attribution {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.85) !important;
}

/* Zoom controls */
.leaflet-control-zoom a {
    color: var(--charcoal) !important;
    border-color: #ddd !important;
}

.leaflet-control-zoom a:hover {
    background: var(--gold-primary) !important;
    color: var(--white) !important;
    border-color: var(--gold-primary) !important;
}

/* ============================================
   LEAFLET POPUP — Goldstep style
   ============================================ */
.goldstep-popup .leaflet-popup-content-wrapper {
    border-radius: 6px;
    border-left: 3px solid var(--gold-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 0;
    overflow: hidden;
    font-family: var(--font-primary);
}

.goldstep-popup .leaflet-popup-content {
    margin: 0;
    padding: 12px 16px;
    min-width: 180px;
}

.goldstep-popup .leaflet-popup-tip-container {
    margin-top: -1px;
}

.goldstep-popup__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 4px;
}

.goldstep-popup__address {
    font-size: 0.78rem;
    color: var(--gray);
    line-height: 1.5;
}

.goldstep-popup__temp {
    margin-top: 6px;
    font-size: 0.7rem;
    color: #f5a623;
    font-style: italic;
}

.goldstep-popup .leaflet-popup-close-button {
    color: var(--gray) !important;
    font-size: 18px !important;
    top: 6px !important;
    right: 8px !important;
}

.goldstep-popup .leaflet-popup-close-button:hover {
    color: var(--black) !important;
}


/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .branch-finder__sidebar {
        width: 300px;
    }

    .branch-stats__item {
        padding: 0 28px;
    }

    .branch-stats__number {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .branch-finder {
        flex-direction: column;
        height: auto;
    }

    .branch-finder__sidebar {
        width: 100%;
        height: 400px;
        border-right: none;
        border-bottom: 1px solid #e8e8e8;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
        order: 2;
    }

    .branch-finder__map {
        height: 340px;
        order: 1;
    }

    .branch-stats__grid {
        gap: 0;
    }

    .branch-stats__item {
        padding: 12px 20px;
        flex: 1 1 40%;
    }

    .branch-stats__divider {
        display: none;
    }

    .branch-stats__number {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .branch-stats__item {
        flex: 1 1 45%;
        padding: 10px 12px;
    }

    .branch-stats__number {
        font-size: 1.2rem;
    }

    .branch-stats__label {
        font-size: 0.7rem;
    }

    .branch-card {
        padding: 14px 16px;
    }
}