/* ═══════════════════════════════════════
   Birthday Widget — Gallery CSS
   ═══════════════════════════════════════ */

/* ── Container ── */
.bwg-wrap {
    background: #f4f1f8;
    border-radius: 14px;
    padding: 24px;
}

/* ── Top bar: Mês | Busca | Área ── */
.bwg-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

/* ── Busca ── */
.bwg-busca {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 16px;
    height: 44px;
    background: #fdf0f7;
    border: 1.5px solid #e8a0c8;
    border-radius: 10px;
}
.bwg-busca input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #c080a8;
    width: 100%;
}
.bwg-busca input::placeholder { color: #c080a8; }
.bwg-busca input:focus { outline: none !important; box-shadow: none !important; color: #333; }
.bwg-busca svg { flex-shrink: 0; }
.bwg-busca-icon { flex-shrink: 0; display: flex; align-items: center; color: #b5005b; }
.bwg-busca-icon svg { display: block; }
.bwg-busca-icon i { line-height: 1; }

/* ── Dropdowns ── */
.bwg-right-controls { display: flex; gap: 8px; align-items: center; }
.bwg-drop-wrap { position: relative; }
.bwg-drop-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
    height: 44px;
    background: #ffffff;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s;
}
.bwg-drop-btn:hover { border-color: #c0a0cc; }
.bwg-drop-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.bwg-drop-chevron { transition: transform 0.2s; }
.bwg-drop-wrap.open .bwg-drop-chevron { transform: rotate(180deg); }
.bwg-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: #ffffff;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    z-index: 99;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    display: none !important;
}
.bwg-drop-wrap.open .bwg-dropdown { display: block !important; }
.bwg-drop-search-wrap {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.bwg-drop-search {
    width: 100%;
    padding: 6px 10px;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    outline: none;
    background: #fff;
}
.bwg-drop-search:focus { border-color: #c0a0cc; }
.bwg-drop-opt { padding: 10px 16px; font-size: 14px; color: #555; cursor: pointer; }
.bwg-drop-opt:hover { background: #f9f5fb; color: #7b2d8b; }
.bwg-drop-opt.ativo { background: #7b2d8b; color: #ffffff; font-weight: 600; }

/* ── Título do mês ── */
.bwg-titulo-wrap {
    text-align: center;
    margin-bottom: 36px;
}
.bwg-titulo-mes {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.bwg-titulo-mes-prefix {
    color: #222;
}
.bwg-titulo-mes-destaque {
    color: #e8005a;
    font-style: italic;
    font-weight: 700;
}
.bwg-titulo-mes-icon {
    font-size: 26px;
    line-height: 1;
}
.bwg-titulo-mes-icon--img {
    display: inline-flex;
    align-items: center;
}
.bwg-titulo-mes-icon--img img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
}

/* ── Grid ── */
.bwg-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px 24px;
    padding-top: 20px;
}

/* ── Card outer ── */
.bwg-card-outer {
    position: relative;
    margin-top: 20px;
    min-width: 0;
}

/* ── Badge ── */
.bwg-card-badge {
    position: absolute;
    top: -16px;
    right: 24px;
    width: 54px;
    height: 54px;
    background: #F47216;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.30)) drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    z-index: 10;
}
.bwg-badge-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* ── Card ── */
.bwg-card {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 200px;
    overflow: visible;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.30), 0 1px 3px 1px rgba(0,0,0,0.15);
    border-bottom: 4px solid #7C1E7B;
    transition: transform 0.18s;
}
.bwg-card:hover { transform: translateY(-3px); }
.bwg-card-outer:hover .bwg-card-badge { transform: translateY(-3px); transition: transform 0.18s; }
.bwg-card-badge { transition: transform 0.18s; }

/* ── Pílula ── */
.bwg-card-pilula-wrap {
    position: absolute;
    left: 20px;
    top: 3.8rem;
    transform: translateY(-50%);
    z-index: 5;
}
.bwg-card-pilula {
    width: 80px;
    height: 160px;
    border-radius: 80px;
    background: linear-gradient(170deg, #d4b8e8 0%, #f0c0d8 100%);
    box-shadow: 0 6px 20px rgba(160,100,200,0.20);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    position: relative;
}
.bwg-card-pilula img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    image-rendering: high-quality;
}

/* ── Conteúdo ── */
.bwg-card-content {
    flex: 1;
    min-width: 0;
    padding: 20px 20px 16px 108px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bwg-card-top { display: flex; flex-direction: column; gap: 4px; }

.bwg-card-area {
    font-size: 13px;
    font-weight: 600;
    color: #e8005a;
    text-transform: uppercase;
    position: relative;
    left: 1rem;
}
.bwg-card-nome {
    font-size: 15px;
    font-weight: 600;
    color: #000;
    line-height: 1.3;
    position: relative;
    left: 1rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.bwg-divider {
    border: none;
    border-top: 1.5px dashed #ddd;
    margin: 10px 0;
}

.bwg-card-email {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #000;
    margin-bottom: 10px;
    position: relative;
    left: 0.8rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-transform: none;
}
.bwg-email-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.bwg-card-bottom { display: flex; align-items: center; gap: 8px; }

.bwg-card-aniversario { display: flex; flex-direction: column; min-width: 70px; }
.bwg-card-aniversario-label {
    font-size: 10px;
    color: rgba(0,0,0,0.45);
    text-transform: uppercase;
    font-weight: 300;
    position: relative;
    right: 4.5rem;
    bottom: 0.7rem;
}
.bwg-card-aniversario-data {
    color: #F47216;
    font-size: 18px;
    font-weight: 600;
    line-height: normal;
    position: relative;
    right: 4.6rem;
    bottom: 0.5rem;
}

.bwg-card-lider {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    position: relative;
    right: 3.5rem;
    bottom: 0.4rem;
}
.bwg-lider-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bwg-lider-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bwg-lider-label { font-size: 10px; color: #e8005a; font-weight: 700; }
.bwg-lider-nome { font-size: 11px; color: #e8005a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bwg-card-plus {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    background: #fff;
    text-decoration: none;
    padding: 0 0 2px 0;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.bwg-card-plus:hover {
    background: #7b2d8b;
    color: #fff;
    border-color: #7b2d8b;
    transform: scale(1.08);
}

.bwg-vazio {
    font-size: 14px;
    color: #aaa;
    padding: 24px 0;
    text-align: center;
    grid-column: 1 / -1;
}

/* ── Responsivo ── */
/* ═══════════════════════
   RESPONSIVO — Tablet (≤1024px)
═══════════════════════ */
/* ═══════════════════════════════
   RESPONSIVO — Tablet (≤1024px) — 2 colunas
═══════════════════════════════ */
@media (max-width: 1024px) {
    .bwg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 16px; }

    .bwg-card-badge { width: 38px; height: 38px; right: 12px; top: -12px; }
    .bwg-badge-img { width: 20px; height: 20px; }

    .bwg-card-pilula { width: 60px; height: 124px; border-radius: 50px; }
    .bwg-card-pilula-wrap { left: 12px; }
    .bwg-card-content { padding: 12px 12px 10px 80px; }

    .bwg-card-nome { font-size: 13px; left: 0.6rem; }
    .bwg-card-area { font-size: 11px; left: 0.6rem; }
    .bwg-card-email { font-size: 11px; left: 0.3rem; margin-bottom: 8px; }

    .bwg-card-aniversario-label { font-size: 9px; right: 2.5rem; bottom: 0.6rem; }
    .bwg-card-aniversario-data { font-size: 14px; right: 2.5rem; bottom: 0.4rem; }
    .bwg-card-lider { right: 1.8rem; bottom: 0.3rem; }
    .bwg-lider-label { font-size: 9px; }
    .bwg-lider-nome { font-size: 10px; }

    .bwg-card-plus { width: 26px; height: 26px; font-size: 16px; }
    .bwg-divider { margin: 7px 0; }

    .bwg-titulo-mes { font-size: 22px; }
}

/* ═══════════════════════════════
   RESPONSIVO — Mobile (≤767px) — 1 coluna
═══════════════════════════════ */
@media (max-width: 767px) {
    .bwg-wrap { padding: 14px; border-radius: 10px; }

    /* Top bar — busca em cima, dropdowns lado a lado */
    .bwg-top {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 20px;
        align-items: stretch;
    }
    .bwg-busca { min-width: 100%; order: 0; }
    .bwg-right-controls {
        width: 100%;
        flex-direction: row;
        gap: 8px;
    }
    .bwg-drop-wrap { flex: 1; }
    .bwg-drop-btn {
        width: 100%;
        justify-content: space-between;
        padding: 0 12px;
        height: 40px;
        font-size: 13px;
    }
    .bwg-dropdown { min-width: 100%; }

    /* Título */
    .bwg-titulo-mes { font-size: 18px; }
    .bwg-titulo-mes-icon { font-size: 18px; }
    .bwg-titulo-wrap { margin-bottom: 16px; }

    /* Grid — 1 coluna */
    .bwg-grid { grid-template-columns: minmax(0, 1fr); gap: 44px 0; }

    /* Card */
    .bwg-card { min-height: 155px; }

    /* Badge */
    .bwg-card-badge { width: 36px; height: 36px; right: 10px; top: -12px; }
    .bwg-badge-img { width: 18px; height: 18px; }

    /* Pílula */
    .bwg-card-pilula-wrap { left: 10px; }
    .bwg-card-pilula { width: 54px; height: 112px; border-radius: 44px; }

    /* Conteúdo */
    .bwg-card-content { padding: 12px 10px 10px 72px; }
    .bwg-card-nome { font-size: 12px; left: 0.3rem; }
    .bwg-card-area { font-size: 10px; left: 0.3rem; }
    .bwg-card-email { font-size: 10px; left: 0.2rem; margin-bottom: 8px; }
    .bwg-email-icon { width: 18px; height: 18px; font-size: 10px; }

    /* Data */
    .bwg-card-aniversario-label { font-size: 8px; right: 2rem; bottom: 0.5rem; }
    .bwg-card-aniversario-data { font-size: 12px; right: 2rem; bottom: 0.3rem; }

    /* Líder */
    .bwg-card-lider { right: 1.2rem; bottom: 0.3rem; gap: 4px; }
    .bwg-lider-label { font-size: 8px; }
    .bwg-lider-nome { font-size: 9px; }

    /* Divisor */
    .bwg-divider { margin: 6px 0; }

    /* Botão + */
    .bwg-card-plus { width: 24px; height: 24px; font-size: 14px; }
}

/* ── Tooltip do badge ── */
.bwg-badge-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #F47216;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 999px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    box-shadow: none;
    border: 1.5px solid rgba(255,255,255,0.3);
    z-index: 20;
    width: max-content;
}
.bwg-card-badge:hover .bwg-badge-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Dropdown scroll ── */
.bwg-drop-list {
    max-height: 200px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.bwg-drop-list::-webkit-scrollbar { width: 4px; }
.bwg-drop-list::-webkit-scrollbar-track { background: transparent; }
.bwg-drop-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* Botoes Aniversariantes / Integrantes */
.bwg-modo-btn {
    padding: 8px 20px;
    border-radius: 999px;
    border: 1.5px solid #DF007C;
    background: transparent;
    color: #DF007C;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
    flex-shrink: 0;
}
.bwg-modo-btn.bwg-modo-ativo {
    background: #DF007C;
    color: #fff;
}
.bwg-modo-btn:hover:not(.bwg-modo-ativo) {
    background: rgba(223,0,124,0.08);
}
.bwg-az-btn.bwg-az-ativo {
    border-color: #DF007C !important;
    background: #fff3f8 !important;
    color: #DF007C !important;
}

/* Ordem correta dos controles do topo */
.bwg-top .bwg-busca    { order: 1 !important; }
.bwg-top .bwg-modo-btn { order: 2 !important; }
.bwg-top .bwg-slot-mes { order: 3 !important; }
.bwg-top .bwg-drop-wrap { order: 4 !important; }

/* Mobile: botões e controles centralizados */
@media (max-width: 767px) {
    .bwg-modo-btn {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
    .bwg-az-btn {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
    .bwg-slot-mes {
        width: 100% !important;
    }
    .bwg-slot-mes .bwg-drop-btn,
    .bwg-slot-mes .bwg-az-btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Filtrar por: label + botões agrupados */
.bwg-filtrar-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
.bwg-filtrar-label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}
.bwg-filtrar-btns {
    display: flex;
    gap: 8px;
}

/* Responsivo tablet */
@media (max-width: 1024px) {
    .bwg-filtrar-group {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }
    .bwg-filtrar-label {
        text-align: center !important;
        width: 100% !important;
        white-space: nowrap !important;
    }
    .bwg-filtrar-btns {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }
}

/* Responsivo mobile */
@media (max-width: 767px) {
    .bwg-filtrar-group {
        width: 100% !important;
        align-items: flex-start !important;
    }
    .bwg-filtrar-label {
        white-space: nowrap !important;
    }
    .bwg-filtrar-btns {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        width: 100% !important;
    }
    .bwg-filtrar-btns .bwg-modo-btn {
        flex: 1 !important;
        text-align: center !important;
    }
}
