/* Nova home de busca — busca-medico.php */
.bb-busca-page {
    --bb-pink: #ff4d8d;
    --bb-pink-soft: #fff0f5;
    --bb-blue-soft: #ebf5ff;
    --bb-text: #1e2a3a;
    --bb-muted: #6b7280;
    padding-bottom: 8px;
}

.bb-busca-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 14px 2px;
    background: #fff;
    border-bottom: none;
    box-shadow: none;
}

.bb-busca-header__start {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.bb-busca-header__back {
    margin-left: 0;
}

.bb-busca-header__logo img {
    height: 26px;
    width: auto;
}

.bb-busca-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bb-busca-header__icon {
    position: relative;
    color: var(--bb-text);
    font-size: 1.35rem;
    line-height: 1;
}

.bb-busca-header__badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--bb-pink);
    border-radius: 50%;
    border: 2px solid #fff;
}

.bb-busca-header__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffb6c9, #ff4d8d);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.bb-busca-greeting {
    padding: 12px 16px 4px;
}

.bb-busca-greeting h1 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--bb-text);
    margin: 0 0 4px;
    line-height: 1.25;
}

.bb-busca-greeting p {
    margin: 0;
    color: var(--bb-muted);
    font-size: 0.95rem;
}

.bb-busca-search-wrap {
    padding: 12px 16px;
}

.bb-busca-search {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.bb-busca-search__field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding-left: 10px;
    flex-wrap: nowrap;
}

.bb-busca-badges {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 1;
    min-width: 0;
    max-width: 68%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.bb-busca-badges::-webkit-scrollbar {
    display: none;
}

.bb-busca-badges:empty {
    display: none;
}

.bb-busca-search input {
    flex: 1;
    border: none;
    padding: 14px 12px 14px 0;
    font-size: 0.95rem;
    outline: none;
    min-width: 72px;
    background: transparent;
}

.bb-busca-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 5px 6px 5px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.bb-busca-badge__icon {
    font-size: 0.75rem;
    line-height: 1;
}

.bb-busca-badge__label {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bb-busca-badge__clear {
    border: none;
    background: transparent;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
}

.bb-busca-badge__clear:hover {
    opacity: 1;
}

.bb-busca-badge[data-op="medicos"] {
    background: #ffe4ec;
    color: #c2185b;
}

.bb-busca-badge[data-op="medicos"] .bb-busca-badge__clear {
    color: #c2185b;
}

.bb-busca-badge[data-op="clinicas"] {
    background: #e0f2fe;
    color: #0369a1;
}

.bb-busca-badge[data-op="clinicas"] .bb-busca-badge__clear {
    color: #0369a1;
}

.bb-busca-badge[data-op="servicos"] {
    background: #ecfdf5;
    color: #047857;
}

.bb-busca-badge[data-op="servicos"] .bb-busca-badge__clear {
    color: #047857;
}

.bb-busca-badge[data-op="specialty"] {
    background: #f3e8ff;
    color: #7e22ce;
}

.bb-busca-badge[data-op="specialty"] .bb-busca-badge__clear {
    color: #7e22ce;
}

.bb-busca-search > button#bb-busca-submit {
    border: none;
    background: var(--bb-pink);
    color: #fff;
    width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    flex-shrink: 0;
}

.bb-busca-section {
    padding: 8px 16px 4px;
}

.bb-busca-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.bb-busca-section__head h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--bb-text);
}

.bb-busca-link {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}

.bb-specialty-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 8px;
}

.bb-specialty-grid.is-expanded .bb-specialty-item:nth-child(n+9) {
    display: flex;
}

.bb-specialty-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 4px 2px;
    cursor: pointer;
}

.bb-specialty-item:nth-child(n+9) {
    display: none;
}

.bb-specialty-grid.is-expanded .bb-specialty-item:nth-child(n+9) {
    display: flex;
}

.bb-specialty-item__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #444;
    transition: transform 0.15s ease;
}

