/*
 * rg-cards.css — Source of truth do componente .fg-card
 *
 * Fonte única para .fg-card em todos os contextos:
 *   home, busca, favoritos, similar, bairro, single-imovel.
 *
 * Duplicações de rg-home-v3.css removidas em 2026-06-07.
 * Toda mudança de card (.fg-card*, .fg-badge*, .fg-card__share*) vem aqui.
 *
 * @since 0.9.5
 */

/* --------------------------------------------------------------------------
   Animação do share menu (usada por .fg-card__share-menu)
   -------------------------------------------------------------------------- */

@keyframes rg-ac-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   .fg-card — wrapper principal
   -------------------------------------------------------------------------- */

.fg-card {
    background: #fff;
    border-radius: var(--rg-radius-sm);
    overflow: hidden;
    box-shadow: var(--rg-shadow-sm);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.fg-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--rg-shadow-lg);
}

/* --------------------------------------------------------------------------
   .fg-card__media — foto (background-image)
   -------------------------------------------------------------------------- */

.fg-card__media {
    aspect-ratio: 4/3;
    background: var(--rg-color-border) center / cover no-repeat;
    position: relative;
    overflow: hidden;
}

.fg-card:hover .fg-card__media {
    background-size: calc(100% * 1.04);
}

/* Media link sem decoração */
.fg-card__media-link {
    display: block;
    text-decoration: none;
    flex-shrink: 0;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   .fg-card__img — suporte futuro a <img> no lugar de background-image
   -------------------------------------------------------------------------- */

.fg-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 4/3;
    transition: transform .25s ease;
}

.fg-card:hover .fg-card__img {
    transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   .fg-card__actions — botões glassmorphism sobre a foto
   -------------------------------------------------------------------------- */

.fg-card__actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    gap: 6px;
}

button.fg-card__action-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,0.22) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.35) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .15s ease;
    padding: 0 !important;
    flex-shrink: 0;
    color: #fff;
    box-shadow: none !important;
    line-height: 1;
}

button.fg-card__action-btn:hover {
    background: rgba(255,255,255,0.38) !important;
    border-color: rgba(255,255,255,0.55) !important;
    transform: scale(1.08);
}

button.fg-card__action-btn.is-active {
    background: var(--rg-color-yellow) !important;
    border-color: var(--rg-color-yellow) !important;
    color: var(--rg-color-primary) !important;
}

button.fg-card__action-btn.is-active svg {
    stroke: var(--rg-color-primary) !important;
    fill: var(--rg-color-primary) !important;
}

button.fg-card__action-btn[data-action="fav"].is-active .rg-heart-path {
    fill: var(--rg-color-primary) !important;
    stroke: var(--rg-color-primary) !important;
}

button.fg-card__action-btn svg,
button.fg-card__action-btn img {
    display: block !important;
    width: 13px !important;
    height: 13px !important;
    max-width: 13px !important;
    flex-shrink: 0;
    stroke: #fff;
    fill: none;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   .fg-badge — badges de destaque e finalidade
   -------------------------------------------------------------------------- */

.fg-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: var(--rg-font-body);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.fg-badge--tl {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

.fg-badge--bl {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 2;
}

.fg-badge--tr {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.fg-badge--br {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;
}

.fg-badge--novidade {
    background: #00b707;
    color: #ffffff;
    border: 1px solid #00b707;
    border-radius: 9999px;
    padding: 3px 10px;
}

.fg-badge--novo        { background: var(--rg-color-yellow); color: var(--rg-color-primary); }
.fg-badge--exclusividade { background: var(--rg-color-primary); color: #fff; }

.fg-badge--fin-venda {
    background: var(--rg-color-yellow);
    color: var(--rg-color-primary);
    padding: 4px 10px;
    border-radius: 4px;
}

.fg-badge--fin-aluguel {
    background: rgba(0,5,81,0.85);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
}

/* Finalidade oculta por padrão (comportamento atual da home) */
.fg-badge--fin-venda,
.fg-badge--fin-aluguel { display: none !important; }

/* --------------------------------------------------------------------------
   .fg-card__body — link de navegação com corpo do card
   -------------------------------------------------------------------------- */

.fg-card__body {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 20px 20px;
    flex: 1;
}

.fg-card__price {
    font-family: var(--rg-font-heading);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.01em;
    color: var(--rg-color-primary);
    margin: 0;
    order: -1;
}

.fg-card__title {
    font-family: var(--rg-font-heading);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--rg-color-primary);
    margin: 0;
}

.fg-card__local {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--rg-color-text-muted);
    margin: 0;
    font-family: var(--rg-font-body);
}

.fg-card__local svg {
    flex-shrink: 0;
    color: var(--rg-color-text-muted);
    width: 11px !important;
    height: 13px !important;
    max-width: 11px !important;
}

.fg-card__specs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 0 0;
    border-top: 1px solid rgba(0,5,81,0.06);
    margin-top: auto;
    border-bottom: none;
}

.fg-card__specs span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--rg-color-text-muted);
    font-family: var(--rg-font-body);
}

.fg-card__icon { flex-shrink: 0; }
.fg-card__icon svg,
.fg-card__icon img {
    display: block !important;
    max-width: 16px !important;
    max-height: 16px !important;
    width: auto !important;
    height: auto !important;
}

/* Seta de navegação — oculta (layout sem footer) */
.fg-card__go { display: none; }
.fg-card__footer { display: none; }

/* --------------------------------------------------------------------------
   .fg-card__share-menu — popover de compartilhamento
   -------------------------------------------------------------------------- */

.fg-card__share-menu {
    position: absolute;
    top: 52px;
    right: 12px;
    z-index: 50;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,5,81,0.18), 0 2px 6px rgba(0,5,81,0.06);
    border: 1px solid var(--rg-color-border);
    padding: 8px;
    min-width: 180px;
    animation: rg-ac-in 180ms cubic-bezier(.2,.9,.3,1.2);
}

.fg-card__share-title {
    font-family: var(--rg-font-body);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--rg-color-text-muted);
    padding: 4px 8px 8px;
    margin: 0;
    border-bottom: 1px solid var(--rg-color-border);
}

.fg-card__share-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 6px;
    font-family: var(--rg-font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--rg-color-text);
    text-decoration: none;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
    width: 100%;
    border: none !important;
    background: transparent !important;
    text-align: left;
}

.fg-card__share-opt:hover {
    background: #FBF7DE !important;
    color: var(--rg-color-primary);
}

.fg-card__share-opt.is-active {
    color: var(--rg-color-green);
}

.fg-card__share-opt svg {
    flex-shrink: 0;
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    display: block !important;
    color: var(--rg-color-text-muted);
}

.fg-card__share-opt:first-of-type svg { color: #25D366; }

/* Override: tema/Elementor definem a { text-decoration: underline } com alta especificidade */
.fg-card .fg-card__body,
.fg-card .fg-card__media-link,
.fg-card .fg-card__share-opt,
.fg-card a {
  text-decoration: none !important;
}
