/* ============================================================================
   AgroRural — CSS reCAPTCHA + Login widget + Newsletter AJAX + Comentarios
   ============================================================================ */

/* ============================================================================
   BADGE reCAPTCHA INLINE
   ============================================================================ */
.recaptcha-badge-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background: #f5f8f3;
    border: 1px solid #dde9d5;
    border-radius: 6px;
    font-size: .78rem;
    color: #556b4e;
    line-height: 1.4;
}
.recaptcha-badge-inline i {
    color: #6ab04c;
    font-size: 1rem;
    flex-shrink: 0;
}
.recaptcha-badge-inline strong {
    color: #2d5016;
    font-weight: 700;
}
.recaptcha-badge-inline a {
    color: #2d5016;
    text-decoration: underline;
}
.recaptcha-badge-inline a:hover {
    color: #6ab04c;
}

/* Opcional: ocultar el badge flotante obligatorio de Google
   (Google permite ocultarlo si se muestra el disclaimer manualmente) */
.grecaptcha-badge {
    visibility: hidden !important;
}

/* ============================================================================
   BOTÓN "INICIAR CON GOOGLE" (cuando no hay sesión)
   ============================================================================ */
.btn-google-signin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    color: #3c4043;
    text-decoration: none;
    transition: box-shadow .2s, border-color .2s;
    white-space: nowrap;
}
.btn-google-signin:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    border-color: #6ab04c;
    color: #3c4043;
}
.btn-google-signin svg {
    flex-shrink: 0;
}

/* ============================================================================
   WIDGET USUARIO LOGUEADO EN HEADER (avatar + dropdown)
   ============================================================================ */
.user-header-widget {
    position: relative;
}
.user-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 24px;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    color: #2d5016;
    font-family: inherit;
}
.user-header-btn:hover {
    background: rgba(106, 176, 76, 0.08);
    border-color: #dde9d5;
}
.user-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #e8ecf0;
    flex-shrink: 0;
}
.user-header-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #6ab04c;
    color: #fff;
    font-size: .85rem;
}
.user-header-name {
    font-size: .88rem;
    font-weight: 600;
    color: #2d5016;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-header-caret {
    font-size: .75rem;
    color: #6ab04c;
    margin-left: 2px;
}

.user-header-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 260px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,.14);
    border: 1px solid #e8ecf0;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s, visibility .18s, transform .18s;
    z-index: 1000;
}
.user-header-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-header-menu-head {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
}
.user-header-menu-head img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.user-header-menu-head strong {
    display: block;
    font-size: .92rem;
    color: #2d5016;
    line-height: 1.3;
}
.user-header-menu-head small {
    display: block;
    font-size: .78rem;
    color: #6c7a89;
    line-height: 1.3;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-header-menu-divider {
    height: 1px;
    background: #eef2f5;
    margin: 4px 0;
}
.user-header-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    color: #2d5016;
    text-decoration: none;
    font-size: .88rem;
    transition: background .15s;
}
.user-header-menu-item:hover {
    background: #f5f8f3;
    color: #2d5016;
}
.user-header-menu-item i {
    color: #6ab04c;
    width: 16px;
    text-align: center;
}

/* ============================================================================
   Ajuste del header para acomodar el widget
   ============================================================================ */
.site-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ============================================================================
   NEWSLETTER AJAX MENSAJES
   ============================================================================ */
.newsletter-msg {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: .9rem;
    line-height: 1.4;
    margin-top: 12px;
}
.newsletter-msg-success {
    background: #e6f4df;
    color: #245d0f;
    border: 1px solid #7ec160;
}
.newsletter-msg-error {
    background: #fdecea;
    color: #a33226;
    border: 1px solid #e8a39b;
}

/* ============================================================================
   CONTACTO AJAX MENSAJES
   ============================================================================ */
.contacto-msg {
    display: flex;
    gap: 16px;
    padding: 22px;
    border-radius: 12px;
    margin-top: 10px;
}
.contacto-msg-success {
    background: linear-gradient(135deg, #e6f4df 0%, #d3ecc5 100%);
    border: 1px solid #7ec160;
    color: #1a3009;
}
.contacto-msg-error {
    background: #fdecea;
    border: 1px solid #e8a39b;
    color: #a33226;
}
.contacto-msg-icon {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
}
.contacto-msg-success .contacto-msg-icon { color: #2d5016; }
.contacto-msg-error   .contacto-msg-icon { color: #a33226; }
.contacto-msg-body h4 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 700;
}
.contacto-msg-body p {
    margin: 4px 0;
    line-height: 1.5;
}
.contacto-msg-urgente {
    margin-top: 14px !important;
    padding: 12px;
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
    border-left: 4px solid #2d5016;
}
.contacto-msg-tel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 8px 14px;
    background: #2d5016;
    color: #fff !important;
    border-radius: 20px;
    font-weight: 700;
    text-decoration: none !important;
    font-size: 1rem;
    transition: background .2s;
}
.contacto-msg-tel:hover {
    background: #1a3009;
    color: #fff !important;
}

/* ============================================================================
   COMENTARIOS: indicador de usuario logueado
   ============================================================================ */
.comment-user-logged {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f5f8f3;
    border: 1px solid #dde9d5;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: .9rem;
    color: #2d5016;
}
.comment-user-logged-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.comment-user-logged a {
    color: #6ab04c;
    text-decoration: underline;
    font-size: .82rem;
}
.comment-user-logged a:hover {
    color: #2d5016;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 576px) {
    .user-header-name { display: none; }
    .user-header-menu {
        right: 0;
        left: auto;
        min-width: 240px;
    }
    .contacto-msg {
        flex-direction: column;
        gap: 10px;
    }
    .contacto-msg-icon {
        font-size: 2rem;
    }
    .btn-google-signin {
        padding: 6px 10px;
        font-size: .8rem;
    }
    .btn-google-signin span {
        display: inline;
    }
}