.bb-specialty-item__icon i {
    font-size: 1.35rem;
    line-height: 1;
    color: inherit;
    pointer-events: none;
}

.bb-specialty-item__icon i::before {
    font-family: bootstrap-icons !important;
}

.bb-specialty-item:active .bb-specialty-item__icon {
    transform: scale(0.96);
}

.bb-specialty-item.is-active .bb-specialty-item__icon {
    box-shadow: 0 0 0 3px var(--bb-pink);
}

.bb-specialty-item__label {
    font-size: 0.68rem;
    line-height: 1.2;
    color: var(--bb-text);
    max-width: 72px;
    word-break: break-word;
}

.bb-specialty-feedback {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    color: #c62828;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.4;
}

#bb-specialty-section.is-error {
    outline: 2px solid rgba(229, 57, 53, 0.35);
    outline-offset: 4px;
    border-radius: 12px;
}

.bb-filter-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.bb-filter-card {
    position: relative;
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bb-filter-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.bb-filter-card--pink {
    background: var(--bb-pink-soft);
}

.bb-filter-card--blue {
    background: var(--bb-blue-soft);
}

.bb-filter-card.is-checked {
    border-color: var(--bb-pink);
    box-shadow: 0 4px 12px rgba(255, 77, 141, 0.15);
}

.bb-filter-card--blue.is-checked {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.bb-filter-card.bb-filter-card--error {
    border-color: #e53935 !important;
    box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.12);
}

.bb-filter-card i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 6px;
    color: var(--bb-text);
}

.bb-filter-card i::before {
    font-family: bootstrap-icons !important;
}

.bb-filter-card span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bb-text);
}

.bb-busca-filters-legacy {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.bb-busca-advanced {
    padding: 0 16px 12px;
}

.bb-convenio-field {
    display: none;
    margin-top: 10px;
    margin-bottom: 8px;
}

.bb-convenio-field.is-visible {
    display: block;
}

.bb-convenio-field label {
    display: block;
    margin: 0;
    font-size: 0.88rem;
    color: #202939;
    font-weight: 700;
}

.bb-convenio-field small {
    display: block;
    margin-top: 2px;
    color: var(--bb-muted);
    font-size: 0.78rem;
}

.bb-busca-advanced #wrap-combo-convenios {
    display: none;
}

.bb-busca-advanced #wrap-combo-convenios.is-visible {
    display: block;
}

#combo-convenios,
#priceRange {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: 48px;
    border-radius: 16px;
    border: 1px solid #e6ecf2;
    background-color: #fff;
    font-size: 0.9rem;
    color: #384252;
    padding: 0 42px 0 14px;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.05);
}

.bb-quick-filters {
    margin-top: 12px;
}

.bb-quick-filters__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bb-quick-filters__header span {
    font-size: 0.88rem;
    font-weight: 700;
    color: #202939;
}

#bb-clear-filters {
    border: none;
    background: transparent;
    color: #3478f6;
    font-size: 0.84rem;
    font-weight: 600;
}

.bb-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bb-filter-chip {
    border: 1px solid #e8edf3;
    background: #fff;
    color: #2f3b4c;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bb-filter-chip i {
    color: #ff4d8d;
    font-size: 0.84rem;
}

.bb-filter-chip.is-active {
    border-color: #ff4d8d;
    background: #fff3f8;
    color: #b51f61;
}

.bb-results-block {
    margin-top: 8px;
}

.bb-results-block__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--bb-text);
    margin: 16px 16px 8px;
}

#loadx-more,
#bb-buscar-btn {
    min-width: 260px;
    border: none;
    background: linear-gradient(90deg, #ff4d8d, #ff6aa0) !important;
    color: #fff !important;
    font-weight: 700;
}

.bb-results-block.is-hidden {
    display: none !important;
}

.bb-osm-results {
    padding: 0 16px 12px;
}

.bb-osm-results.is-hidden {
    display: none !important;
}

