/*
    Nome do Arquivo : anuncio.css
    Projeto         : Pó de Ouro — Classificados Rurais
    Plataforma      : Softwareby (Low-Code)
    Descrição       : Estilos exclusivos da tela de Anúncio (detalhe)
    Upload          : /app/file/resource/css/{ID}
*/

/* ============================================================================
   ANÚNCIO — REFINAMENTO VISUAL
   Carregado após o podeouro.css (recurso 17). Regras sem @layer têm prioridade
   sobre as regras em camada, então tudo aqui funciona como override seguro.
   ========================================================================= */

/* ---------------------------------------------------------------------------
   BREADCRUMB — mais respiro e leveza
   ------------------------------------------------------------------------- */
.breadcrumb {
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
    font-size: var(--font-size-sm);
}

.breadcrumb a {
    color: var(--color-neutral-500);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--color-primary);
}

.breadcrumb__current {
    color: var(--color-neutral-700);
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
   GALERIA — moldura elegante e cantos mais suaves
   ------------------------------------------------------------------------- */
.gallery-wrapper {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.gallery-main-wrap,
.gallery-thumb {
    background: var(--color-neutral-200);
}

.gallery-expand-btn {
    font-size: var(--font-size-sm);
    padding: var(--space-2) var(--space-5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .22);
}

.gallery-photo-count {
    background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(6px);
}

.gallery-empty {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px dashed var(--color-neutral-200);
}

/* ---------------------------------------------------------------------------
   TÍTULO DO ANÚNCIO — hierarquia mais refinada
   ------------------------------------------------------------------------- */
.anuncio-title {
    letter-spacing: -0.01em;
}

/* Meta itens (local, área, visualizações) viram pills discretas */
.anuncio-meta-row {
    gap: var(--space-3);
}

.anuncio-meta-item {
    background: var(--color-neutral-100);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    color: var(--color-neutral-700);
    font-weight: 500;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.anuncio-meta-item i {
    color: var(--color-primary);
}

.anuncio-meta-item:hover {
    background: #EAF3EA;
    transform: translateY(-1px);
}

/* ---------------------------------------------------------------------------
   CARDS DE INFORMAÇÃO — contorno sutil + título com barra de destaque
   ------------------------------------------------------------------------- */
.property-info-card {
    border: 1px solid var(--color-neutral-200);
    box-shadow: var(--shadow-sm);
}

.info-card-title {
    position: relative;
    padding-left: var(--space-3);
    border-bottom: 1px solid var(--color-neutral-200);
    color: var(--color-neutral-900);
}

.info-card-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    /* Compensa o padding-bottom do título para centralizar a barra no texto */
    transform: translateY(calc(-50% - var(--space-2)));
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: var(--color-primary);
}

.info-card-title i {
    color: var(--color-primary);
}

/* ---------------------------------------------------------------------------
   ESPECIFICAÇÕES DA PROPRIEDADE — ícone em círculo + hover suave
   ------------------------------------------------------------------------- */
.property-spec {
    background: #fff;
    align-items: flex-start;
    padding: var(--space-4);
}

.property-spec__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 106, 47, .08);
    border-radius: var(--radius-md);
    color: var(--color-primary);
    font-size: 18px;
    margin-bottom: var(--space-1);
}

.property-spec:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ---------------------------------------------------------------------------
   TABELA DE ATRIBUTOS — linhas com respiro
   ------------------------------------------------------------------------- */
.attributes-table td {
    padding: var(--space-3) var(--space-5);
}

.attributes-table td:first-child {
    color: var(--color-neutral-500);
    font-weight: 500;
}

/* ---------------------------------------------------------------------------
   MAPA — moldura com sombra
   ------------------------------------------------------------------------- */
.map-wrapper {
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-neutral-200);
}

#mapa-anuncio,
#mapa-anuncio-detalhe {
    border-radius: var(--radius-lg) !important;
}

/* ---------------------------------------------------------------------------
   SIDEBAR — CARD DE PREÇO
   ------------------------------------------------------------------------- */
.sidebar-price-card {
    border-top: 4px solid var(--color-primary);
    box-shadow: var(--shadow-md);
}

.sidebar-title {
    letter-spacing: -0.01em;
}

.sidebar-price strong {
    color: var(--color-primary);
}

.sidebar-stats {
    color: var(--color-neutral-500);
}

.sidebar-stats i {
    color: var(--color-primary);
}

/* Botões Salvar / Compartilhar — cantos em pílula e transição suave */
.btn-action {
    border-radius: var(--radius-full);
    padding: var(--space-3) var(--space-4);
}

.btn-action--save {
    border-color: var(--color-neutral-200);
    color: var(--color-neutral-600);
}

.btn-action--save:hover,
.btn-action--save.is-saved {
    background: #FDF1F1;
    color: #C0392B;
    border-color: #E7B9B4;
}

.btn-action--share:hover {
    box-shadow: var(--shadow-md);
}

/* ---------------------------------------------------------------------------
   FORMULÁRIO "TENHO INTERESSE"
   ------------------------------------------------------------------------- */
.form-interest {
    border-top: 4px solid var(--color-accent);
    box-shadow: var(--shadow-md);
}

.form-group input,
.form-group textarea,
.form-group select {
    border-radius: var(--radius-md);
    background: #FBFBF9;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    background: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 47, .14);
}

/* ---------------------------------------------------------------------------
   ACESSIBILIDADE — respeita menos movimento
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {

    .property-spec,
    .anuncio-meta-item,
    .btn-action,
    .btn-whatsapp,
    .gallery-viewer__img {
        transition: none !important;
    }

    .property-spec:hover,
    .anuncio-meta-item:hover {
        transform: none !important;
    }
}

/* ============================================================================
   GALERIA — transições ricas
   ========================================================================= */

