/**
 * Stili Widget Elementor - AnnunciFunebri
 *
 * Stili base per i widget Elementor del plugin AnnunciFunebri.
 *
 * @package AnnunciFunebri
 * @since 4.7.6
 */

/* === WIDGET FUNERALE === */
.annfu-funerale-wrapper {
    padding: 20px;
    border-radius: 8px;
}

.annfu-funerale-titolo {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.annfu-funerale-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    font-size: 16px;
}

.annfu-funerale-icona {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}

.annfu-funerale-valore {
    flex: 1;
}

.annfu-funerale-link {
    display: inline-block;
    margin-top: 10px;
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

.annfu-funerale-link:hover {
    opacity: 0.7;
}

/* === WIDGET ROSARIO === */
.annfu-rosario-wrapper {
    padding: 20px;
    border-radius: 8px;
}

.annfu-rosario-titolo {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.annfu-rosario-info {
    margin: 10px 0;
    font-size: 16px;
}

.annfu-rosario-link {
    display: inline-block;
    margin-top: 10px;
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

.annfu-rosario-link:hover {
    opacity: 0.7;
}

/* === WIDGET SEPOLTURA === */
.annfu-sepoltura-wrapper {
    padding: 20px;
    border-radius: 8px;
}

.annfu-sepoltura-titolo {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.annfu-sepoltura-info {
    margin: 10px 0;
    font-size: 16px;
}

.annfu-sepoltura-link {
    display: inline-block;
    margin-top: 10px;
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

.annfu-sepoltura-link:hover {
    opacity: 0.7;
}

/* === WIDGET SOCIAL === */
.annfu-social-wrapper {
    padding: 20px;
}

.annfu-social-titolo {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.annfu-social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.annfu-social-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    transition: opacity 0.3s ease, transform 0.2s ease;
    font-size: 16px;
}

.annfu-social-button:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.annfu-social-icon {
    font-size: 1.2em;
}

.annfu-social-text {
    font-weight: 500;
}

/* Colori social */
.annfu-social-whatsapp {
    background-color: #25D366;
    color: white;
}

.annfu-social-facebook {
    background-color: #1877F2;
    color: white;
}

.annfu-social-twitter {
    background-color: #000000;
    color: white;
}

.annfu-social-email {
    background-color: #666;
    color: white;
}

.annfu-social-print {
    background-color: #FF9800;
    color: white;
}

.annfu-social-epigrafe {
    background-color: #795548;
    color: white;
}

/* Stile solo icone */
.annfu-social-style-icone .annfu-social-button {
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

/* Stile solo testo */
.annfu-social-style-testo .annfu-social-button {
    padding: 10px 15px;
}

/* === WIDGET NOME === */
.annfu-widget-nome {
    display: block;
}

.annfu-nome-titolo {
    font-size: 14px;
    margin-bottom: 5px;
}

.annfu-nome-principale {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    margin: 10px 0;
}

.annfu-nome-riga-aggiuntiva {
    font-size: 16px;
    line-height: 1.5;
    margin: 5px 0;
}

/* === WIDGET FOTO === */
.annfu-widget-foto {
    display: block;
}

.annfu-foto-immagine {
    display: inline-block;
    position: relative;
}

.annfu-foto-immagine img {
    display: block;
    max-width: 100%;
    height: auto;
}

.annfu-foto-immagine a {
    display: block;
    text-decoration: none;
}

/* === ANIMAZIONI FOTO (Sobrie e Rispettose) === */
.annfu-foto-animated {
    --annfu-anim-duration: 10s;
}

/* Animazione Continua: sempre attiva */
.annfu-foto-animated:not(.annfu-anim-on-hover) img {
    animation: var(--annfu-current-animation) var(--annfu-anim-duration) ease-in-out infinite;
}

/* Animazione Hover: si attiva al passaggio del mouse */
.annfu-foto-animated.annfu-anim-on-hover:hover img {
    animation: var(--annfu-current-animation) var(--annfu-anim-duration) ease-in-out infinite;
}

/* 1. Respirazione Delicata - scala impercettibile */
.annfu-foto-animated.annfu-anim-breathing {
    --annfu-current-animation: annfuBreathing;
}

@keyframes annfuBreathing {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* 2. Bagliore Soffuso - shadow delicato */
.annfu-foto-animated.annfu-anim-soft-glow {
    --annfu-current-animation: annfuSoftGlow;
}

@keyframes annfuSoftGlow {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 0px rgba(255, 255, 255, 0));
    }
    50% {
        filter: brightness(1.05) drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
    }
}

/* 3. Dissolvenza Leggera - opacità sottile */
.annfu-foto-animated.annfu-anim-gentle-fade {
    --annfu-current-animation: annfuGentleFade;
}

@keyframes annfuGentleFade {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

/* 4. Zoom Lento - ingrandimento progressivo */
.annfu-foto-animated.annfu-anim-slow-zoom {
    --annfu-current-animation: annfuSlowZoom;
    overflow: hidden;
}

@keyframes annfuSlowZoom {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 5. Vignetta Delicata - ombreggiatura ai bordi */
.annfu-foto-animated.annfu-anim-vignette {
    --annfu-current-animation: annfuVignette;
}

.annfu-foto-animated.annfu-anim-vignette::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes annfuVignette {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(0.95);
    }
}

.annfu-foto-animated.annfu-anim-vignette:not(.annfu-anim-on-hover)::after {
    animation: annfuVignettePulse var(--annfu-anim-duration) ease-in-out infinite;
}

.annfu-foto-animated.annfu-anim-vignette.annfu-anim-on-hover:hover::after {
    animation: annfuVignettePulse var(--annfu-anim-duration) ease-in-out infinite;
}

@keyframes annfuVignettePulse {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.4;
    }
}

/* Transizione smooth per animazioni hover */
.annfu-foto-animated.annfu-anim-on-hover img {
    transition: all 0.5s ease-in-out;
}

/* Pausa animazione quando si apre il lightbox */
.annfu-foto-animated.annfu-lightbox-open img {
    animation-play-state: paused;
}

/* === WIDGET TESTO PRINCIPALE === */
.annfu-widget-testo-principale {
    display: block;
}

.annfu-testo-contenuto {
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-line;
}

/* === WIDGET METEO CERIMONIE === */
.annfu-meteo-wrapper {
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.annfu-meteo-titolo {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.annfu-meteo-loading,
.annfu-meteo-error {
    text-align: center;
    padding: 20px;
    color: #666;
}

.annfu-meteo-error {
    color: #d32f2f;
}

.annfu-meteo-content {
    text-align: center;
}

.annfu-meteo-data {
    font-size: 14px;
    margin-bottom: 10px;
    color: #666;
}

.annfu-meteo-data-label {
    font-weight: 600;
    margin-right: 5px;
}

.annfu-meteo-icon {
    margin: 15px 0;
}

.annfu-meteo-icon img {
    max-width: 100px;
    height: auto;
    margin: 0 auto;
}

.annfu-meteo-descrizione {
    font-size: 16px;
    text-transform: capitalize;
    margin-bottom: 15px;
    font-weight: 500;
}

.annfu-meteo-temperatura {
    margin: 20px 0;
}

.annfu-meteo-temp-value {
    font-size: 48px;
    font-weight: 700;
    color: #333;
}

.annfu-meteo-temp-unit {
    font-size: 24px;
    font-weight: 300;
    color: #666;
}

.annfu-meteo-temp-minmax {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.annfu-meteo-umidita,
.annfu-meteo-vento {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

/* === WIDGET GALLERIA FOTO === */
.annfu-galleria-wrapper {
    width: 100%;
}

.annfu-galleria-titolo {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.annfu-galleria-grid {
    display: grid;
    gap: 10px;
}

.annfu-galleria-grid.annfu-galleria-colonne-2 {
    grid-template-columns: repeat(2, 1fr);
}

.annfu-galleria-grid.annfu-galleria-colonne-3 {
    grid-template-columns: repeat(3, 1fr);
}

.annfu-galleria-grid.annfu-galleria-colonne-4 {
    grid-template-columns: repeat(4, 1fr);
}

.annfu-galleria-grid.annfu-galleria-colonne-5 {
    grid-template-columns: repeat(5, 1fr);
}

.annfu-galleria-item {
    position: relative;
    overflow: hidden;
}

.annfu-galleria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    aspect-ratio: 1 / 1;
}

.annfu-galleria-item a {
    display: block;
    cursor: pointer;
}

.annfu-galleria-item:hover img {
    transform: scale(1.05);
}

.annfu-galleria-didascalia {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    font-size: 14px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.annfu-galleria-item:hover .annfu-galleria-didascalia {
    transform: translateY(0);
}

/* === WIDGET COLLAGE FOTO === */
.annfu-collage-wrapper {
    width: 100%;
}

.annfu-collage-titolo {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.annfu-collage-grid {
    display: grid;
    gap: 10px;
}

.annfu-collage-grid.annfu-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.annfu-collage-grid.annfu-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.annfu-collage-grid.annfu-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.annfu-collage-grid.annfu-cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

.annfu-collage-grid.annfu-cols-6 {
    grid-template-columns: repeat(6, 1fr);
}

.annfu-collage-item {
    position: relative;
    overflow: hidden;
}

.annfu-collage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* Aspect Ratios */
.annfu-collage-grid.annfu-ratio-1-1 .annfu-collage-item {
    aspect-ratio: 1 / 1;
}

.annfu-collage-grid.annfu-ratio-4-3 .annfu-collage-item {
    aspect-ratio: 4 / 3;
}

.annfu-collage-grid.annfu-ratio-16-9 .annfu-collage-item {
    aspect-ratio: 16 / 9;
}

.annfu-collage-grid.annfu-ratio-3-4 .annfu-collage-item {
    aspect-ratio: 3 / 4;
}

.annfu-collage-grid.annfu-ratio-auto .annfu-collage-item {
    aspect-ratio: auto;
}

/* Hover Effects */
.annfu-hover-zoom .annfu-collage-item:hover img {
    transform: scale(1.1);
}

.annfu-hover-overlay .annfu-collage-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.annfu-hover-overlay .annfu-collage-item:hover::after {
    opacity: 1;
}

.annfu-hover-grayscale .annfu-collage-item img {
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.annfu-hover-grayscale .annfu-collage-item:hover img {
    filter: grayscale(0%);
}

/* Masonry Layout */
.annfu-layout-masonry .annfu-collage-grid {
    display: grid;
    grid-auto-rows: 10px;
}

.annfu-layout-masonry .annfu-collage-item {
    grid-row: span 20;
}

/* Mosaico Layout - Disposizione artistica con altezze variabili */
.annfu-layout-mosaico .annfu-collage-grid {
    display: grid;
    grid-auto-rows: 100px;
    grid-auto-flow: dense;
}

.annfu-layout-mosaico .annfu-collage-item {
    position: relative;
}

.annfu-layout-mosaico .annfu-collage-item:nth-child(3n+1) {
    grid-row: span 2;
}

.annfu-layout-mosaico .annfu-collage-item:nth-child(4n+2) {
    grid-column: span 2;
}

.annfu-layout-mosaico .annfu-collage-item:nth-child(5n+3) {
    grid-row: span 3;
}

.annfu-layout-mosaico .annfu-collage-item:nth-child(6n+4) {
    grid-column: span 2;
    grid-row: span 2;
}

.annfu-layout-mosaico .annfu-collage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Caption */
.annfu-collage-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    font-size: 14px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.annfu-collage-item:hover .annfu-collage-caption {
    transform: translateY(0);
}

/* Slider */
.annfu-collage-slider {
    position: relative;
}

.annfu-slider-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.annfu-slider-item {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.annfu-slider-item img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

.annfu-slider-prev,
.annfu-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 40px;
    padding: 10px 20px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
}

.annfu-slider-prev:hover,
.annfu-slider-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.annfu-slider-prev {
    left: 10px;
}

.annfu-slider-next {
    right: 10px;
}

.annfu-slider-counter {
    text-align: center;
    padding: 15px 0;
    margin-top: 0;
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.annfu-slider-counter .current {
    color: #333;
    font-weight: 600;
}

/* Lightbox */
.annfu-lightbox-trigger {
    cursor: pointer;
}

/* === WIDGET RICERCA ANNUNCI === */
.annfu-ricerca-wrapper {
    width: 100%;
}

.annfu-ricerca-titolo {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Fix per ricerca avanzata - usiamo classi diverse dal template classico */
/* Il widget Elementor usa .annfu-elementor-ricerca invece di .annfu_annunci_filter_front */
/* per evitare conflitti con il CSS globale in trunk/css/style.css */

/* x-cloak nasconde gli elementi prima dell'inizializzazione Alpine */
.annfu-ricerca-wrapper .annfu-elementor-ricerca .front[x-cloak],
.annfu-ricerca-wrapper .annfu-elementor-ricerca .back[x-cloak] {
    display: none !important;
}

/* Contenitore risultati griglia */
.annfu-ricerca-wrapper .annfu-risultati-griglia {
    width: 100%;
    display: block;
    margin-top:1rem;
}

/* Widget Ricerca usa Bootstrap per la griglia */

.annfu-ricerca-wrapper .annfu_annunci_wrapper {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.annfu-ricerca-wrapper .annfu_annunci_wrapper:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-3px);
}

.annfu-ricerca-wrapper .annfu-risultato-foto-wrapper {
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.annfu-ricerca-wrapper.annfu-nome-in-foto .annfu-risultato-foto-wrapper {
    position: relative;
}

.annfu-ricerca-wrapper .annfu_annunci_foto {
    display: block;
    width: 100%;
}

.annfu-ricerca-wrapper .annfu_annunci_foto img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.annfu-ricerca-wrapper .annfu-risultato-contenuto {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.annfu-ricerca-wrapper .annfu_annunci_nominativo {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.3;
    color: #333;
}

.annfu-ricerca-wrapper .annfu_annunci_nominativo a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.annfu-ricerca-wrapper .annfu_annunci_nominativo a:hover {
    color: #0066cc;
}

.annfu-ricerca-wrapper .annfu_annunci_anni,
.annfu-ricerca-wrapper .annfu_annunci_paese,
.annfu-ricerca-wrapper .annfu_annunci_casa_funeraria {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

.annfu-ricerca-wrapper .annfu_annunci_casa_funeraria_no {
    color: #999;
}

.annfu-ricerca-wrapper .annfu_add_cordoglio {
    width: auto !important;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.annfu-ricerca-wrapper .annfu_add_cordoglio a {
    color: #0066cc;
    text-decoration: none;
    font-size: 13px;
    display: block;
    transition: color 0.3s ease;
}

.annfu-ricerca-wrapper .annfu_add_cordoglio a:hover {
    color: #0052a3;
}

/* Footer con contatore e paginazione */
.annfu-ricerca-wrapper .annfu-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 0 0;
    padding: 15px 0;
    border-top: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.annfu-ricerca-wrapper .annfu-risultati-info {
    font-size: 14px;
    color: #666;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

.annfu-ricerca-wrapper .annfu-paginazione {
    display: flex;
    gap: 5px;
    align-items: center;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.annfu-ricerca-wrapper .annfu-pag-btn {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
    margin: 0;
    line-height: 1;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    box-sizing: border-box;
}

.annfu-ricerca-wrapper .annfu-pag-btn:hover:not(:disabled) {
    background: #333;
    color: #fff;
    border-color: #333;
}

.annfu-ricerca-wrapper .annfu-pag-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.annfu-ricerca-wrapper .annfu-pag-info {
    font-size: 14px;
    color: #666;
}

/* Messaggi di stato */
.annfu-ricerca-wrapper .annfu-ricerca-loading,
.annfu-ricerca-wrapper .annfu-ricerca-vuota {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}


/* Responsive - Bootstrap gestisce il layout, manteniamo solo stili */
@media (max-width: 768px) {
    .annfu-ricerca-wrapper .annfu_annunci_nominativo {
        font-size: 16px;
    }

    .annfu-ricerca-wrapper .annfu-footer-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .annfu-ricerca-wrapper .annfu-risultati-info {
        width: 100%;
    }

    .annfu-ricerca-wrapper .annfu-paginazione {
        justify-content: center;
    }

    .annfu-ricerca-wrapper .annfu-pag-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .annfu-ricerca-wrapper .annfu_annunci_anni,
    .annfu-ricerca-wrapper .annfu_annunci_paese,
    .annfu-ricerca-wrapper .annfu_annunci_casa_funeraria {
        font-size: 13px;
    }
}

/* === FORM RICERCA SEMPLICE - INLINE === */
.annfu-ricerca-wrapper .annfu-form-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.annfu-ricerca-wrapper .annfu-search-input {
    flex: 1;
    min-width: 0;
}

.annfu-ricerca-wrapper .annfu-search-button {
    flex-shrink: 0;
    white-space: nowrap;
}

.annfu-ricerca-wrapper .annfu-toggle-ricerca {
    margin-top: 10px;
    text-align: center;
}

.annfu-ricerca-wrapper .annfu-ricerca-descrizione {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.6;
}

/* === PAGINAZIONE COMPLETA === */
.annfu-ricerca-wrapper .annfu-paginazione {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.annfu-ricerca-wrapper .annfu-pag-number {
    min-width: 40px;
    font-weight: 500;
}

.annfu-ricerca-wrapper .annfu-pag-current {
    background: #333 !important;
    color: #fff !important;
    cursor: default;
    font-weight: 600;
}

.annfu-ricerca-wrapper .annfu-pag-current:hover {
    background: #333 !important;
    color: #fff !important;
}

.annfu-ricerca-wrapper .annfu-pag-first,
.annfu-ricerca-wrapper .annfu-pag-last {
    font-weight: 600;
}

.annfu-ricerca-wrapper .annfu-pag-prev,
.annfu-ricerca-wrapper .annfu-pag-next {
    min-width: 40px;
}

/* === NOME DENTRO FOTO === */
.annfu-ricerca-wrapper.annfu-nome-in-foto .annfu-nome-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 70%, transparent 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    pointer-events: none;
}

.annfu-ricerca-wrapper.annfu-nome-in-foto .annfu_annunci_nominativo {
    font-size: 16px;
}

/* === LINK CORDOGLIO HOVER + ABSOLUTE === */
.annfu-ricerca-wrapper.annfu-cordoglio-hover .annfu_add_cordoglio {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 102, 204, 0.95);
    padding: 12px;
    margin: 0;
    border-top: none;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
    z-index: 10;
}

.annfu-ricerca-wrapper.annfu-cordoglio-hover .annfu_annunci_wrapper:hover .annfu_add_cordoglio {
    opacity: 1;
    transform: translateY(0);
}

.annfu-ricerca-wrapper.annfu-cordoglio-hover .annfu_add_cordoglio a {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.annfu-ricerca-wrapper.annfu-cordoglio-hover .annfu_add_cordoglio a:hover {
    color: white;
    text-decoration: none;
}

/* Quando cordoglio non è hover, stile normale */
.annfu-ricerca-wrapper:not(.annfu-cordoglio-hover) .annfu_add_cordoglio {
    position: relative;
    width: 100%;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

/* === CREDITI === */
.annfu-ricerca-wrapper .annfu_poweredby {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.annfu-ricerca-wrapper .annfu_poweredby a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.annfu-ricerca-wrapper .annfu_poweredby a:hover {
    color: #333;
    text-decoration: underline;
}

/* === LAYOUT ALTERNATIVI === */

/* === CARD ORIZZONTALI - NUOVE CLASSI DEDICATE === */

/* Griglia Bootstrap per widget Ricerca - Override Elementor */
.annfu-ricerca-wrapper .annfu-annunci-grid,
.annfu-ricerca-wrapper .annfu-annunci-grid.row,
.elementor-widget-annfu_ricerca .annfu-annunci-grid {
    margin-bottom: 20px;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    margin-left: -15px;
    margin-right: -15px;
    box-sizing: border-box;
    /* Reset variabili Elementor */
    --flex-direction: row !important;
    --flex-wrap: wrap !important;
}

/* Container card - stili base - Override Elementor */
.annfu-ricerca-wrapper .annfu_annunci_container,
.elementor-widget-annfu_ricerca .annfu_annunci_container {
    box-sizing: border-box !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-bottom: 20px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    display: block !important;
    /* Reset variabili Elementor */
    --container-widget-width: auto !important;
    --container-widget-flex-grow: 0 !important;
}

/* Mobile first: default full width */
.annfu-ricerca-wrapper .annfu_annunci_container[class*="col-"],
.elementor-widget-annfu_ricerca .annfu_annunci_container[class*="col-"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    flex-basis: 100% !important;
}

/* SM: >= 576px */
@media (min-width: 576px) {
    .annfu-ricerca-wrapper .annfu_annunci_container.col-sm-6,
    .elementor-widget-annfu_ricerca .annfu_annunci_container.col-sm-6 {
        flex: 0 0 50% !important;
        flex-basis: 50% !important;
        max-width: 50% !important;
        width: 50% !important;
    }
}

/* MD: >= 768px */
@media (min-width: 768px) {
    .annfu-ricerca-wrapper .annfu_annunci_container.col-md-4,
    .elementor-widget-annfu_ricerca .annfu_annunci_container.col-md-4 {
        flex: 0 0 33.333333% !important;
        flex-basis: 33.333333% !important;
        max-width: 33.333333% !important;
        width: 33.333333% !important;
    }
    .annfu-ricerca-wrapper .annfu_annunci_container.col-md-6,
    .elementor-widget-annfu_ricerca .annfu_annunci_container.col-md-6 {
        flex: 0 0 50% !important;
        flex-basis: 50% !important;
        max-width: 50% !important;
        width: 50% !important;
    }
}

/* LG: >= 992px */
@media (min-width: 992px) {
    .annfu-ricerca-wrapper .annfu_annunci_container.col-lg-3,
    .elementor-widget-annfu_ricerca .annfu_annunci_container.col-lg-3 {
        flex: 0 0 25% !important;
        flex-basis: 25% !important;
        max-width: 25% !important;
        width: 25% !important;
    }
    .annfu-ricerca-wrapper .annfu_annunci_container.col-lg-4,
    .elementor-widget-annfu_ricerca .annfu_annunci_container.col-lg-4 {
        flex: 0 0 33.333333% !important;
        flex-basis: 33.333333% !important;
        max-width: 33.333333% !important;
        width: 33.333333% !important;
    }
}

/* === STRUTTURA CARD === */
.annfu-hcard {
    display: flex;
    min-height: 200px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    position: relative;
}

.annfu-hcard:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Foto a sinistra - SEMPRE orizzontale su tablet/desktop */
.annfu-view-card_orizzontale_sx .annfu-hcard {
    flex-direction: row;
}

/* Foto a destra - SEMPRE orizzontale su tablet/desktop */
.annfu-view-card_orizzontale_dx .annfu-hcard {
    flex-direction: row-reverse;
}

/* === BADGES === */
.annfu-hcard-ribbon {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 5;
    color: white;
}

.annfu-hcard-ribbon-anniversary {
    background: #d4a574;
}

.annfu-hcard-ribbon-thanks {
    background: #6b8e23;
}

/* === FOTO === */
.annfu-hcard-photo {
    width: 160px;
    min-width: 160px;
    height: 200px;
    flex-shrink: 0;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
}

.annfu-hcard-photo a {
    display: block;
    width: 100%;
    height: 100%;
}

.annfu-hcard-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Nome overlay sulla foto */
.annfu-ricerca-wrapper.annfu-nome-in-foto .annfu-hcard-photo {
    position: relative;
}

.annfu-hcard-name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 70%, transparent 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

/* === CONTENUTO === */
.annfu-hcard-body {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Titolo/Nome */
.annfu-hcard-title {
    font-size: 16px;
    margin: 0 0 8px 0;
    line-height: 1.3;
    font-weight: 600;
    color: #333;
}

.annfu-hcard-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.annfu-hcard-title a:hover {
    color: #0066cc;
}

/* Età */
.annfu-hcard-age {
    font-size: 13px;
    margin: 0 0 4px 0;
    color: #666;
}

/* Località */
.annfu-hcard-location {
    font-size: 13px;
    margin: 0 0 4px 0;
    color: #333;
    font-weight: 500;
}

/* Casa funeraria */
.annfu-hcard-funeral {
    font-size: 12px;
    margin: 0 0 12px 0;
    color: #888;
    font-style: italic;
}

/* === AZIONE/PULSANTE CORDOGLIO === */
.annfu-hcard-action {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.annfu-hcard-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #0066cc;
    color: white;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: background 0.3s ease;
    line-height: 1.3;
}

.annfu-hcard-btn:hover {
    background: #0052a3;
    color: white;
    text-decoration: none;
}

/* === RESPONSIVE CARD ORIZZONTALI === */
@media (max-width: 767px) {
    /* Layout verticale SOLO su mobile */
    .annfu-view-card_orizzontale_sx .annfu-hcard,
    .annfu-view-card_orizzontale_dx .annfu-hcard {
        flex-direction: column;
        min-height: auto;
    }

    .annfu-hcard-photo {
        width: 100%;
        min-width: 100%;
        height: 250px;
    }

    .annfu-hcard-body {
        min-height: 150px;
    }
}

/* === VISUALIZZAZIONE LISTA COMPATTA === */
.annfu-ricerca-wrapper.annfu-view-lista .annfu-annunci-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.annfu-ricerca-wrapper.annfu-view-lista .annfu_annunci_container {
    width: 100%;
    margin-bottom: 0;
}

/* Lista Item - Layout principale */
.annfu-list-item {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    transition: background-color 0.2s ease;
    position: relative;
}

.annfu-list-item:hover {
    background-color: #fafafa;
}

.annfu-list-item:last-child {
    border-bottom: none;
}

/* Foto Lista - Rettangolare con aspect-ratio */
.annfu-list-photo {
    width: 100px;
    min-width: 100px;
    height: 130px;
    flex-shrink: 0;
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.annfu-list-photo a {
    display: block;
    width: 100%;
    height: 100%;
}

.annfu-list-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* Badge tipo annuncio sulla foto */
.annfu-list-badge {
    position: absolute;
    bottom: 5px;
    left: 5px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    line-height: 1.2;
}

.annfu-list-badge-anniversary {
    background: #d4a574;
}

.annfu-list-badge-thanks {
    background: #6b8e23;
}

/* Contenuto Lista */
.annfu-list-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    min-width: 0;
    gap: 20px;
}

/* Parte principale (nome, meta, extra) */
.annfu-list-main {
    flex: 1;
    min-width: 0;
}

/* Nome */
.annfu-list-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
    color: #222;
    text-align: left;
}

.annfu-list-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.annfu-list-name a:hover {
    color: #0066cc;
}

/* Seconda e terza riga (subito sotto il nome) */
.annfu-list-righe {
    margin-bottom: 8px;
    text-align: left;
}

.annfu-list-righe .annfu-seconda-riga,
.annfu-list-righe .annfu-terza-riga {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

/* Meta info (età, località) - sotto seconda/terza riga */
.annfu-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    text-align: left;
}

.annfu-list-meta i {
    color: #999;
    margin-right: 4px;
    width: 14px;
    text-align: center;
}

.annfu-list-age,
.annfu-list-location {
    display: inline-flex;
    align-items: center;
}

/* Casa funeraria */
.annfu-list-funeral {
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin-top: 6px;
}

/* Parte laterale (badge stats + pulsante) */
.annfu-list-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* Badge cordogli e fotocordogli */
.annfu-list-badges {
    display: flex;
    gap: 8px;
}

.annfu-list-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: default;
}

.annfu-list-stat i {
    font-size: 11px;
}

.annfu-list-stat-cordogli {
    background: #fce4ec;
    color: #c2185b;
}

.annfu-list-stat-foto {
    background: #e3f2fd;
    color: #1565c0;
}

/* Pulsante cordoglio */
.annfu-list-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: #0066cc;
    color: white;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
    text-align: center;
    line-height: 1.3;
}

.annfu-list-btn:hover {
    background: #0052a3;
    color: white;
    text-decoration: none;
}

/* Responsive Lista */
@media (max-width: 768px) {
    .annfu-list-item {
        flex-direction: row;
        padding: 12px;
        gap: 12px;
    }

    .annfu-list-photo {
        width: 80px;
        min-width: 80px;
        height: 100px;
    }

    .annfu-list-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 10px;
    }

    .annfu-list-main {
        width: 100%;
    }

    .annfu-list-name {
        font-size: 15px;
    }

    .annfu-list-meta {
        flex-direction: column;
        gap: 4px;
    }

    .annfu-list-side {
        flex-direction: row;
        align-items: center;
        width: 100%;
        justify-content: space-between;
    }

    .annfu-list-badges {
        order: 1;
    }

    .annfu-list-btn {
        order: 2;
        padding: 8px 14px;
        font-size: 12px;
    }

    .annfu-list-righe .annfu-seconda-riga,
    .annfu-list-righe .annfu-terza-riga {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .annfu-list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .annfu-list-photo {
        width: 100%;
        min-width: 100%;
        height: 180px;
    }

    .annfu-list-content {
        width: 100%;
        padding: 12px 0 0 0;
    }

    .annfu-list-side {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #eee;
    }

    .annfu-list-btn {
        flex: 1;
        justify-content: center;
    }
}

/* Footer specifico per vista lista */
.annfu-ricerca-wrapper.annfu-view-lista .annfu-footer-info {
    margin-top: 20px;
    padding: 20px 0;
}

.annfu-ricerca-form {
    margin-bottom: 30px;
}

.annfu-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.annfu-form-group {
    flex: 1;
    min-width: 150px;
}

.annfu-form-group-main {
    flex: 2;
}

.annfu-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.annfu-ricerca-input,
.annfu-ricerca-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.annfu-ricerca-input:focus,
.annfu-ricerca-select:focus {
    outline: none;
    border-color: #333;
}

.annfu-ricerca-submit {
    padding: 10px 30px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.annfu-ricerca-submit:hover {
    background-color: #555;
}

.annfu-ricerca-loading,
.annfu-ricerca-vuota {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.annfu-risultati-info {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Layout Lista */
.annfu-risultati-lista.annfu-layout-lista {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.annfu-layout-lista .annfu-risultato-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.annfu-layout-lista .annfu-risultato-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.annfu-layout-lista .annfu-risultato-link {
    display: flex;
    gap: 20px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
}

.annfu-layout-lista .annfu-risultato-foto {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
}

.annfu-layout-lista .annfu-risultato-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Layout Griglia */
.annfu-risultati-lista.annfu-layout-griglia {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.annfu-layout-griglia .annfu-risultato-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.annfu-layout-griglia .annfu-risultato-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.annfu-layout-griglia .annfu-risultato-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.annfu-layout-griglia .annfu-risultato-foto {
    width: 100%;
    height: 200px;
}

.annfu-layout-griglia .annfu-risultato-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.annfu-layout-griglia .annfu-risultato-contenuto {
    padding: 15px;
}

/* Layout Compatto */
.annfu-risultati-lista.annfu-layout-compatto {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.annfu-layout-compatto .annfu-risultato-item {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.annfu-layout-compatto .annfu-risultato-link {
    display: flex;
    gap: 15px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.annfu-layout-compatto .annfu-risultato-link:hover {
    background-color: #f5f5f5;
}

.annfu-layout-compatto .annfu-risultato-foto {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
}

.annfu-layout-compatto .annfu-risultato-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Risultato Contenuto */
.annfu-risultato-contenuto {
    flex: 1;
}

.annfu-risultato-nome {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #333;
}

.annfu-risultato-info {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

.annfu-risultato-meta {
    font-size: 13px;
    color: #999;
    margin-top: 8px;
}

.annfu-risultato-tipo {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background-color: #f0f0f0;
    border-radius: 3px;
    font-size: 12px;
    text-transform: capitalize;
}

/* Paginazione */
.annfu-paginazione {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px 0;
}

.annfu-pag-btn {
    padding: 10px 20px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.annfu-pag-btn:hover:not(:disabled) {
    background-color: #555;
}

.annfu-pag-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.annfu-pag-info {
    font-size: 14px;
    color: #666;
}

/* === WIDGET LISTA CORDOGLI - NUOVE MODALITÀ === */
/* Timeline */
.annfu-display-timeline {
    position: relative;
    padding-left: 50px;
}

.annfu-display-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.annfu-cordoglio-timeline {
    position: relative;
    margin-bottom: 30px;
}

.annfu-timeline-marker {
    position: absolute;
    left: -38px;
    top: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #e0e0e0;
}

.annfu-timeline-content {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #333;
}

.annfu-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.annfu-timeline-body {
    color: #666;
    line-height: 1.6;
}

/* Card */
.annfu-display-card .annfu-cordoglio-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.annfu-display-card .annfu-cordoglio-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.annfu-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.annfu-card-body {
    color: #666;
    line-height: 1.6;
}

/* Compatto */
.annfu-display-compatto .annfu-cordoglio-compatto {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.8;
}

.annfu-cordoglio-compatto .annfu-cordoglio-nome {
    font-weight: 600;
    color: #333;
}

.annfu-cordoglio-compatto .annfu-cordoglio-data {
    color: #999;
    font-size: 12px;
}

.annfu-cordoglio-compatto .annfu-cordoglio-separatore {
    margin: 0 5px;
    color: #999;
}

.annfu-cordoglio-compatto .annfu-cordoglio-messaggio {
    color: #666;
}

/* Partecipazioni subtitle */
.annfu-partecipazioni-subtitle {
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 15px 0;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* === MASONRY LAYOUT === */
.annfu-display-masonry {
    column-count: 3;
    column-gap: 20px;
}

.annfu-cordoglio-masonry-item {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}

.annfu-masonry-content {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.annfu-masonry-content:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.annfu-masonry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 8px;
}

.annfu-masonry-header .annfu-cordoglio-nome {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    flex: 1;
    min-width: 120px;
}

.annfu-masonry-header .annfu-cordoglio-data {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
}

.annfu-masonry-body {
    color: #666;
    line-height: 1.7;
    font-size: 14px;
}

.annfu-masonry-body .annfu-cordoglio-messaggio {
    margin: 0;
    word-wrap: break-word;
}

/* Responsive masonry */
@media (max-width: 1200px) {
    .annfu-display-masonry {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .annfu-display-masonry {
        column-count: 1;
    }

    .annfu-masonry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* === WIDGET LISTA ANNUNCI === */
.annfu-lista-annunci-wrapper {
    width: 100%;
}

.annfu-lista-annunci-titolo {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

.annfu-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Grid per widget Lista Annunci */
.annfu-lista-annunci-griglia .annfu-annunci-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.annfu-annuncio-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.annfu-annuncio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.annfu-annuncio-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.annfu-annuncio-foto {
    position: relative;
    width: 100%;
}

.annfu-foto-img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.annfu-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.annfu-badge-anniversario {
    background-color: #2196F3;
}

.annfu-badge-ringraziamento {
    background-color: #4CAF50;
}

.annfu-annuncio-contenuto {
    padding: 15px;
}

.annfu-annuncio-nome {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}

.annfu-annuncio-date {
    font-size: 14px;
    color: #666;
}

/* Carousel */
.annfu-carousel {
    position: relative;
}

.annfu-carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.annfu-carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
}

.annfu-carousel-slide {
    width: 100%;
    flex-shrink: 0;
}

.annfu-carousel-slide-grid {
    display: grid;
    grid-template-columns: repeat(var(--annunci-per-slide, 3), 1fr);
    gap: 20px;
    padding: 0 50px;
}

@media (max-width: 576px) {
    .annfu-carousel-slide-grid {
        padding: 0 40px;
    }
}

.annfu-carousel-prev,
.annfu-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 30px;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.annfu-carousel-prev:hover,
.annfu-carousel-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.annfu-carousel-prev {
    left: 10px;
}

.annfu-carousel-next {
    right: 10px;
}

/* === WIDGET FORM CORDOGLIO === */
.annfu_form_cordoglio_wrapper {
    padding: 20px;
}

.annfu-form-cordoglio-titolo {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.annfu-form-cordoglio-descrizione {
    font-size: 15px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.annfu-form-cordoglio-descrizione .annfu_cordoglio_gratis,
.annfu-form-cordoglio-descrizione .annfu_cordsogli_stampati {
    display: block;
    margin-bottom: 5px;
}

.annfu_form_cordoglio_wrapper p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.annfu_testi,
.annfu_privacy {
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
}

.annfu_testi:hover,
.annfu_privacy:hover {
    opacity: 0.8;
}

#annfu_form_cordoglio {
    margin-top: 20px;
}

.annfu_error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
}

.annfu_error:not(:empty) {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #0073aa;
}

/* Uniforma l'altezza delle select agli input text */
select.form-control {
    height: 42px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 30px;
}

textarea.form-control {
    min-height: 100px;
    height: auto;
    resize: vertical;
}

.annfu_checkbox {
    margin-right: 8px;
}

.annfu_label_privacy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.annfu_facoltativo {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.5;
}

.annfu_invio {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.annfu_invio:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.annfu_success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
}

.annfu_none {
    display: none;
}

.annfu_grazie {
    padding: 20px;
    text-align: center;
}

.annfu_grazie h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #155724;
}

.annfu_grazie p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.annfu_grazie a {
    color: #0073aa;
    text-decoration: underline;
}

.annfu_grazie a:hover {
    opacity: 0.8;
}

/* === WIDGET FORM FOTO CORDOGLIO === */
.annfu_form_foto_cordoglio_wrapper {
    padding: 20px;
}

.annfu-form-foto-titolo {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.annfu-form-foto-descrizione {
    font-size: 15px;
    margin-bottom: 15px;
    line-height: 1.6;
    text-align: center;
}

.annfu_form_foto_cordoglio_wrapper .form-group {
    margin-bottom: 15px;
}

.dropzone {
    border: 2px dashed #0073aa;
    border-radius: 4px;
    background-color: #f9f9f9;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dropzone:hover {
    border-color: #005a87;
    background-color: #f0f0f0;
}

.dropzone.dz-drag-hover {
    border-color: #005a87;
    background-color: #e8f4f8;
}

.dropzone .dz-message {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.dropzone .dz-preview {
    position: relative;
    display: inline-block;
    margin: 10px;
    vertical-align: top;
}

.dropzone .dz-preview .dz-image {
    width: 120px;
    height: 120px;
    border-radius: 4px;
    overflow: hidden;
}

.dropzone .dz-preview .dz-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dropzone .dz-preview .dz-details {
    padding: 5px;
    font-size: 12px;
    color: #666;
}

.dropzone .dz-preview .dz-progress {
    height: 5px;
    background-color: #ddd;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.dropzone .dz-preview .dz-progress .dz-upload {
    height: 100%;
    background-color: #0073aa;
    transition: width 0.3s ease;
}

.dropzone .dz-preview .dz-error-message {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #f8d7da;
    color: #721c24;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    margin-top: 5px;
}

.dropzone .dz-preview .dz-success-mark,
.dropzone .dz-preview .dz-error-mark {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.dropzone .dz-preview .dz-success-mark {
    color: #28a745;
}

.dropzone .dz-preview .dz-error-mark {
    color: #dc3545;
}

.dropzone .dz-preview .dz-remove {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.dropzone .dz-preview .dz-remove:hover {
    background-color: rgba(220, 53, 69, 1);
}

.dz-didascalia {
    margin-top: 10px;
    text-align: center;
}

.dz-didascalia small {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    display: block;
}

#annfu_foto_slug {
    display: none;
}

#annfu_foto_invio:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#annfu_foto_errori {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
}

#annfu_foto_errori:not(:empty) {
    display: block;
}

#annfu_foto_successo {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
}

/* === WIDGET FORM FIORI === */
/* Gli stili principali del form fiori sono già in css/style.css */
/* Bootstrap grid è già caricato da css/bootstrap3-annfu.css o css/bootstrap4-annfu.css */
/* Qui manteniamo solo gli stili specifici per l'integrazione Elementor */

.annfu_form_fiori_wrapper {
    padding: 20px;
}

/* Titolo e descrizione controllabili da Elementor */
.annfu-form-fiori-titolo {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.annfu-form-fiori-descrizione {
    font-size: 15px;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Fix layout pulsante Procedi - evita che vada sotto la textarea */
.annfu_ordine_step1 .d-flex.justify-content-end {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    clear: both;
    position: relative;
    z-index: 20;
}

#annfu_procedi {
    position: relative;
    z-index: 10;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .annfu-nome-principale {
        font-size: 20px;
    }

    .annfu-nome-riga-aggiuntiva {
        font-size: 14px;
    }

    .annfu-testo-contenuto {
        font-size: 14px;
    }

    /* Meteo */
    .annfu-meteo-temp-value {
        font-size: 36px;
    }

    /* Galleria */
    .annfu-galleria-grid.annfu-galleria-colonne-3,
    .annfu-galleria-grid.annfu-galleria-colonne-4,
    .annfu-galleria-grid.annfu-galleria-colonne-5 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Collage */
    .annfu-collage-grid.annfu-cols-3,
    .annfu-collage-grid.annfu-cols-4,
    .annfu-collage-grid.annfu-cols-5,
    .annfu-collage-grid.annfu-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Mosaico - su mobile semplifica il layout */
    .annfu-layout-mosaico .annfu-collage-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 150px;
    }

    .annfu-layout-mosaico .annfu-collage-item:nth-child(3n+1),
    .annfu-layout-mosaico .annfu-collage-item:nth-child(5n+3) {
        grid-row: span 1;
    }

    .annfu-layout-mosaico .annfu-collage-item:nth-child(6n+4) {
        grid-column: span 1;
        grid-row: span 1;
    }

    /* Ricerca */
    .annfu-form-row {
        flex-direction: column;
    }

    .annfu-form-group,
    .annfu-form-group-main {
        width: 100%;
    }

    .annfu-risultati-lista.annfu-layout-griglia {
        grid-template-columns: 1fr;
    }

    .annfu-layout-lista .annfu-risultato-link {
        flex-direction: column;
    }

    /* Timeline */
    .annfu-display-timeline {
        padding-left: 30px;
    }

    .annfu-timeline-marker {
        left: -23px;
    }

    /* Annunci */
    .annfu-lista-annunci-griglia .annfu-annunci-grid {
        grid-template-columns: 1fr;
    }
}

/* === WIDGET TABS ANNUNCIO (NESTED) === */

/* Messaggio di avviso Nested Elements non attivo */
.annfu-tabs-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
}

.annfu-tabs-warning h4 {
    margin: 0 0 10px 0;
    color: #856404;
}

.annfu-tabs-warning p {
    margin: 0;
    color: #856404;
}

.annfu-tabs-warning p:last-child {
    margin-top: 10px;
}

/* Tab nascosto condizionalmente */
.annfu-tab-hidden {
    display: none !important;
}

/* Classe per gestire la visibilità dinamica dei tab */
[data-annfu-tab-type] {
    transition: opacity 0.3s ease;
}

/* Stili per i tab quando sono nascosti */
.annfu-tabs-annuncio .e-n-tabs-heading .e-n-tab-title.annfu-tab-hidden,
.annfu-tabs-annuncio .e-n-tabs-content .e-con.annfu-tab-hidden {
    display: none !important;
    visibility: hidden;
    opacity: 0;
    height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* === FORME FOTO === */

/* Rettangolare (default) */
.annfu-foto-rettangolare .annfu-risultato-foto-wrapper,
.annfu-foto-rettangolare .annfu-risultato-foto-wrapper img,
.annfu-foto-rettangolare .annfu-hcard-photo,
.annfu-foto-rettangolare .annfu-hcard-photo img,
.annfu-foto-rettangolare .annfu-list-photo,
.annfu-foto-rettangolare .annfu-list-photo img,
.annfu-foto-rettangolare .annfu_annunci_foto,
.annfu-foto-rettangolare .annfu_annunci_foto img {
    border-radius: 0;
}

/* Angoli Arrotondati */
.annfu-foto-arrotondata .annfu-risultato-foto-wrapper,
.annfu-foto-arrotondata .annfu-risultato-foto-wrapper img,
.annfu-foto-arrotondata .annfu-hcard-photo,
.annfu-foto-arrotondata .annfu-hcard-photo img,
.annfu-foto-arrotondata .annfu-list-photo,
.annfu-foto-arrotondata .annfu-list-photo img,
.annfu-foto-arrotondata .annfu_annunci_foto,
.annfu-foto-arrotondata .annfu_annunci_foto img {
    border-radius: 12px;
}

/* Circolare */
.annfu-foto-circolare .annfu-risultato-foto-wrapper,
.annfu-foto-circolare .annfu-risultato-foto-wrapper img,
.annfu-foto-circolare .annfu-hcard-photo,
.annfu-foto-circolare .annfu-hcard-photo img,
.annfu-foto-circolare .annfu-list-photo,
.annfu-foto-circolare .annfu-list-photo img,
.annfu-foto-circolare .annfu_annunci_foto,
.annfu-foto-circolare .annfu_annunci_foto img {
    border-radius: 50%;
}

/* Per foto circolare, forza aspect-ratio quadrato */
.annfu-foto-circolare .annfu-risultato-foto-wrapper,
.annfu-foto-circolare .annfu-hcard-photo,
.annfu-foto-circolare .annfu-list-photo,
.annfu-foto-circolare .annfu_annunci_foto {
    aspect-ratio: 1 / 1;
}

/* Ovale */
.annfu-foto-ovale .annfu-risultato-foto-wrapper,
.annfu-foto-ovale .annfu-risultato-foto-wrapper img,
.annfu-foto-ovale .annfu-hcard-photo,
.annfu-foto-ovale .annfu-hcard-photo img,
.annfu-foto-ovale .annfu-list-photo,
.annfu-foto-ovale .annfu-list-photo img,
.annfu-foto-ovale .annfu_annunci_foto,
.annfu-foto-ovale .annfu_annunci_foto img {
    border-radius: 50% / 40%;
}

/* Personalizzata - usa i valori impostati da Elementor */
.annfu-foto-personalizzata .annfu-risultato-foto-wrapper,
.annfu-foto-personalizzata .annfu-hcard-photo,
.annfu-foto-personalizzata .annfu-list-photo,
.annfu-foto-personalizzata .annfu_annunci_foto {
    overflow: hidden;
}

/* === FOTO BIANCO E NERO === */

/* Foto in bianco e nero di default - !important per override Elementor */
.annfu-foto-bn .annfu-risultato-foto-wrapper img,
.annfu-foto-bn .annfu-hcard-photo img,
.annfu-foto-bn .annfu-list-photo img,
.annfu-foto-bn .annfu_annunci_foto img,
.annfu-ricerca-wrapper.annfu-foto-bn .annfu-risultato-foto-wrapper img,
.annfu-ricerca-wrapper.annfu-foto-bn .annfu-hcard-photo img,
.annfu-ricerca-wrapper.annfu-foto-bn .annfu-list-photo img,
.annfu-ricerca-wrapper.annfu-foto-bn .annfu_annunci_foto img {
    filter: grayscale(100%) !important;
    -webkit-filter: grayscale(100%) !important;
    transition: filter 0.4s ease, -webkit-filter 0.4s ease !important;
}

/* Foto a colori all'hover - !important per override Elementor */
.annfu-foto-bn .annfu-risultato-foto-wrapper:hover img,
.annfu-foto-bn .annfu-hcard-photo:hover img,
.annfu-foto-bn .annfu-list-photo:hover img,
.annfu-foto-bn .annfu_annunci_foto:hover img,
.annfu-foto-bn .annfu_annunci_wrapper:hover img,
.annfu-foto-bn .annfu-hcard:hover .annfu-hcard-photo img,
.annfu-foto-bn .annfu-list-item:hover .annfu-list-photo img,
.annfu-ricerca-wrapper.annfu-foto-bn .annfu-risultato-foto-wrapper:hover img,
.annfu-ricerca-wrapper.annfu-foto-bn .annfu-hcard-photo:hover img,
.annfu-ricerca-wrapper.annfu-foto-bn .annfu-list-photo:hover img,
.annfu-ricerca-wrapper.annfu-foto-bn .annfu_annunci_foto:hover img,
.annfu-ricerca-wrapper.annfu-foto-bn .annfu_annunci_wrapper:hover img,
.annfu-ricerca-wrapper.annfu-foto-bn .annfu-hcard:hover .annfu-hcard-photo img,
.annfu-ricerca-wrapper.annfu-foto-bn .annfu-list-item:hover .annfu-list-photo img {
    filter: grayscale(0%) !important;
    -webkit-filter: grayscale(0%) !important;
}

/* === OVERLAY FOTO - Posizionamento relativo per ::after === */
.annfu-risultato-foto-wrapper,
.annfu-hcard-photo,
.annfu-list-photo,
.annfu_annunci_foto {
    position: relative;
    overflow: hidden;
}

/* Assicura che le immagini riempiano il contenitore */
.annfu-risultato-foto-wrapper img,
.annfu-hcard-photo img,
.annfu-list-photo img,
.annfu_annunci_foto img {
    display: block;
    width: 100%;
    height: 100%;
}

/* === EFFETTI HOVER CARD MIGLIORATI === */

/* Overflow hidden per evitare che la scala esca dai bordi */
.annfu-risultato-item,
.annfu-hcard,
.annfu-list-item {
    overflow: hidden;
}

/* Z-index per card hover con scala */
.annfu-risultato-item:hover,
.annfu-hcard:hover,
.annfu-list-item:hover {
    z-index: 10;
    position: relative;
}