#bb-osm-map {
    width: 100%;
    height: 280px;
    border-radius: 16px;
    border: 1px solid #e6ecf2;
    overflow: hidden;
    background: #f3f4f6;
}

@media (min-width: 768px) {
    #bb-osm-map {
        height: 360px;
    }
}

.bb-busca-page .titulo-principal,
.bb-busca-page .toggles-row {
    display: none !important;
}

@media (max-width: 360px) {
    .bb-specialty-item__icon {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }
    .bb-specialty-item__label {
        font-size: 0.62rem;
    }
}

/* ===== TELA DE RESULTADOS FULLSCREEN ===== */
#bb-ver-resultados-wrap {
    padding: 16px;
    text-align: center;
}

#bb-ver-resultados-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    padding: 14px 24px;
    background: linear-gradient(90deg, #ff4d8d, #ff6aa0);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 77, 141, 0.35);
    letter-spacing: 0.3px;
}

#bb-ver-resultados-btn:active {
    transform: scale(0.97);
}

/* Tela fullscreen */
#bb-results-page {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9000;
    background: #f5f7fa;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#bb-results-page.bb-results-page-hidden {
    display: none !important;
}

body.bb-no-scroll {
    overflow: hidden !important;
}

/* Header */
#bb-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    background: #fff;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    padding-top: max(12px, env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 9700;
}

#bb-results-back {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #ff4d8d;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    width: 40px;
    text-align: left;
}

#bb-results-header-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    padding: 0 8px;
}

#bb-results-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
}

#bb-results-subtitle {
    font-size: 0.78rem;
    color: #888;
    margin-top: 1px;
}

.bb-results-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.bb-busca-header__avatar--sm {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

#bb-results-header .bb-busca-header__icon {
    font-size: 1.2rem;
    color: var(--bb-text, #1e2a3a);
}

/* Mapa — rola junto com os cards (não fica “preso” no topo) */
#bb-results-map-wrap {
    flex-shrink: 0;
    height: 36vh;
    min-height: 180px;
    max-height: 320px;
    position: relative;
}

#bb-results-map-wrap #bb-osm-map {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
}

/* Crédito Leaflet / OSM — menor e menos invasivo */
#bb-results-map-wrap .leaflet-control-attribution {
    font-size: 10px;
    line-height: 1.2;
    background: rgba(255, 255, 255, 0.78);
    max-width: 55%;
    padding: 2px 6px;
}

#bb-results-map-back {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #ff4d8d;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 7px 12px;
    box-shadow: 0 2px 8px rgba(30, 42, 58, 0.18);
    cursor: pointer;
}

#bb-results-back.is-hidden-by-overlay {
    visibility: hidden;
    pointer-events: none;
}

/* Cards — sem scroll próprio; sobe junto com o mapa */
#bb-results-cards-wrap {
    flex: 0 0 auto;
    overflow: visible;
    background: #f5f7fa;
    padding-bottom: 24px;
}

#bb-results-cards-wrap .cards-grid {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#bb-results-cards-wrap .bb-results-block {
    margin-top: 0;
}

.bb-results-section-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 12px 4px;
    padding: 6px 12px;
    background: #fff0f5;
    color: #ff4d8d;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-align: center;
}

.bb-results-section-bar span {
    display: block;
}

#bb-results-cards-wrap .bb-results-block:first-child .bb-results-section-bar {
    margin-top: 8px;
}

/* Botão load more dentro da tela */
#bb-results-load-more-wrap {
    text-align: center;
    padding: 12px 16px;
}

/* Esconder títulos antigos dentro da tela de resultados */
#bb-results-page .bb-results-block__title {
    display: none;
}

/* Esconder o mapa antigo (não fullscreen) */
.bb-osm-results {
    display: none !important;
}

@media (min-width: 600px) {
    #bb-results-map-wrap {
        height: 40vh;
        max-height: 360px;
    }
}

