/**
 * ============================================================
 * ROSCOE WISHLIST v3.5 — ESTILOS VISUAIS (GLASSMORPHISM LUXO)
 * ============================================================
 * Design refinado para imóveis de alto padrão.
 * Integração: Cards site-wide, Single, Drawer Lateral e Modais.
 */

/* -------------------------------------------------------------
 * 1. BOTÃO DE CORAÇÃO VAZADO NOS CARDS (TOP-LEFT) - HAIRLINE LUXO
 * ------------------------------------------------------------- */
.roscoe-wishlist-card-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 12;
    background: transparent !important;
    border: none !important;
    padding: 6px !important;
    margin: 0 !important;
    cursor: pointer;
    outline: none;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.roscoe-wishlist-card-btn:hover {
    transform: scale(1.12);
}

.roscoe-wishlist-card-btn:active {
    transform: scale(0.94);
}

.roscoe-wishlist-card-btn svg {
    width: 24px;
    height: 24px;
    display: block;
    fill: transparent;
    stroke: #ffffff;
    stroke-width: 1.3px;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0px 1.5px 3px rgba(0, 0, 0, 0.55));
    transition: fill 0.25s ease, stroke 0.25s ease, filter 0.25s ease;
}

/* Estado Favoritado no Card */
.roscoe-wishlist-card-btn.is-favorited svg {
    fill: #820000;
    stroke: #ebdfaf;
    stroke-width: 1.2px;
    filter: drop-shadow(0px 2px 7px rgba(130, 0, 0, 0.75));
    animation: roscoeHeartPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes roscoeHeartPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.30); }
    70% { transform: scale(0.94); }
    100% { transform: scale(1); }
}

/* -------------------------------------------------------------
 * 2. BOTÃO FLUTUANTE DA WISHLIST (CANTO INFERIOR) - DNA ROSCOE
 * ------------------------------------------------------------- */
#roscoe-wishlist-floating-btn {
    position: fixed;
    z-index: 99990;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #820000;
    border: 2px solid #ebdfaf;
    color: #ebdfaf;
    box-shadow: 0 4px 14px rgba(130, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

#roscoe-wishlist-floating-btn:hover,
#roscoe-wishlist-floating-btn:focus-visible {
    transform: translateY(-2px) scale(1.07);
    background: #960000;
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(130, 0, 0, 0.6), 0 0 12px rgba(235, 223, 175, 0.4);
}

#roscoe-wishlist-floating-btn:active {
    transform: scale(0.96);
}

#roscoe-wishlist-floating-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

#roscoe-wishlist-floating-btn:hover svg {
    transform: scale(1.08);
}

/* Badge Contador Dinâmico */
.roscoe-wishlist-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ebdfaf;
    color: #820000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 11px;
    font-weight: 800;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    border: 2px solid #820000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.roscoe-wishlist-badge.is-hidden {
    display: none;
}

.roscoe-wishlist-badge.is-bouncing {
    animation: roscoeBadgeBounce 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes roscoeBadgeBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.45); }
    100% { transform: scale(1); }
}

/* -------------------------------------------------------------
 * 3. BOTÃO SATÉLITE NA SINGLE DO IMÓVEL (MINI '+' DE 36PX)
 * ------------------------------------------------------------- */
#roscoe-wishlist-satellite-btn {
    position: fixed;
    z-index: 99990;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #820000;
    border: 2px solid #ebdfaf;
    color: #ebdfaf;
    box-shadow: 0 2px 8px rgba(130, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

#roscoe-wishlist-satellite-btn:hover,
#roscoe-wishlist-satellite-btn:focus-visible {
    transform: translateY(-2px) scale(1.08);
    background: #960000;
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(130, 0, 0, 0.5), 0 0 8px rgba(235, 223, 175, 0.35);
}

#roscoe-wishlist-satellite-btn:active {
    transform: scale(0.95);
}

#roscoe-wishlist-satellite-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

#roscoe-wishlist-satellite-btn:hover svg {
    transform: scale(1.10);
}

/* Estado Favoritado no Satélite da Single */
#roscoe-wishlist-satellite-btn.is-favorited {
    background: #ebdfaf;
    border-color: #ffffff;
    color: #820000;
    box-shadow: 0 2px 10px rgba(235, 223, 175, 0.45);
}