/* Ken Burns sutil na foto principal */
.gallery-main-img {
    animation: galleryKenBurns 16s ease-in-out infinite alternate;
}

@keyframes galleryKenBurns {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.07);
    }
}

/* Sombra interna (scrim) para dar contraste aos controles */
.gallery-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .22) 0%, transparent 32%);
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

/* Hover das miniaturas: leve brilho + zoom */
.gallery-thumb:hover img {
    transform: scale(1.08);
}

.gallery-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .28), transparent 55%);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.gallery-thumb:hover::after {
    opacity: 1;
}

/* Entrada da modal (grid) */
.gallery-modal.is-open .gallery-modal__header {
    animation: galleryFadeDown .3s ease both;
}

.gallery-modal.is-open .gallery-modal__grid {
    animation: galleryFadeUp .4s cubic-bezier(.22, 1, .36, 1) both;
}

.gallery-modal.is-open .gallery-modal__item {
    animation: galleryItemIn .5s cubic-bezier(.22, 1, .36, 1) both;
}

.gallery-modal.is-open .gallery-modal__item:nth-child(1) {
    animation-delay: .02s;
}

.gallery-modal.is-open .gallery-modal__item:nth-child(2) {
    animation-delay: .05s;
}

.gallery-modal.is-open .gallery-modal__item:nth-child(3) {
    animation-delay: .08s;
}

.gallery-modal.is-open .gallery-modal__item:nth-child(4) {
    animation-delay: .11s;
}

.gallery-modal.is-open .gallery-modal__item:nth-child(5) {
    animation-delay: .14s;
}

.gallery-modal.is-open .gallery-modal__item:nth-child(6) {
    animation-delay: .17s;
}

.gallery-modal.is-open .gallery-modal__item:nth-child(7) {
    animation-delay: .20s;
}

.gallery-modal.is-open .gallery-modal__item:nth-child(8) {
    animation-delay: .23s;
}

@keyframes galleryFadeDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes galleryFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes galleryItemIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Visualizador (lightbox) com fade */
.gallery-viewer.is-open {
    animation: viewerFade .22s ease both;
}

@keyframes viewerFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.gallery-viewer__img {
    transition: transform .35s cubic-bezier(.22, 1, .36, 1), opacity .25s ease;
}

/* ============================================================================
   WHATSAPP — destaque
   ========================================================================= */
.btn-whatsapp {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-full);
    padding: var(--space-3) var(--space-5);
    font-size: var(--font-size-md);
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    box-shadow: 0 6px 20px rgba(37, 211, 102, .35);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.btn-whatsapp::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 45%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
    animation: whatsShine 3.6s ease-in-out infinite;
}

@keyframes whatsShine {

    0%,
    55% {
        left: -80%;
    }

    100% {
        left: 130%;
    }
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #1EBE5A 0%, #0E6E5E 100%);
    box-shadow: 0 10px 28px rgba(37, 211, 102, .45);
}

/* ============================================================================
   FORMULÁRIO — organização
   ========================================================================= */
.form-interest__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.form-interest__grid .form-group {
    margin-bottom: var(--space-4);
}

.form-interest .form-interest__subtitle {
    margin-bottom: var(--space-5);
}

.form-interest .btn--accent {
    border-radius: var(--radius-full);
    padding: var(--space-3) var(--space-5);
    font-size: var(--font-size-md);
}

/* ============================================================================
   BARRA FIXA MOBILE — WhatsApp + Tenho Interesse
   ========================================================================= */
.anuncio-mobile-bar {
    display: none;
}

@media (max-width: 860px) {
    .anuncio-mobile-bar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9000;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-3);
        padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, .94);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--color-neutral-200);
        box-shadow: 0 -8px 28px rgba(0, 0, 0, .12);
    }

    .anuncio-mobile-bar__btn,
    .anuncio-mobile-bar__whats {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-2);
        padding: var(--space-3);
        border-radius: var(--radius-full);
        font-size: var(--font-size-sm);
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
    }

    .anuncio-mobile-bar__btn {
        background: var(--color-primary);
        color: #fff;
        border: none;
        cursor: pointer;
    }

    .anuncio-mobile-bar__whats {
        background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
        color: #fff;
    }

    body {
        padding-bottom: 74px;
    }
}

/* ============================================================================
   RESPONSIVO — refinos extras
   ========================================================================= */
@media (max-width: 480px) {
    .form-interest__grid {
        grid-template-columns: 1fr;
    }

    .anuncio-meta-item {
        font-size: var(--font-size-xs);
        padding: 5px 10px;
    }

    .property-info-card {
        padding: var(--space-4);
    }

    .anuncio-title {
        font-size: var(--font-size-xl);
    }
}

/* Respeita menos movimento nas novas animações */
@media (prefers-reduced-motion: reduce) {

    .gallery-main-img,
    .btn-whatsapp::after,
    .gallery-modal.is-open .gallery-modal__header,
    .gallery-modal.is-open .gallery-modal__grid,
    .gallery-modal.is-open .gallery-modal__item,
    .gallery-viewer.is-open {
        animation: none !important;
    }
}

/* ============================================================================
   SEÇÕES (Anúncios Similares / Mais anúncios) — espaçamento compacto
   As seções no detalhe do anúncio usam padding-block de --space-10 (64px),
   exagerado para uma tela de detalhe. Aqui reduzimos para um ritmo mais justo.
   ========================================================================= */
.anuncio-container~.section {
    padding-block: var(--space-6);
}

.anuncio-container~.section .section-header {
    margin-bottom: var(--space-5);
}

.anuncio-container~.section .section-subtitle {
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .anuncio-container~.section {
        padding-block: var(--space-5);
    }
}