/* ===== CARD MODERNO (padrão mockup) ===== */
.bb-provider-card--modern {
    position: relative;
    height: auto !important;
    min-height: 0;
    margin: 0;
    padding: 10px 14px 12px;
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(30, 42, 58, 0.06);
    overflow: visible !important;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bb-provider-card--modern.is-map-selected {
    border-color: #ff4d8d;
    box-shadow: 0 0 0 3px rgba(255, 77, 141, 0.18), 0 8px 24px rgba(30, 42, 58, 0.08);
}

.bb-provider-card--modern .bb-card-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 28px;
    margin: 0 0 4px;
}

.bb-provider-card--modern .bb-card-fav {
    position: static;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.bb-provider-card--modern .bb-card-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-right: 0;
}

.bb-provider-card--modern .bb-provider-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    overflow: hidden;
    flex-shrink: 0;
    margin: 0;
    background: #eef2f6;
}

.bb-provider-card--modern .bb-provider-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bb-provider-card--modern .bb-card-info {
    flex: 1;
    min-width: 0;
}

.bb-provider-card--modern .bb-card-info-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.bb-provider-card--modern .bb-card-info-text {
    min-width: 0;
    flex: 1;
}

.bb-provider-card--modern .bb-card-price {
    flex-shrink: 0;
    text-align: right;
    margin-top: 2px;
    color: #20789a;
    font-weight: 800;
    font-size: 0.98rem;
    line-height: 1.15;
    white-space: nowrap;
}

.bb-provider-card--modern .bb-card-price small {
    display: block;
    margin-top: 1px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7f93a8;
}

.bb-provider-card--modern .bb-card-name {
    margin: 0 0 2px;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--bb-text, #1e2a3a);
}

.bb-provider-card--modern .bb-card-specialty {
    margin: 0 0 6px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #5b7c99;
}

.bb-provider-card--modern .bb-card-info-head .bb-card-rating {
    margin-bottom: 0;
}

.bb-provider-card--modern .bb-card-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #5b7c99;
}

.bb-provider-card--modern .bb-card-rating i {
    color: #f5b301;
    font-size: 0.85rem;
}

.bb-provider-card--modern .bb-card-meta {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0 0 4px;
    font-size: 0.8rem;
    color: #5b7c99;
    line-height: 1.35;
}

.bb-provider-card--modern .bb-card-meta i {
    margin-top: 1px;
    color: #7f93a8;
    font-size: 0.85rem;
}

.bb-provider-card--modern .bb-card-since,
.bb-provider-card--modern .bb-card-type {
    margin: 2px 0 0;
    font-size: 0.72rem;
    color: var(--bb-muted, #6b7280);
}

.bb-provider-card--modern .bb-card-avail {
    margin: 8px 0 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #5b7c99;
}

.bb-provider-card--modern .bb-card-avail.is-today {
    color: #12b5a8;
}

.bb-provider-card--modern .bb-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}

.bb-provider-card--modern .horarios-slots-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.bb-provider-card--modern .card-horario-slot-btn {
    border: none;
    background: #eaf3fb;
    color: #3d6f96;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.bb-provider-card--modern .card-horario-slot-btn:hover:not(:disabled) {
    background: #d7ebf8;
}