#roscoe-wishlist-satellite-btn .sat-glyph-plus {
    display: block;
}

#roscoe-wishlist-satellite-btn .sat-glyph-check {
    display: none;
}

#roscoe-wishlist-satellite-btn.is-favorited .sat-glyph-plus {
    display: none;
}

#roscoe-wishlist-satellite-btn.is-favorited .sat-glyph-check {
    display: block;
    stroke: #820000;
    stroke-width: 2.6px;
}

/* -------------------------------------------------------------
 * 4. IN-PAGE CTA NA PÁGINA DO IMÓVEL (OPCIONAL VIA ADMIN)
 * ------------------------------------------------------------- */
.roscoe-wishlist-inpage-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 6px;
    background: #fafafa;
    border: 1.5px solid #820000;
    color: #820000;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 8px 0;
}

.roscoe-wishlist-inpage-cta:hover {
    background: #820000;
    color: #ffffff;
}

.roscoe-wishlist-inpage-cta.is-favorited {
    background: #820000;
    color: #ffffff;
    border-color: #820000;
}

.roscoe-wishlist-inpage-cta svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

/* -------------------------------------------------------------
 * 5. DRAWER LATERAL (OFF-CANVAS 60FPS LUXO)
 * ------------------------------------------------------------- */
#roscoe-wishlist-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 100000000 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#roscoe-wishlist-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto !important;
}

