/* ══════════════════════════════════════════════════════
   IdeaCasa – Agent Contact Card  |  v1.1.0
   ══════════════════════════════════════════════════════ */

/* ── Contenitore card ── */
.agent-contact-card.ideacasa-acc {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,.10);
    padding: 18px 16px 16px;
    font-family: inherit;
    max-width: 320px;
    box-sizing: border-box;
}

/* ── Intestazione ── */
.ideacasa-acc .acc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.ideacasa-acc .acc-photo,
.ideacasa-acc .acc-photo a {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    text-decoration: none;
}
.ideacasa-acc .acc-photo img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.ideacasa-acc .acc-photo-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4caf50;
    font-size: 22px;
}
.ideacasa-acc .acc-identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.ideacasa-acc .acc-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ideacasa-acc .acc-name i {
    color: #888;
    font-size: 13px;
    flex-shrink: 0;
}
.ideacasa-acc .acc-listings-link {
    font-size: 13px;
    color: #4caf50;
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
}
.ideacasa-acc .acc-listings-link:hover {
    color: #388e3c;
    text-decoration: underline;
}

/* ── Wrapper CF7 ── */
.ideacasa-acc .acc-cf7-wrapper {
    margin-bottom: 10px;
}

/* Rimuovi il padding e margini extra che CF7 aggiunge */
.ideacasa-acc .wpcf7 {
    padding: 0;
    margin: 0;
}
.ideacasa-acc .wpcf7 form {
    margin: 0;
    padding: 0;
}
/* Nascondi <br> che CF7 inserisce tra i campi */
.ideacasa-acc .wpcf7 br {
    display: none;
}
/* Normalizza i <p> dei field di CF7 */
.ideacasa-acc .wpcf7 p {
    margin: 0 0 10px;
    padding: 0;
}
.ideacasa-acc .wpcf7 .wpcf7-form-control-wrap {
    display: block;
    margin-bottom: 10px;
}

/* ── Campi CF7: input, select, textarea ── */
.ideacasa-acc .wpcf7 input[type="text"],
.ideacasa-acc .wpcf7 input[type="email"],
.ideacasa-acc .wpcf7 input[type="tel"],
.ideacasa-acc .wpcf7 select,
.ideacasa-acc .wpcf7 textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    color: #444;
    background: #fff;
    margin: 0;
    outline: none;
    transition: border-color .2s;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    line-height: 1.4;
}
.ideacasa-acc .wpcf7 input[type="text"]:focus,
.ideacasa-acc .wpcf7 input[type="email"]:focus,
.ideacasa-acc .wpcf7 input[type="tel"]:focus,
.ideacasa-acc .wpcf7 select:focus,
.ideacasa-acc .wpcf7 textarea:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76,175,80,.12);
}
.ideacasa-acc .wpcf7 textarea {
    resize: vertical;
    min-height: 80px;
}

/* Select: freccia personalizzata */
.ideacasa-acc .wpcf7 select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 28px;
    cursor: pointer;
}

/* ── Errori di validazione CF7 ── */
.ideacasa-acc .wpcf7-not-valid-tip {
    font-size: 11px;
    color: #c62828;
    margin-top: 3px;
    display: block;
}
.ideacasa-acc .wpcf7 input.wpcf7-not-valid,
.ideacasa-acc .wpcf7 select.wpcf7-not-valid,
.ideacasa-acc .wpcf7 textarea.wpcf7-not-valid {
    border-color: #e57373;
}

/* ── Spinner loading CF7 ── */
.ideacasa-acc .wpcf7 .ajax-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #4caf50;
    border-radius: 50%;
    animation: acc-spin .7s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

/* ── Messaggio risposta CF7 ── */
.ideacasa-acc .wpcf7-response-output {
    margin: 8px 0 0;
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 12px;
    line-height: 1.4;
    border: 1px solid transparent;
}
.ideacasa-acc .wpcf7 .wpcf7-mail-sent-ok {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}
.ideacasa-acc .wpcf7 .wpcf7-mail-sent-ng,
.ideacasa-acc .wpcf7 .wpcf7-spam-blocked,
.ideacasa-acc .wpcf7 .wpcf7-validation-errors,
.ideacasa-acc .wpcf7 .wpcf7-acceptance-missing {
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
}

/* ── Pulsante Submit CF7 ── */
.ideacasa-acc .wpcf7 input[type="submit"],
.ideacasa-acc .acc-btn-cf7-submit {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    background: #4caf50;
    color: #fff;
    border: 2px solid #4caf50;
    line-height: 1;
    font-family: inherit;
    margin-top: 2px;
}
.ideacasa-acc .wpcf7 input[type="submit"]:hover,
.ideacasa-acc .wpcf7 input[type="submit"]:focus {
    background: #388e3c;
    border-color: #388e3c;
    color: #fff;
}
.ideacasa-acc .wpcf7 input[type="submit"]:disabled {
    opacity: .6;
    cursor: wait;
}

/* ── Pulsanti extra: Chiama + WhatsApp ── */
.ideacasa-acc .acc-extra-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.ideacasa-acc .acc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    white-space: nowrap;
    box-sizing: border-box;
    border: 2px solid transparent;
    line-height: 1;
    width: 100%;
}
/* Chiama */
.ideacasa-acc .acc-btn-call {
    background: #fff;
    color: #4caf50 !important;
    border-color: #4caf50;
}
.ideacasa-acc .acc-btn-call:hover,
.ideacasa-acc .acc-btn-call:focus {
    background: #f1f8e9;
    color: #388e3c !important;
}
/* WhatsApp */
.ideacasa-acc .acc-btn-whatsapp {
    background: #fff;
    color: #25d366 !important;
    border-color: #25d366;
}
.ideacasa-acc .acc-btn-whatsapp i { font-size: 16px; }
.ideacasa-acc .acc-btn-whatsapp:hover,
.ideacasa-acc .acc-btn-whatsapp:focus {
    background: #e8faf0;
    color: #1da851 !important;
}
/* Vedi profilo (fallback senza email) */
.ideacasa-acc .acc-btn-send {
    background: #4caf50;
    color: #fff !important;
    border-color: #4caf50;
}
.ideacasa-acc .acc-btn-send:hover {
    background: #388e3c;
    border-color: #388e3c;
}

/* ── Messaggi di avviso (CF7 non configurato) ── */
.ideacasa-acc .acc-notice-error {
    font-size: 12px;
    color: #c62828;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 5px;
    padding: 7px 10px;
    margin: 0 0 10px;
}

/* ── Spinner animazione ── */
@keyframes acc-spin { to { transform: rotate(360deg); } }

/* ── Griglia nella lista agenti ── */
.agents-card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin: 0;
    padding: 0;
}
.agents-card-grid .agent-card-col {
    flex: 0 0 calc(33.333% - 16px);
    min-width: 260px;
}
@media (max-width: 980px) {
    .agents-card-grid .agent-card-col { flex: 0 0 calc(50% - 12px); }
}
@media (max-width: 600px) {
    .agents-card-grid .agent-card-col { flex: 0 0 100%; }
    .agent-contact-card.ideacasa-acc { max-width: 100%; }
}

/* ── Widget sidebar: larghezza piena ── */
.ideacasa-acc-widget .agent-contact-card.ideacasa-acc {
    max-width: 100%;
}