.bb-provider-card--modern .bb-card-slots-empty {
    font-size: 0.75rem;
    color: var(--bb-muted, #6b7280);
}

.bb-provider-card--modern .agendar-btn {
    flex-shrink: 0;
    border: none;
    background: linear-gradient(90deg, #ff4d8d, #ff6aa0);
    color: #fff;
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 77, 141, 0.28);
}

.bb-provider-card--modern .agendar-btn:active {
    transform: scale(0.97);
}

.bb-provider-card--modern.bb-provider-card-contact {
    min-height: 0;
}

.bb-provider-card--modern .bb-provider-card-footer {
    margin-top: 12px;
    padding: 10px 0 0;
    border-top: 1px solid #eef1f5;
    border-radius: 0;
}

#bb-results-cards-wrap .bb-provider-card--modern,
.cards-grid .bb-provider-card--modern {
    width: 100%;
    max-width: 100%;
}

.bb-provider-card--modern .bb-provider-card-avatar.js-open-ficha {
    border: none;
    padding: 0;
    cursor: pointer;
    display: block;
}

.bb-provider-card--modern .bb-provider-card-avatar.js-open-ficha:focus {
    outline: 2px solid #ff4d8d;
    outline-offset: 2px;
}

/* SweetAlert acima da ficha (z-index 9500) e da página de resultados (9000) */
.swal2-container {
    z-index: 20000 !important;
}

/* ===== FICHA DO PROFISSIONAL ===== */
.bb-ficha {
    position: fixed;
    top: var(--bb-overlay-top, 52px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9500;
    display: flex;
    flex-direction: column;
    background: #f7f9fc;
}

.bb-ficha.is-hidden {
    display: none !important;
}

.bb-ficha__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #eef1f5;
    flex-shrink: 0;
}

.bb-ficha__back,
.bb-ficha__fav {
    border: none;
    background: transparent;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1e2a3a;
    font-size: 1.4rem;
    padding: 0;
}

.bb-ficha__fav svg {
    display: block;
    width: 24px;
    height: 24px;
}

.bb-ficha__fav path {
    transition: fill 0.15s ease, stroke 0.15s ease;
    fill: none !important;
    stroke: #9aa8b8 !important;
    stroke-width: 1.8;
}

.bb-ficha__fav.active path {
    fill: #ff4d8d !important;
    stroke: #ff4d8d !important;
}

.bb-ficha__scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 12px;
}

.bb-ficha__footer {
    flex-shrink: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #eef1f5;
}

.bb-ficha__agendar {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 14px 18px;
    background: linear-gradient(90deg, #ff4d8d, #ff6aa0);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(255, 77, 141, 0.3);
}

.bb-ficha__hero {
    text-align: center;
    margin-bottom: 14px;
}

.bb-ficha__avatar-wrap {
    position: relative;
    width: 118px;
    height: 118px;
    margin: 4px auto 12px;
}

.bb-ficha__avatar {
    width: 118px;
    height: 118px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 8px 24px rgba(30, 42, 58, 0.12);
    background: #eef2f6;
}

.bb-ficha__avatar-badge {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ff4d8d;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 2px solid #fff;
}

.bb-ficha__avatar-badge.is-hidden {
    display: none !important;
}

.bb-ficha__name {
    margin: 0 0 4px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e2a3a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bb-ficha__verified {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff4d8d;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.bb-ficha__specialty {
    color: #6b7c8f;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.bb-ficha__crm {
    color: #8a97a8;
    font-size: 0.78rem;
}

.bb-ficha__rating-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 4px 16px rgba(30, 42, 58, 0.05);
    margin-bottom: 14px;
}

.bb-ficha__rating-score {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1e2a3a;
    font-size: 1.1rem;
}

.bb-ficha__rating-score i {
    color: #f5b301;
}

.bb-ficha__rating-count {
    color: #8a97a8;
    font-size: 0.78rem;
    margin-top: 2px;
}

.bb-ficha__rating-link {
    border: none;
    background: transparent;
    color: #3d6f96;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
}

.bb-ficha__quick {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.bb-ficha__quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    color: #1e2a3a;
    font-size: 0.72rem;
    line-height: 1.25;
    font-weight: 600;
}

.bb-ficha__quick-item i {
    font-size: 1.15rem;
    color: #3d6f96;
}

.bb-ficha__section {
    margin-bottom: 18px;
}

.bb-ficha__section.is-hidden {
    display: none !important;
}

.bb-ficha__section h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e2a3a;
}

.bb-ficha__location {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 10px;
}

.bb-ficha__address {
    color: #5b7c99;
    font-size: 0.88rem;
    line-height: 1.45;
}

.bb-ficha__map {
    height: 110px;
    border-radius: 14px;
    overflow: hidden;
    background: #e8eef5;
    border: 1px solid #e6ecf2;
}

.bb-ficha__location.is-routing {
    display: block;
}

.bb-ficha__location.is-routing .bb-ficha__address {
    margin-bottom: 10px;
}

.bb-ficha__map.is-routing {
    height: 260px;
    width: 100%;
}

.bb-ficha__route-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #eef4ff;
    color: #334155;
    font-size: 0.84rem;
    font-weight: 600;
}