#roscoe-wishlist-drawer {
    position: fixed;
    top: 0;
    height: 100vh;
    height: 100dvh;
    width: 90%;
    max-width: 440px;
    z-index: 100000001 !important;
    background: #121212;
    background: linear-gradient(180deg, #181818 0%, #101010 100%);
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
    color: #f1f5f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Posicionamento do Drawer (Esquerda ou Direita) */
#roscoe-wishlist-drawer.pos-left {
    left: 0;
    transform: translateX(-100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

#roscoe-wishlist-drawer.pos-right {
    right: 0;
    transform: translateX(100%);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

#roscoe-wishlist-drawer.is-open {
    transform: translateX(0) !important;
    visibility: visible;
    pointer-events: auto !important;
}

/* Header do Drawer */
.roscoe-drawer-header {
    background: rgba(14, 14, 14, 0.85);
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.roscoe-drawer-header-info h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.roscoe-drawer-header-info h3 span.badge-counter {
    background: #820000;
    color: #ebdfaf;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
}

.roscoe-drawer-header-info p {
    margin: 3px 0 0 0;
    font-size: 12px;
    color: #94a3b8;
}

.roscoe-drawer-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.roscoe-drawer-close-btn:hover {
    background: #820000;
    color: #ffffff;
}

/* Corpo com Rolagem dos Itens */
.roscoe-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.roscoe-drawer-body::-webkit-scrollbar {
    width: 6px;
}
.roscoe-drawer-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* Card do Imóvel no Drawer */
.roscoe-wishlist-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
    transition: all 0.2s ease;
}

.roscoe-wishlist-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(235, 223, 175, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.roscoe-wishlist-item:hover .roscoe-item-title {
    color: #ebdfaf;
}

.roscoe-wishlist-item.is-sold {
    opacity: 0.60;
    filter: grayscale(40%);
}

.roscoe-item-thumb {
    width: 82px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #222;
}

.roscoe-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.roscoe-item-info {
    flex: 1;
    min-width: 0;
}

.roscoe-item-code-tag {
    font-size: 10px;
    font-weight: 700;
    color: #ebdfaf;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.roscoe-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
}

.roscoe-item-title:hover {
    color: #ebdfaf;
}

.roscoe-item-condo {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.roscoe-item-price {
    font-size: 13px;
    font-weight: 800;
    color: #ebdfaf;
}

.roscoe-sold-badge {
    display: inline-block;
    background: #334155;
    color: #f1f5f9;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-top: 3px;
}

/* Botão Remover Individual */
.roscoe-item-remove-btn {
    background: none;
    border: none;
    color: #64748b;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    align-self: flex-start;
}

.roscoe-item-remove-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

/* Estado Vazio (Empty State) */
.roscoe-wishlist-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 50px 20px;
    gap: 14px;
}

.roscoe-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ebdfaf;
}

.roscoe-wishlist-empty-state h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.roscoe-wishlist-empty-state p {
    margin: 0;
    font-size: 12.5px;
    color: #94a3b8;
    max-width: 280px;
    line-height: 1.5;
}

.roscoe-btn-explore {
    background: #820000;
    color: #ffffff;
    text-decoration: none;
    padding: 9px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    margin-top: 8px;
    transition: all 0.2s ease;
}

.roscoe-btn-explore:hover {
    background: #9c0000;
    color: #ffffff;
}

/* Rodapé do Drawer com Ações de Conversão */
.roscoe-drawer-footer {
    background: rgba(14, 14, 14, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.roscoe-btn-consultor-wa {
    background: #25D366;
    color: #000000;
    border: none;
    padding: 11px 16px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.roscoe-btn-consultor-wa:hover {
    background: #22bf5b;
    color: #000000;
    transform: translateY(-1px);
}

.roscoe-drawer-footer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.roscoe-btn-action-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.roscoe-btn-action-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #ebdfaf;
    color: #ebdfaf;
}

.roscoe-drawer-clear-link {
    background: none;
    border: none;
    color: #64748b;
    font-size: 11.5px;
    cursor: pointer;
    text-align: center;
    margin-top: 2px;
    transition: color 0.15s ease;
}

.roscoe-drawer-clear-link:hover {
    color: #ef4444;
    text-decoration: underline;
}

/* -------------------------------------------------------------
 * 6. MODAL POPOVER DE COMPARTILHAMENTO & CAPTURA
 * ------------------------------------------------------------- */
#roscoe-wishlist-share-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000010 !important;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#roscoe-wishlist-share-modal.is-active {
    display: flex;
}

.roscoe-share-card {
    background: #181818;
    border: 1px solid rgba(235, 223, 175, 0.25);
    border-radius: 10px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    color: #f1f5f9;
}

.roscoe-share-header {
    background: rgba(14, 14, 14, 0.85);
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.roscoe-share-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.roscoe-share-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.roscoe-share-tab-pills {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 3px;
    gap: 4px;
}

.roscoe-share-tab-pill {
    flex: 1;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.roscoe-share-tab-pill.is-active {
    background: #820000;
    color: #ffffff;
}

.roscoe-share-input-group {
    display: flex;
    gap: 8px;
}

.roscoe-share-input {
    flex: 1;
    background: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 9px 12px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
}

.roscoe-share-input:focus {
    border-color: #ebdfaf;
}

.roscoe-share-submit-btn {
    background: #ebdfaf;
    color: #820000;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.roscoe-share-submit-btn:hover {
    background: #ffffff;
}

.roscoe-share-native-wa-btn {
    background: #25D366;
    color: #000;
    border: none;
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.roscoe-share-native-wa-btn:hover {
    background: #20b857;
    color: #000;
}

/* -------------------------------------------------------------
 * 7. NOTIFICAÇÃO TOAST FLUTUANTE
 * ------------------------------------------------------------- */
#roscoe-wishlist-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    z-index: 100000020 !important;
    background: rgba(14, 14, 14, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(235, 223, 175, 0.4);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 12.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#roscoe-wishlist-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

#roscoe-wishlist-toast button {
    background: #820000;
    color: #ebdfaf;
    border: none;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    margin-left: 4px;
}

/* -------------------------------------------------------------
 * 8. CONTENÇÃO DE SCROLL DO BODY & REGRAS DEFENSIVAS MOBILE
 * ------------------------------------------------------------- */
body.roscoe-wishlist-drawer-open {
    overflow: hidden !important;
    touch-action: none;
}

body.roscoe-wishlist-drawer-open #roscoe-wishlist-drawer {
    touch-action: pan-y;
}

/* Quando o Drawer estiver aberto, previne que qualquer barra inferior capture cliques acidentais */
body.roscoe-wishlist-drawer-open .mobile-cta-lead-bar,
body.roscoe-wishlist-drawer-open #whatsapp-btn-fixo,
body.roscoe-wishlist-drawer-open #ancora-btn-fixo {
    pointer-events: none !important;
}

@media (max-width: 480px) {
    #roscoe-wishlist-drawer {
        width: 92%;
        max-width: 400px;
    }
}