.bb-ficha__route-info.is-hidden {
    display: none !important;
}

.bb-ficha__route-info i {
    color: #2563eb;
    font-size: 1.05rem;
    line-height: 1;
}

.bb-ficha__map-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a97a8;
    font-size: 0.78rem;
}

.bb-ficha__map-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.bb-ficha__map-actions.has-route {
    grid-template-columns: 1fr;
}

.bb-ficha__map-actions.has-route #bb-ficha-como-chegar,
#bb-ficha-como-chegar.is-hidden {
    display: none !important;
}

.bb-ficha__btn-primary,
.bb-ficha__btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.2;
    border: 1.5px solid transparent;
}

.bb-ficha__btn-primary {
    background: #3d6f96;
    color: #fff;
    border-color: #3d6f96;
}

.bb-ficha__btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.bb-ficha__btn-outline {
    background: #fff;
    color: #3d6f96;
    border-color: #3d6f96;
}

.bb-ficha__loading,
.bb-ficha__empty {
    text-align: center;
    color: #8a97a8;
    padding: 24px 8px;
    font-size: 0.9rem;
}

.bb-ficha__review {
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(30, 42, 58, 0.04);
}

.bb-ficha__review-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #1e2a3a;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.bb-ficha__review-top span {
    color: #8a97a8;
    font-size: 0.75rem;
}

.bb-ficha__review-stars {
    color: #f5b301;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.bb-ficha__review-title {
    font-weight: 700;
    color: #1e2a3a;
    font-size: 0.85rem;
}

.bb-ficha__review p {
    margin: 4px 0 0;
    color: #5b7c99;
    font-size: 0.84rem;
    line-height: 1.4;
}

/* ===== AGENDAMENTO (2 TELAS) ===== */
.bb-agendamento {
    position: fixed;
    top: var(--bb-overlay-top, 52px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9600;
    display: flex;
    flex-direction: column;
    background: #f7f9fc;
}

.bb-agendamento.is-hidden {
    display: none !important;
}

.bb-agendamento__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #e9eef4;
}

.bb-agendamento__header h2 {
    margin: 0;
    flex: 1;
    font-size: 1.08rem;
    color: #1e2a3a;
    font-weight: 700;
    text-align: left;
}

.bb-agendamento__close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    color: #4f657d;
    font-size: 1.3rem;
    line-height: 1;
}

.bb-agendamento__body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.bb-agendamento__doctor {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #fff;
    border: 1px solid #ebf0f5;
    border-radius: 14px;
    padding: 12px;
}

.bb-agendamento__doctor img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #eef2f6;
}

.bb-agendamento__doctor strong {
    display: block;
    color: #1e2a3a;
    font-size: 0.95rem;
}

.bb-agendamento__doctor small {
    display: block;
    color: #6d839a;
    font-size: 0.8rem;
}

.bb-agendamento__section {
    margin-top: 14px;
}

.bb-agendamento__section h3 {
    margin: 0 0 8px;
    color: #1e2a3a;
    font-size: 0.92rem;
    font-weight: 700;
}

.bb-agendamento__dates {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(66px, 1fr);
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.bb-agendamento__dates-nav {
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    gap: 8px;
    align-items: center;
}

.bb-agendamento__dates-arrow {
    border: 1px solid #dde6ef;
    background: #fff;
    color: #55708a;
    border-radius: 10px;
    height: 32px;
    width: 32px;
    cursor: pointer;
    font-size: 0.92rem;
    line-height: 1;
    padding: 0;
}

.bb-agendamento__date {
    border: 1px solid #dde6ef;
    background: #fff;
    border-radius: 12px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #4e6781;
    cursor: pointer;
}

.bb-agendamento__date.is-active {
    background: #ff4d8d;
    border-color: #ff4d8d;
    color: #fff;
}

.bb-agendamento__date.is-unavailable {
    background: #f1f3f6;
    border-color: #d9dfe6;
    color: #a0aab5;
}

.bb-agendamento__date.is-unavailable.is-active {
    background: #ff4d8d;
    border-color: #ff4d8d;
    color: #fff;
}

.bb-agendamento__date-week {
    font-size: 0.73rem;
}

.bb-agendamento__date-day {
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1;
}

.bb-agendamento__date-month {
    font-size: 0.72rem;
}

.bb-agendamento__slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.bb-agendamento__slot {
    border-radius: 10px;
    padding: 10px 4px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid #dfe8f1;
    background: #fff;
    color: #415a74;
    cursor: pointer;
}

.bb-agendamento__slot.is-available {
    background: #f1fbf4;
    border-color: #31b05f;
    color: #19813e;
}

.bb-agendamento__slot.is-unavailable {
    background: #f1f3f6;
    border-color: #d9dfe6;
    color: #a0aab5;
    cursor: not-allowed;
}

.bb-agendamento__slot.is-selected {
    background: #ff4d8d;
    border-color: #ff4d8d;
    color: #fff;
}

.bb-agendamento__tip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    background: #f1f3f5;
    color: #6b7280;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.82rem;
    line-height: 1.35;
}

.bb-agendamento__tip i {
    flex-shrink: 0;
    font-size: 1rem;
    color: #9ca3af;
    line-height: 1;
}

.bb-agendamento__tip i::before {
    font-family: bootstrap-icons !important;
}

.bb-agendamento__primary {
    width: 100%;
    margin-top: 14px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff4d8d, #ff6aa0);
    color: #fff;
    padding: 14px 16px;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
}

.bb-agendamento__primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.bb-agendamento__confirm-hero {
    text-align: center;
    margin: 8px 0 12px;
}

.bb-agendamento__confirm-hero h3 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    color: #1e2a3a;
}

.bb-agendamento__confirm-hero p {
    margin: 0;
    color: #60788f;
    font-size: 0.9rem;
}

.bb-agendamento__resume {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #ebf0f5;
    padding: 12px;
}

.bb-agendamento__resume div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f2f5f8;
}

.bb-agendamento__resume div:last-child {
    border-bottom: 0;
}

.bb-agendamento__resume strong {
    color: #55708a;
    font-size: 0.82rem;
}

.bb-agendamento__resume span {
    color: #1e2a3a;
    font-size: 0.83rem;
    text-align: right;
}

.bb-agendamento__resume-extra {
    align-items: flex-start;
}

.bb-agendamento__resume-extra span {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    max-width: 68%;
}

.bb-agendamento__maps,
.bb-agendamento__sala {
    color: #20789a;
    font-weight: 700;
    font-size: 0.78rem;
    text-decoration: none;
}

.bb-agendamento__sala-note {
    margin: 12px 0 8px;
    color: #60788f;
    font-size: 0.86rem;
}

.bb-agendamento__sala-btn {
    display: inline-flex;
    margin-top: 4px;
    color: #20789a;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
}

.bb-agendamento__terms {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4f6780;
    font-size: 0.85rem;
}

.bb-agendamento__error {
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    background: #ffebee;
    color: #c62828;
    font-size: 0.82rem;
}

.bb-agendamento__error.is-hidden {
    display: none !important;
}

.bb-agendamento__loading,
.bb-agendamento__error-panel {
    background: #fff;
    border: 1px solid #ebf0f5;
    border-radius: 12px;
    color: #70879e;
    padding: 16px;
    text-align: center;
}

@media (max-width: 360px) {
    .bb-ficha__location {
        grid-template-columns: 1fr;
    }
    .bb-ficha__map {
        height: 140px;
    }
    .bb-ficha__map.is-routing {
        height: 220px;
    }
}
